diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index fe8c850..2c00bbb 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -75,6 +75,11 @@ MainWindow::MainWindow(QWidget *parent) : if (QGSettings::isSchemaInstalled(id)) { m_transparency_gsettings = new QGSettings(id); } + + connect(qApp, &QApplication::paletteChanged, this, [ = ](const QPalette &pal) { + this->setPalette(pal); + this->update(); + }); } MainWindow::~MainWindow() @@ -325,22 +330,18 @@ void MainWindow::searchContent(QString searchcontent){ //使用GSetting获取当前窗口应该使用的透明度 double MainWindow::getTransparentData() { - //todo modify here!!!!!!!!!!!!!!!!!!!!!!!!!!!! - //todo modify here!!!!!!!!!!!!!!!!!!!!!!!!!!!! - //todo modify here!!!!!!!!!!!!!!!!!!!!!!!!!!!! - //if you have questions, please ask iaom or MouseZhangZh -// return GlobalSettings::getInstance()->getValue(TRANSPARENCY_KEY).toDouble(); - if (!m_transparency_gsettings) { - return 0.7; - } + return GlobalSettings::getInstance()->getValue(TRANSPARENCY_KEY).toDouble(); +// if (!m_transparency_gsettings) { +// return 0.7; +// } - QStringList keys = m_transparency_gsettings->keys(); - if (keys.contains("transparency")) { - double tp = m_transparency_gsettings->get("transparency").toDouble(); - return tp; - } else { - return 0.7; - } +// QStringList keys = m_transparency_gsettings->keys(); +// if (keys.contains("transparency")) { +// double tp = m_transparency_gsettings->get("transparency").toDouble(); +// return tp; +// } else { +// return 0.7; +// } } /** diff --git a/src/src.pro b/src/src.pro index fd0bb72..6b0671f 100644 --- a/src/src.pro +++ b/src/src.pro @@ -57,7 +57,7 @@ qm_files.files = $$OUT_PWD/res/translations/*.qm INSTALLS += \ qm_files \ -LIBS += -L$$PWD/../libsearch -lukui-search -L$$PWD/../libchinese-segmentation/ -lchinese-segmentation +LIBS += -L$$OUT_PWD/../libsearch -lukui-search -L$$OUT_PWD/../libchinese-segmentation/ -lchinese-segmentation INCLUDEPATH += $$PWD/../libsearch DEPENDPATH += $$PWD/../libsearch