| 16 | #include <QIcon> |
| 17 | |
| 18 | UpdateDriverDialog::UpdateDriverDialog(const QString &deviceName, |
| 19 | QWidget *parent) |
| 20 | : QDialog(parent) { |
| 21 | setWindowTitle("Update Driver Software - " + deviceName); |
| 22 | setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint); |
| 23 | setFixedSize(500, 280); |
| 24 | |
| 25 | auto *v = new QVBoxLayout(this); |
| 26 | v->setContentsMargins(0, 0, 0, 0); |
| 27 | v->setSpacing(0); |
| 28 | |
| 29 | auto *content = new QWidget; |
| 30 | QPalette p = content->palette(); |
| 31 | p.setColor(QPalette::Window, p.color(QPalette::Base)); |
| 32 | content->setPalette(p); |
| 33 | content->setAutoFillBackground(true); |
| 34 | auto *cv = new QVBoxLayout(content); |
| 35 | cv->setContentsMargins(20, 20, 20, 20); |
| 36 | cv->setSpacing(0); |
| 37 | v->addWidget(content, 1); |
| 38 | |
| 39 | auto *title = new QLabel( |
| 40 | "How do you want to search for driver software?"); |
| 41 | QFont f = title->font(); |
| 42 | f.setPointSize(f.pointSize() + 3); |
| 43 | title->setFont(f); |
| 44 | title->setWordWrap(true); |
| 45 | cv->addWidget(title); |
| 46 | cv->addSpacing(16); |
| 47 | |
| 48 | QString flatStyle = R"( |
| 49 | QCommandLinkButton { |
| 50 | border: none; |
| 51 | background: transparent; |
| 52 | text-align: left; |
| 53 | } |
| 54 | QCommandLinkButton:hover { |
| 55 | background: rgba(235, 244, 252, 200); |
| 56 | border: 1px solid rgba(120, 174, 229, 220); |
| 57 | border-radius: 3px; |
| 58 | } |
| 59 | QCommandLinkButton:pressed { |
| 60 | background: rgba(210, 232, 248, 220); |
| 61 | border: 1px solid rgba(90, 150, 210, 240); |
| 62 | border-radius: 3px; |
| 63 | } |
| 64 | )"; |
| 65 | auto *autoBtn = new QCommandLinkButton( |
| 66 | "Search automatically for updated driver software", |
| 67 | "Discover will search your computer and the Internet for " |
| 68 | "the latest driver software for your device."); |
| 69 | autoBtn->setIcon(themeIcon({"go-next", "stock_next", "go-forward"})); |
| 70 | autoBtn->setIconSize(QSize(16, 16)); |
| 71 | autoBtn->setStyleSheet(flatStyle); |
| 72 | cv->addWidget(autoBtn); |
| 73 | cv->addSpacing(8); |
| 74 | |
| 75 | auto *browseBtn = new QCommandLinkButton( |
nothing calls this directly
no test coverage detected