diff --git a/src/UserInterface/Button/function_classify_button.cpp b/src/UserInterface/Button/function_classify_button.cpp index 8ddabe1..ffed89c 100755 --- a/src/UserInterface/Button/function_classify_button.cpp +++ b/src/UserInterface/Button/function_classify_button.cpp @@ -117,11 +117,16 @@ void FunctionClassifyButton::paintEvent(QPaintEvent *e) painter.save(); QColor color; - if ( g_curStyle == "ukui-light") { - color = Qt::black; + if (m_fullscreen) { + color = Qt::white; } else { - color = Qt::white; + if ( g_curStyle == "ukui-light") { + color = Qt::black; + } else { + color = Qt::white; + } } + color.setAlphaF(0.9); painter.setPen(color); painter.drawText(option.rect, Qt::AlignCenter, m_category); diff --git a/src/UserInterface/Button/letter_classify_button.cpp b/src/UserInterface/Button/letter_classify_button.cpp index 624c38e..11073a8 100755 --- a/src/UserInterface/Button/letter_classify_button.cpp +++ b/src/UserInterface/Button/letter_classify_button.cpp @@ -102,11 +102,16 @@ void LetterClassifyButton::paintEvent(QPaintEvent *e) painter.save(); QColor color; - if ( g_curStyle == "ukui-light") { - color = Qt::black; + if (m_fullscreen) { + color = Qt::white; } else { - color = Qt::white; + if ( g_curStyle == "ukui-light") { + color = Qt::black; + } else { + color = Qt::white; + } } + color.setAlphaF(0.9); painter.setPen(color); painter.drawText(option.rect, Qt::AlignCenter, m_letter); diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp index 3ccb33f..555c6a6 100755 --- a/src/UserInterface/full_mainwindow.cpp +++ b/src/UserInterface/full_mainwindow.cpp @@ -123,6 +123,13 @@ void FullMainWindow::initSearchUI() if (key.contains(QString("styleName"))) { changeStyle(); } + + if (key.contains(QString("theme-color"))) { + QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16); + QString color = highLightColor.mid(2, 6); + QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color); + m_lineEdit->setStyleSheet(searchStyle); + } }); } @@ -294,7 +301,7 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event) QString style; if (event->type() == QEvent::FocusIn) { - QString highLightColor = QString::number(m_lineEdit->palette().color(QPalette::Highlight).rgba(), 16); + QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16); QString color = highLightColor.mid(2, 6); style = QString("QLineEdit{border:2px solid #%1;background-color:%2;border-radius:17px;color:#ffffff;}") .arg(color).arg(QueryLineEditClickedBackground); diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index cc67dcb..355a8bd 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -275,6 +275,13 @@ void MainWindow::initGsettings() if (key.contains(QString("styleName"))) { changeStyle(); } + + if (key.contains(QString("theme-color"))) { + QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16); + QString color = highLightColor.mid(2, 6); + QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color); + m_lineEdit->setStyleSheet(searchStyle); + } }); } } @@ -317,7 +324,7 @@ void MainWindow::initSearchUi() m_leftTopSearchHorizontalLayout->setContentsMargins(8, 0, 8, 0); m_lineEdit = new QLineEdit(m_minSearchPage); m_lineEdit->setMinimumSize(QSize(30, 26)); - QString highLightColor = QString::number(m_lineEdit->palette().color(QPalette::Highlight).rgba(), 16); + QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16); QString color = highLightColor.mid(2, 6); QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color); m_lineEdit->setStyleSheet(searchStyle); @@ -942,6 +949,15 @@ bool MainWindow::eventFilter(QObject *target, QEvent *event) } } + if (target == m_lineEdit) { + if (event->type() == QEvent::FocusIn) { + QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16); + QString color = highLightColor.mid(2, 6); + QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color); + m_lineEdit->setStyleSheet(searchStyle); + } + } + if (event->type() == QEvent::KeyPress) { QKeyEvent *ke = (QKeyEvent *)event;