Fix#127327 the heightlight effect of ukcc plugin's switchbutton doesn's change while heightlight has changed.

This commit is contained in:
JunjieBai 2022-07-06 14:22:59 +08:00
parent 6a9ee98a84
commit 64bd23b8ea
3 changed files with 6 additions and 4 deletions

View File

@ -6,7 +6,7 @@ target.path = $$[QT_INSTALL_LIBS]/ukui-control-center/
CONFIG += plugin link_pkgconfig c++11 lrelease
PKGCONFIG += gio-2.0 gio-unix-2.0 gsettings-qt
PKGCONFIG += gio-2.0 gio-unix-2.0 gsettings-qt kysdk-qtwidgets
LIBS += -L$$[QT_INSTALL_LIBS] -lgsettings-qt
LIBS += -lukcc

View File

@ -65,7 +65,7 @@ QWidget *Search::pluginUi()
m_webEngineFrame->mCombox->blockSignals(false);
}
});
connect(m_searchMethodBtn, &SwitchButton::checkedChanged, this, [ = ](bool checked) {
connect(m_searchMethodBtn, &kdk::KSwitchButton::stateChanged, this, [ = ](bool checked) {
if (m_gsettings && m_gsettings->keys().contains(SEARCH_METHOD_KEY)) {
m_gsettings->set(SEARCH_METHOD_KEY, checked);
}
@ -147,7 +147,7 @@ void Search::initUi()
m_descLabel2->setEnabled(false);
m_descFrameLyt->addWidget(m_descLabel1);
m_descFrameLyt->addWidget(m_descLabel2);
m_searchMethodBtn = new SwitchButton(m_searchMethodFrame);
m_searchMethodBtn = new kdk::KSwitchButton(m_searchMethodFrame);
m_searchMethodLyt->addWidget(m_descFrame);
m_searchMethodLyt->addStretch();
m_searchMethodLyt->addWidget(m_searchMethodBtn);

View File

@ -13,6 +13,8 @@
#include <QPushButton>
#include <QMessageBox>
#include <kswitchbutton.h>
#include <ukcc/interface/interface.h>
#include <ukcc/widgets/comboboxitem.h>
#include <ukcc/widgets/switchbutton.h>
@ -75,7 +77,7 @@ private:
QFrame *m_searchMethodFrame = nullptr;
QHBoxLayout *m_searchMethodLyt = nullptr;
// QLabel *m_searchMethodLabel = nullptr;
SwitchButton * m_searchMethodBtn = nullptr;
kdk::KSwitchButton *m_searchMethodBtn = nullptr;
//设置搜索引擎
TitleLabel * m_webEngineLabel = nullptr;
ComboxFrame * m_webEngineFrame = nullptr;