diff options
author | 2022-07-05 00:47:21 +0530 | |
---|---|---|
committer | 2022-07-05 00:47:21 +0530 | |
commit | 9f566869d49578b12e445f8c275e7f8067daf5be (patch) | |
tree | c0c4fb7fc6577ed562fd0311a3c01cf1cb2f18bb | |
parent | 974933d025cbfee79fe4f987ad62272621e7e373 (diff) | |
parent | cee2dc85e3ce245813b01be3f01457cc88305288 (diff) | |
download | whatsie-9f566869d49578b12e445f8c275e7f8067daf5be.tar.gz whatsie-9f566869d49578b12e445f8c275e7f8067daf5be.zip |
chore: Merge branch 'dev'v4.7.1
-rw-r--r-- | src/lock.cpp | 29 | ||||
-rw-r--r-- | src/lock.ui | 712 | ||||
-rw-r--r-- | src/mainwindow.cpp | 40 | ||||
-rw-r--r-- | src/mainwindow.h | 2 | ||||
-rw-r--r-- | src/settingswidget.cpp | 49 | ||||
-rw-r--r-- | src/settingswidget.ui | 8 |
6 files changed, 469 insertions, 371 deletions
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 @@ <rect> <x>0</x> <y>0</y> - <width>810</width> - <height>510</height> + <width>936</width> + <height>680</height> </rect> </property> <property name="sizePolicy"> @@ -96,181 +96,216 @@ </spacer> </item> <item> - <widget class="QWidget" name="widget_2" native="true"> - <property name="styleSheet"> - <string notr="true"/> + <layout class="QVBoxLayout" name="verticalLayout_10"> + <property name="spacing"> + <number>0</number> </property> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <property name="spacing"> - <number>10</number> - </property> - <property name="sizeConstraint"> - <enum>QLayout::SetMinimumSize</enum> - </property> - <property name="leftMargin"> - <number>20</number> - </property> - <property name="topMargin"> - <number>20</number> - </property> - <property name="rightMargin"> - <number>20</number> - </property> - <property name="bottomMargin"> - <number>20</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QWidget" name="widget_2" native="true"> + <property name="styleSheet"> + <string notr="true"/> + </property> + <layout class="QVBoxLayout" name="verticalLayout_4"> + <property name="spacing"> + <number>10</number> + </property> + <property name="sizeConstraint"> + <enum>QLayout::SetMinimumSize</enum> + </property> + <property name="leftMargin"> + <number>20</number> + </property> <property name="topMargin"> - <number>0</number> + <number>20</number> + </property> + <property name="rightMargin"> + <number>20</number> </property> <property name="bottomMargin"> - <number>5</number> + <number>20</number> </property> <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="topMargin"> + <number>0</number> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> + <property name="bottomMargin"> + <number>5</number> </property> - </spacer> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label"> + <property name="minimumSize"> + <size> + <width>128</width> + <height>128</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">background-color:transparent;</string> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="icons.qrc">:/icons/app/icon-128.png</pixmap> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> </item> <item> - <widget class="QLabel" name="label"> + <widget class="QLabel" name="label_3"> + <property name="font"> + <font> + <pointsize>14</pointsize> + </font> + </property> + <property name="text"> + <string>Set lock passcode</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="passcode1"> <property name="minimumSize"> <size> - <width>128</width> - <height>128</height> + <width>0</width> + <height>30</height> </size> </property> - <property name="styleSheet"> - <string notr="true">background-color:transparent;</string> + <property name="echoMode"> + <enum>QLineEdit::Password</enum> </property> - <property name="text"> - <string/> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="placeholderText"> + <string>enter passcode</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="passcode2"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> </property> - <property name="pixmap"> - <pixmap resource="icons.qrc">:/icons/app/icon-128.png</pixmap> + <property name="echoMode"> + <enum>QLineEdit::Password</enum> </property> <property name="alignment"> <set>Qt::AlignCenter</set> </property> + <property name="placeholderText"> + <string>enter passcode again</string> + </property> </widget> </item> <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <widget class="QPushButton" name="setPass"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="text"> + <string>Set Pass Code</string> </property> - <property name="sizeHint" stdset="0"> + </widget> + </item> + <item> + <widget class="QPushButton" name="cancelSetting"> + <property name="minimumSize"> <size> - <width>40</width> - <height>20</height> + <width>0</width> + <height>30</height> </size> </property> - </spacer> + <property name="text"> + <string>Cancel</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="caps2"> + <property name="text"> + <string>Warning: Caps Lock is On</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> </item> </layout> - </item> - <item> - <widget class="QLabel" name="label_3"> - <property name="font"> - <font> - <pointsize>14</pointsize> - </font> - </property> - <property name="text"> - <string>Set lock passcode</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="passcode1"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="echoMode"> - <enum>QLineEdit::Password</enum> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="placeholderText"> - <string>enter passcode</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="passcode2"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="echoMode"> - <enum>QLineEdit::Password</enum> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="placeholderText"> - <string>enter passcode again</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="setPass"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="text"> - <string>Set Pass Code</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="cancelSetting"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="text"> - <string>Cancel</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="caps2"> - <property name="text"> - <string>Warning: Caps Lock is On</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - </layout> - </widget> + </widget> + </item> + <item> + <widget class="QWidget" name="bottomLine_2" native="true"> + <property name="minimumSize"> + <size> + <width>6</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>6</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">background-color: rgb(6, 207, 156); +border-bottom-right-radius: 4px; +border-bottom-left-radius: 4px;</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_11"/> + </widget> + </item> + </layout> </item> <item> <spacer name="horizontalSpacer_8"> @@ -398,127 +433,213 @@ </spacer> </item> <item> - <widget class="QWidget" name="widget" native="true"> - <property name="styleSheet"> - <string notr="true"/> + <layout class="QVBoxLayout" name="verticalLayout_8"> + <property name="spacing"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> </property> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <property name="spacing"> - <number>10</number> - </property> - <property name="leftMargin"> - <number>20</number> - </property> - <property name="topMargin"> - <number>20</number> - </property> - <property name="rightMargin"> - <number>20</number> - </property> - <property name="bottomMargin"> - <number>20</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QWidget" name="widget" native="true"> + <property name="styleSheet"> + <string notr="true"/> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="spacing"> + <number>10</number> + </property> + <property name="leftMargin"> + <number>20</number> + </property> <property name="topMargin"> - <number>0</number> + <number>20</number> + </property> + <property name="rightMargin"> + <number>20</number> </property> <property name="bottomMargin"> - <number>0</number> + <number>20</number> </property> <item> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="topMargin"> + <number>0</number> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> + <property name="bottomMargin"> + <number>0</number> </property> - </spacer> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label_2"> + <property name="minimumSize"> + <size> + <width>128</width> + <height>128</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">background-color:transparent;</string> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="icons.qrc">:/icons/app/icon-128.png</pixmap> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> </item> <item> - <widget class="QLabel" name="label_2"> - <property name="minimumSize"> - <size> - <width>128</width> - <height>128</height> - </size> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <property name="bottomMargin"> + <number>0</number> </property> - <property name="styleSheet"> - <string notr="true">background-color:transparent;</string> + <item> + <spacer name="horizontalSpacer_9"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label_5"> + <property name="minimumSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">background-color:transparent;</string> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="icons.qrc">:/icons/lock-2-fill.png</pixmap> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_10"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QLabel" name="label_4"> + <property name="font"> + <font> + <pointsize>14</pointsize> + </font> </property> <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="icons.qrc">:/icons/app/icon-128.png</pixmap> + <string>Enter your passcode to get access to app</string> </property> <property name="alignment"> <set>Qt::AlignCenter</set> </property> + <property name="wordWrap"> + <bool>true</bool> + </property> </widget> </item> <item> - <spacer name="horizontalSpacer_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> + <widget class="QLineEdit" name="passcodeLogin"> + <property name="minimumSize"> <size> - <width>40</width> - <height>20</height> + <width>0</width> + <height>30</height> </size> </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <spacer name="horizontalSpacer_9"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <property name="echoMode"> + <enum>QLineEdit::Password</enum> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> + <property name="alignment"> + <set>Qt::AlignCenter</set> </property> - </spacer> + <property name="placeholderText"> + <string>enter your passcode</string> + </property> + </widget> </item> <item> - <widget class="QLabel" name="label_5"> + <widget class="QPushButton" name="unlock"> <property name="minimumSize"> <size> - <width>32</width> - <height>32</height> + <width>0</width> + <height>30</height> </size> </property> - <property name="maximumSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">background-color:transparent;</string> - </property> <property name="text"> - <string/> + <string>Unlock</string> </property> - <property name="pixmap"> - <pixmap resource="icons.qrc">:/icons/lock-2-fill.png</pixmap> - </property> - <property name="scaledContents"> - <bool>true</bool> + </widget> + </item> + <item> + <widget class="QLabel" name="caps1"> + <property name="text"> + <string>Warning: Caps Lock is On</string> </property> <property name="alignment"> <set>Qt::AlignCenter</set> @@ -526,95 +647,44 @@ </widget> </item> <item> - <spacer name="horizontalSpacer_10"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <widget class="QLabel" name="wrong"> + <property name="text"> + <string><html><head/><body><p>Wrong Passcode, Please try again.</p></body></html></string> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap"> + <bool>true</bool> </property> - </spacer> + </widget> </item> </layout> - </item> - <item> - <widget class="QLabel" name="label_4"> - <property name="font"> - <font> - <pointsize>14</pointsize> - </font> - </property> - <property name="text"> - <string>Enter your passcode to get access to app</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="passcodeLogin"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="echoMode"> - <enum>QLineEdit::Password</enum> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="placeholderText"> - <string>enter your passcode</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="unlock"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="text"> - <string>Unlock</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="caps1"> - <property name="text"> - <string>Warning: Caps Lock is On</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="wrong"> - <property name="text"> - <string><html><head/><body><p>Wrong Passcode, Please try again.</p></body></html></string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> + </widget> + </item> + <item> + <widget class="QWidget" name="bottomLine" native="true"> + <property name="minimumSize"> + <size> + <width>6</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>6</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">background-color: rgb(6, 207, 156); +border-bottom-right-radius: 4px; +border-bottom-left-radius: 4px;</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_9"/> + </widget> + </item> + </layout> </item> <item> <spacer name="horizontalSpacer_5"> diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3cc8367..5a7e6e2 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -500,8 +500,7 @@ void MainWindow::closeEvent(QCloseEvent *event) { this->hide(); event->ignore(); if (settings.value("firstrun_tray", true).toBool()) { - notify(QApplication::applicationName(), - "Minimized to system tray."); + notify(QApplication::applicationName(), "Minimized to system tray."); settings.setValue("firstrun_tray", false); } return; @@ -579,9 +578,7 @@ void MainWindow::createActions() { reloadAction = new QAction(tr("Re&load"), this); reloadAction->setShortcut(Qt::Key_F5); - connect(reloadAction, &QAction::triggered,this, [=]{ - this->doReload(); - }); + connect(reloadAction, &QAction::triggered, this, [=] { this->doReload(); }); addAction(reloadAction); lockAction = new QAction(tr("Loc&k"), this); @@ -1072,7 +1069,7 @@ void MainWindow::loadingQuirk(QString test) { if (correctlyLoaderRetries > -1) { qWarning() << test << "checkLoadedCorrectly()/loadingQuirk()/doReload()" << correctlyLoaderRetries; - doReload(); + doReload(false, false, true); correctlyLoaderRetries--; } else { utils::delete_cache(webEngine->page()->profile()->cachePath()); @@ -1181,22 +1178,29 @@ bool MainWindow::isPhoneNumber(const QString &phoneNumber) { return reg.match(phoneNumber).hasMatch(); } -void MainWindow::doReload(bool byPassCache, bool isAskedByCLI) { - if (lockWidget && !lockWidget->getIsLocked()) { - this->notify(QApplication::applicationName(), QObject::tr("Reloading...")); +void MainWindow::doReload(bool byPassCache, bool isAskedByCLI, + bool byLoadingQuirk) { + if (byLoadingQuirk) { + this->webEngine->triggerPageAction(QWebEnginePage::ReloadAndBypassCache, + byPassCache); } else { - QString error = tr("Unlock to Reload the App."); - if (isAskedByCLI) { - this->notify(QApplication::applicationName() + "| Error", error); + if (lockWidget && !lockWidget->getIsLocked()) { + this->notify(QApplication::applicationName(), + QObject::tr("Reloading...")); } else { - QMessageBox::critical(this, QApplication::applicationName() + "| Error", - error); + QString error = tr("Unlock to Reload the App."); + if (isAskedByCLI) { + this->notify(QApplication::applicationName() + "| Error", error); + } else { + QMessageBox::critical(this, QApplication::applicationName() + "| Error", + error); + } + this->show(); + return; } - this->show(); - return; + this->webEngine->triggerPageAction(QWebEnginePage::ReloadAndBypassCache, + byPassCache); } - this->webEngine->triggerPageAction(QWebEnginePage::ReloadAndBypassCache, - byPassCache); } void MainWindow::toggleMute(const bool &checked) { diff --git a/src/mainwindow.h b/src/mainwindow.h index f8a4ff5..76abe86 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -55,7 +55,7 @@ public slots: void alreadyRunning(bool notify = false); void notify(QString title, QString message); void toggleTheme(); - void doReload(bool byPassCache = false, bool isAskedByCLI = false); + void doReload(bool byPassCache = false, bool isAskedByCLI = false, bool byLoadingQuirk = false); void newChat(); protected slots: void closeEvent(QCloseEvent *event) override; diff --git a/src/settingswidget.cpp b/src/settingswidget.cpp index a58a967..1322e17 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) { @@ -718,6 +730,7 @@ void SettingsWidget::on_userAgentLineEdit_editingFinished() { void SettingsWidget::on_viewPassword_clicked() { ui->current_password->setEchoMode(QLineEdit::Normal); ui->viewPassword->setEnabled(false); + ui->current_password->setFocus(); QTimer *timer = new QTimer(this); timer->setInterval(5000); connect(timer, &QTimer::timeout, ui->current_password, [=]() { 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 @@ </sizepolicy> </property> <property name="styleSheet"> - <string notr="true">/*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)); + <string notr="true"> </string> </property> <layout class="QHBoxLayout" name="horizontalLayout_7"> @@ -97,7 +95,7 @@ background:transparent; <property name="geometry"> <rect> <x>0</x> - <y>-14</y> + <y>0</y> <width>677</width> <height>791</height> </rect> @@ -1070,7 +1068,7 @@ background:transparent; </size> </property> <property name="styleSheet"> - <string notr="true">background-color: rgb(74, 223, 131);</string> + <string notr="true">background-color: rgb(6, 207, 156);</string> </property> <layout class="QVBoxLayout" name="verticalLayout_4"/> </widget> |