解决控制面板应用代理按钮关闭时的显示异常问题

This commit is contained in:
zhangyuanyuan1 2023-06-26 11:17:02 +08:00
parent 62ad1cc517
commit 1290e7cc91
2 changed files with 11 additions and 10 deletions

View File

@ -727,13 +727,10 @@ void Proxy::initDbus()
void Proxy::initAppProxyStatus()
{
bool state = getAppProxyState();
appProxyInfoPadding();
appListPadding();
m_appEnableBtn->setChecked(state);
onappProxyEnableChanged(state);
if (state) {
appProxyInfoPadding();
appListPadding();
}
setAppProxyUiEnable(state);
}
int Proxy::_getCurrentProxyMode(){
@ -1206,7 +1203,7 @@ void Proxy::setAppProxyFrameUi(QWidget *widget)
// appProxyLayout->addWidget(line5);
// appProxyLayout->addWidget(m_appBtnFrame);
connect(m_appEnableBtn, &KSwitchButton::stateChanged, this, &Proxy::onappProxyEnableChanged);
connect(m_appEnableBtn, &KSwitchButton::stateChanged, this, &Proxy::setAppProxyUiEnable);
connect(m_appEnableBtn, &KSwitchButton::stateChanged, this, &Proxy::setAppProxyState);
connect(m_proxyTypeComboBox, SIGNAL(currentTextChanged(QString)), this, SLOT(onAppProxyConfChanged()));
connect(m_ipAddressLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onipEditStateChanged()));
@ -1321,7 +1318,11 @@ void Proxy::setAppProxyFrameHidden(bool state)
{
m_appProxyLabel->setHidden(state);
m_appProxyFrame->setHidden(state);
m_appListFrame->setHidden(state);
if (state) {
m_appListFrame->setHidden(state);
} else {
m_appListFrame->setHidden(!m_appEnableBtn->isChecked());
}
m_appListSpacerFrame->setHidden(state);
m_appSpacerFrame->setHidden(state);
}
@ -1383,7 +1384,7 @@ void Proxy::onPaletteChanged()
m_appListWidget->setPalette(mpal);
}
void Proxy::onappProxyEnableChanged(bool enable)
void Proxy::setAppProxyUiEnable(bool enable)
{
if (enable) {
m_appProxyInfoWidget->show();

View File

@ -283,7 +283,7 @@ private:
private slots:
void setAptProxySlot(); //处理apt代理前端交互逻辑
void onappProxyEnableChanged(bool enable); //IP地址无效提示
void setAppProxyUiEnable(bool enable);
void onipEditStateChanged(); //IP地址无效提示
void onAppProxyConfChanged(); //应用代理配置信息变化
void onAppProxyConfEditFinished();