From 8a74ccbcfc1471bbd3fad54250a3d22398e62772 Mon Sep 17 00:00:00 2001 From: Keshav Bhatt Date: Mon, 4 Jul 2022 23:43:48 +0530 Subject: chore(ui): update ui color - update color to match vendor specified one in settings widget - add bottom strip in lock dialog --- src/lock.cpp | 29 +- src/lock.ui | 712 +++++++++++++++++++++++++++---------------------- src/settingswidget.cpp | 48 ++-- src/settingswidget.ui | 8 +- 4 files changed, 445 insertions(+), 352 deletions(-) (limited to 'src') diff --git a/src/lock.cpp b/src/lock.cpp index 3c47fb2..46b38cd 100644 --- a/src/lock.cpp +++ b/src/lock.cpp @@ -96,13 +96,15 @@ void Lock::applyThemeQuirks() { })"); ui->widget_2->setStyleSheet(R"(QWidget#widget_2 { - border-radius: 5px; - background-image: url(":/icons/texture.png"); - background-color: palette(shadow); + border-top-left-radius: 4px; + border-top-right-radius: 4px; + background-image: url(":/icons/texture.png"); + background-color: palette(shadow); })"); ui->widget->setStyleSheet(R"(QWidget#widget{ - border-radius: 5px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; background-image:url(":/icons/texture.png"); background-color:palette(shadow); })"); @@ -110,6 +112,20 @@ void Lock::applyThemeQuirks() { ui->centerWidget->setStyleSheet(R"(QWidget#centerWidget { background-image: url(":/icons/wa_bg.png"); })"); + + // little quirks + QString border = "border-bottom-right-radius: 4px;" + "border-bottom-left-radius: 4px;"; + QString lightBg = "background-color: rgb(37, 211, 102);"; + QString darkBg = "background-color: rgb(0, 117, 96);"; + if (QString::compare(settings.value("windowTheme", "light").toString(), + "dark", Qt::CaseInsensitive) == 0) { // light + ui->bottomLine->setStyleSheet(darkBg + border); + ui->bottomLine_2->setStyleSheet(darkBg + border); + } else { // dark + ui->bottomLine->setStyleSheet(lightBg + border); + ui->bottomLine_2->setStyleSheet(lightBg + border); + } } Lock::~Lock() { delete ui; } @@ -132,10 +148,7 @@ void Lock::keyReleaseEvent(QKeyEvent *event) { bool Lock::event(QEvent *e) { return QWidget::event(e); } -bool Lock::getIsLocked() const -{ - return isLocked; -} +bool Lock::getIsLocked() const { return isLocked; } void Lock::on_passcode1_textChanged(const QString &arg1) { if (arg1.contains(" ")) { diff --git a/src/lock.ui b/src/lock.ui index 264bb7d..de4df9a 100644 --- a/src/lock.ui +++ b/src/lock.ui @@ -6,8 +6,8 @@ 0 0 - 810 - 510 + 936 + 680 @@ -96,181 +96,216 @@ - - - + + + 0 - - - 10 - - - QLayout::SetMinimumSize - - - 20 - - - 20 - - - 20 - - - 20 - - - + + 0 + + + 0 + + + + + + + + + 10 + + + QLayout::SetMinimumSize + + + 20 + - 0 + 20 + + + 20 - 5 + 20 - - - Qt::Horizontal + + + 0 - - - 40 - 20 - + + 5 - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 128 + 128 + + + + background-color:transparent; + + + + + + :/icons/app/icon-128.png + + + Qt::AlignCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - + + + + 14 + + + + Set lock passcode + + + Qt::AlignCenter + + + true + + + + + - 128 - 128 + 0 + 30 - - background-color:transparent; + + QLineEdit::Password - - + + Qt::AlignCenter + + + enter passcode + + + + + + + + 0 + 30 + - - :/icons/app/icon-128.png + + QLineEdit::Password Qt::AlignCenter + + enter passcode again + - - - Qt::Horizontal + + + + 0 + 30 + + + + Set Pass Code - + + + + + - 40 - 20 + 0 + 30 - + + Cancel + + + + + + + Warning: Caps Lock is On + + + Qt::AlignCenter + + - - - - - - 14 - - - - Set lock passcode - - - Qt::AlignCenter - - - true - - - - - - - - 0 - 30 - - - - QLineEdit::Password - - - Qt::AlignCenter - - - enter passcode - - - - - - - - 0 - 30 - - - - QLineEdit::Password - - - Qt::AlignCenter - - - enter passcode again - - - - - - - - 0 - 30 - - - - Set Pass Code - - - - - - - - 0 - 30 - - - - Cancel - - - - - - - Warning: Caps Lock is On - - - Qt::AlignCenter - - - - - + + + + + + + 6 + 0 + + + + + 16777215 + 6 + + + + background-color: rgb(6, 207, 156); +border-bottom-right-radius: 4px; +border-bottom-left-radius: 4px; + + + + + @@ -398,127 +433,213 @@ - - - + + + 0 + + + 0 - - - 10 - - - 20 - - - 20 - - - 20 - - - 20 - - - + + 0 + + + + + + + + + 10 + + + 20 + - 0 + 20 + + + 20 - 0 + 20 - - - Qt::Horizontal + + + 0 - - - 40 - 20 - + + 0 - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 128 + 128 + + + + background-color:transparent; + + + + + + :/icons/app/icon-128.png + + + Qt::AlignCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - - - - 128 - 128 - + + + 0 - - background-color:transparent; + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 32 + 32 + + + + + 32 + 32 + + + + background-color:transparent; + + + + + + :/icons/lock-2-fill.png + + + true + + + Qt::AlignCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 14 + - - - - :/icons/app/icon-128.png + Enter your passcode to get access to app Qt::AlignCenter + + true + - - - Qt::Horizontal - - + + - 40 - 20 + 0 + 30 - - - - - - - - 0 - - - - - Qt::Horizontal + + QLineEdit::Password - - - 40 - 20 - + + Qt::AlignCenter - + + enter your passcode + + - + - 32 - 32 + 0 + 30 - - - 32 - 32 - - - - background-color:transparent; - - + Unlock - - :/icons/lock-2-fill.png - - - true + + + + + + Warning: Caps Lock is On Qt::AlignCenter @@ -526,95 +647,44 @@ - - - Qt::Horizontal + + + <html><head/><body><p>Wrong Passcode, Please try again.</p></body></html> - - - 40 - 20 - + + Qt::AlignCenter + + + true - + - - - - - - 14 - - - - Enter your passcode to get access to app - - - Qt::AlignCenter - - - true - - - - - - - - 0 - 30 - - - - QLineEdit::Password - - - Qt::AlignCenter - - - enter your passcode - - - - - - - - 0 - 30 - - - - Unlock - - - - - - - Warning: Caps Lock is On - - - Qt::AlignCenter - - - - - - - <html><head/><body><p>Wrong Passcode, Please try again.</p></body></html> - - - Qt::AlignCenter - - - true - - - - - + + + + + + + 6 + 0 + + + + + 16777215 + 6 + + + + background-color: rgb(6, 207, 156); +border-bottom-right-radius: 4px; +border-bottom-left-radius: 4px; + + + + + diff --git a/src/settingswidget.cpp b/src/settingswidget.cpp index a58a967..1a385f1 100644 --- a/src/settingswidget.cpp +++ b/src/settingswidget.cpp @@ -56,7 +56,8 @@ SettingsWidget::SettingsWidget(QWidget *parent, int screenNumber, ui->startMinimized->setChecked( settings.value("startMinimized", false).toBool()); - this->appAutoLockingSetChecked(settings.value("appAutoLocking", defaultAppAutoLock).toBool()); + this->appAutoLockingSetChecked( + settings.value("appAutoLocking", defaultAppAutoLock).toBool()); ui->autoLockDurationSpinbox->setValue( settings.value("autoLockDuration", defaultAppAutoLockDuration).toInt()); @@ -303,9 +304,8 @@ void SettingsWidget::on_deleteCache_clicked() { void SettingsWidget::on_deletePersistentData_clicked() { QMessageBox msgBox; - msgBox.setText( - "This will delete Persistent Data ! Persistent data includes " - "persistent cookies, HTML5 local storage, and visited links."); + msgBox.setText("This will delete Persistent Data ! Persistent data includes " + "persistent cookies, HTML5 local storage, and visited links."); msgBox.setIconPixmap( QPixmap(":/icons/information-line.png") .scaled(42, 42, Qt::KeepAspectRatio, Qt::SmoothTransformation)); @@ -344,13 +344,25 @@ void SettingsWidget::applyThemeQuirks() { // little quirks if (QString::compare(ui->themeComboBox->currentText(), "dark", Qt::CaseInsensitive) == 0) { - ui->bottomLine->setStyleSheet("background-color: rgb(5, 97, 98);"); + ui->bottomLine->setStyleSheet("background-color: rgb(0, 117, 96);"); ui->label_7->setStyleSheet( "color:#c2c5d1;padding: 0px 8px 0px 8px;background:transparent;"); + ui->headerWidget->setStyleSheet("background-color: qlineargradient(" + "spread:reflect, x1:0, y1:1, x2:1, y2:1," + "stop:0 rgba(0, 117, 96, 255), " + "stop:0.328358 rgba(0, 117, 96, 144)," + "stop:0.61194 rgba(0, 117, 96, 78)," + "stop:0.895522 rgba(0, 117, 96, 6));"); } else { - ui->bottomLine->setStyleSheet("background-color: rgb(74, 223, 131);"); + ui->bottomLine->setStyleSheet("background-color: rgb(37, 211, 102);"); ui->label_7->setStyleSheet( "color:#1e1f21;padding: 0px 8px 0px 8px;background:transparent;"); + ui->headerWidget->setStyleSheet("background-color: qlineargradient(" + "spread:reflect, x1:0, y1:1, x2:1, y2:1," + "stop:0 rgba(37, 211, 102, 200), " + "stop:0.328358 rgba(37, 211, 102, 122)," + "stop:0.61194 rgba(37, 211, 102, 68)," + "stop:0.895522 rgba(37, 211, 102, 6));"); } } @@ -429,18 +441,18 @@ void SettingsWidget::appAutoLockingSetChecked(bool checked) { ui->appAutoLockcheckBox->blockSignals(false); } -void SettingsWidget::toggleTheme() -{ - //disable automatic theme first - if(settings.value("automaticTheme", false).toBool()){ - emit notify(tr("Automatic theme switching was disabled due to manual theme toggle.")); - ui->automaticThemeCheckBox->setChecked(false); - } - if(ui->themeComboBox->currentIndex() == 0){ - ui->themeComboBox->setCurrentIndex(1); - }else{ - ui->themeComboBox->setCurrentIndex(0); - } +void SettingsWidget::toggleTheme() { + // disable automatic theme first + if (settings.value("automaticTheme", false).toBool()) { + emit notify(tr( + "Automatic theme switching was disabled due to manual theme toggle.")); + ui->automaticThemeCheckBox->setChecked(false); + } + if (ui->themeComboBox->currentIndex() == 0) { + ui->themeComboBox->setCurrentIndex(1); + } else { + ui->themeComboBox->setCurrentIndex(0); + } } void SettingsWidget::setCurrentPasswordText(QString str) { diff --git a/src/settingswidget.ui b/src/settingswidget.ui index 900d949..1b259a8 100644 --- a/src/settingswidget.ui +++ b/src/settingswidget.ui @@ -38,9 +38,7 @@ - /*background-color: qlineargradient(spread:reflect, x1:0, y1:1, x2:1, y2:1, stop:0 rgba(63, 129, 216, 255), stop:0.328358 rgba(63, 129, 216, 111), stop:0.61194 rgba(63, 129, 216, 48), stop:0.895522 rgba(63, 129, 216, 15));*/ - -background-color: qlineargradient(spread:reflect, x1:0, y1:1, x2:1, y2:1, stop:0 rgba(28, 139, 130, 255), stop:0.328358 rgba(28, 139, 130, 144), stop:0.61194 rgba(28, 139, 130, 78), stop:0.895522 rgba(28, 139, 130, 6)); + @@ -97,7 +95,7 @@ background:transparent; 0 - -14 + 0 677 791 @@ -1070,7 +1068,7 @@ background:transparent; - background-color: rgb(74, 223, 131); + background-color: rgb(6, 207, 156); -- cgit v1.2.3