fix bug 154969 应用代理界面列表显示问题
This commit is contained in:
parent
b072aba07e
commit
b8c67d1249
|
@ -45,7 +45,7 @@
|
||||||
|
|
||||||
#define PROXY_HOST_KEY "host"
|
#define PROXY_HOST_KEY "host"
|
||||||
#define PROXY_PORT_KEY "port"
|
#define PROXY_PORT_KEY "port"
|
||||||
|
#define THEME_SCHAME "org.ukui.style"
|
||||||
#define FRAME_LAYOUT_MARGINS 16,0,16,0
|
#define FRAME_LAYOUT_MARGINS 16,0,16,0
|
||||||
#define FRAME_LAYOUT_SPACING 8
|
#define FRAME_LAYOUT_SPACING 8
|
||||||
#define LABEL_WIDTH 136
|
#define LABEL_WIDTH 136
|
||||||
|
@ -1160,18 +1160,22 @@ void Proxy::setAppListFrameUi(QWidget *widget)
|
||||||
m_allowAppProxyLabel->setText(tr("The following applications are allowed to use this configuration:")); //允许以下应用使用该配置:
|
m_allowAppProxyLabel->setText(tr("The following applications are allowed to use this configuration:")); //允许以下应用使用该配置:
|
||||||
m_appListWidget = new QListWidget(m_appListFrame);
|
m_appListWidget = new QListWidget(m_appListFrame);
|
||||||
m_appListWidget->setMinimumHeight(240);
|
m_appListWidget->setMinimumHeight(240);
|
||||||
m_appListWidget->setBackgroundRole(QPalette::Base);
|
|
||||||
m_appListWidget->setFocusPolicy(Qt::FocusPolicy::NoFocus);
|
m_appListWidget->setFocusPolicy(Qt::FocusPolicy::NoFocus);
|
||||||
m_appListWidget->setFrameShape(QFrame::Shape::Panel);
|
m_appListWidget->setFrameShape(QFrame::Shape::Panel);
|
||||||
|
|
||||||
appListLayout->addWidget(m_allowAppProxyLabel);
|
appListLayout->addWidget(m_allowAppProxyLabel);
|
||||||
appListLayout->addWidget(m_appListWidget);
|
appListLayout->addWidget(m_appListWidget);
|
||||||
|
|
||||||
QPalette mpal(m_appListWidget->palette());
|
onPaletteChanged();
|
||||||
mpal.setColor(QPalette::Base, qApp->palette().base().color());
|
const QByteArray style_id(THEME_SCHAME);
|
||||||
mpal.setColor(QPalette::AlternateBase, qApp->palette().alternateBase().color());
|
if (QGSettings::isSchemaInstalled(style_id)) {
|
||||||
m_appListWidget->setAlternatingRowColors(true);
|
QGSettings * styleGsettings = new QGSettings(style_id, QByteArray(), this);
|
||||||
m_appListWidget->setPalette(mpal);
|
connect(styleGsettings, &QGSettings::changed, this, [=](QString key){
|
||||||
|
if ("styleName" == key) {
|
||||||
|
onPaletteChanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Proxy::appProxyInfoPadding()
|
void Proxy::appProxyInfoPadding()
|
||||||
|
@ -1269,6 +1273,16 @@ void Proxy::onAppProxyConfEditFinished()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Proxy::onPaletteChanged()
|
||||||
|
{
|
||||||
|
QPalette mpal(m_appListWidget->palette());
|
||||||
|
mpal.setColor(QPalette::Base, qApp->palette().base().color());
|
||||||
|
mpal.setColor(QPalette::AlternateBase, qApp->palette().alternateBase().color());
|
||||||
|
m_appListWidget->setBackgroundRole(QPalette::Base);
|
||||||
|
m_appListWidget->setAlternatingRowColors(true);
|
||||||
|
m_appListWidget->setPalette(mpal);
|
||||||
|
}
|
||||||
|
|
||||||
void Proxy::onappProxyEnableChanged(bool enable)
|
void Proxy::onappProxyEnableChanged(bool enable)
|
||||||
{
|
{
|
||||||
m_proxyTypeFrame->setVisible(enable);
|
m_proxyTypeFrame->setVisible(enable);
|
||||||
|
|
|
@ -277,6 +277,7 @@ private slots:
|
||||||
void onipEditStateChanged(); //IP地址无效提示
|
void onipEditStateChanged(); //IP地址无效提示
|
||||||
void onAppProxyConfChanged(); //应用代理配置信息变化
|
void onAppProxyConfChanged(); //应用代理配置信息变化
|
||||||
void onAppProxyConfEditFinished();
|
void onAppProxyConfEditFinished();
|
||||||
|
void onPaletteChanged();
|
||||||
// void onCancelBtnClicked();
|
// void onCancelBtnClicked();
|
||||||
// void onSaveBtnClicked();
|
// void onSaveBtnClicked();
|
||||||
// void setBtnEnable();
|
// void setBtnEnable();
|
||||||
|
|
Loading…
Reference in New Issue