fix(网络弹窗): 修改界面内部分割线颜色(bug133746)
This commit is contained in:
parent
c5d757d832
commit
b9c96d1bd5
|
@ -58,7 +58,7 @@ void SinglePage::initUI()
|
|||
m_titleLayout->addWidget(m_titleLabel);
|
||||
m_titleLayout->addStretch();
|
||||
|
||||
m_netDivider = new Divider(this);
|
||||
m_netDivider = new Divider(true, this);
|
||||
|
||||
m_listFrame = new QFrame(this);
|
||||
m_listLayout = new QVBoxLayout(m_listFrame);
|
||||
|
@ -68,7 +68,7 @@ void SinglePage::initUI()
|
|||
m_listLayout->addWidget(m_listWidget);
|
||||
m_listWidget->setProperty("needTranslucent", true);
|
||||
|
||||
m_setDivider = new Divider(this);
|
||||
m_setDivider = new Divider(true, this);
|
||||
|
||||
m_settingsFrame = new QFrame(this);
|
||||
m_settingsFrame->setFixedHeight(TITLE_FRAME_HEIGHT);
|
||||
|
|
|
@ -102,7 +102,7 @@ void VpnDetail::initUI()
|
|||
m_topWidget = new QWidget(this);
|
||||
m_centerWidget = new QWidget(this);
|
||||
m_bottomWidget = new QWidget(this);
|
||||
m_divider = new Divider(this);
|
||||
m_divider = new Divider(false, this);
|
||||
m_vpnTabBar = new VpnTabBar(this);
|
||||
m_autoConnectBox = new QCheckBox(this);
|
||||
m_autoConnectLabel = new QLabel(this);
|
||||
|
|
|
@ -139,7 +139,7 @@ void EnterpriseWlanDialog::initUI()
|
|||
m_enterWlanScrollArea->setWidgetResizable(true);
|
||||
m_enterWlanScrollArea->setBackgroundRole(QPalette::Base);
|
||||
|
||||
m_bottomDivider = new Divider(this);
|
||||
m_bottomDivider = new Divider(false, this);
|
||||
|
||||
QWidget *bottomWidget = new QWidget(this);
|
||||
QHBoxLayout *btnLayout = new QHBoxLayout(bottomWidget);
|
||||
|
|
|
@ -60,7 +60,7 @@ void DnsSettingWidget::initUi()
|
|||
}
|
||||
m_retryComboBox->setCurrentIndex(m_retryComboBox->findData(m_retry.toInt()));
|
||||
|
||||
m_bottomDivider = new Divider(true, this);
|
||||
m_bottomDivider = new Divider(false, this);
|
||||
|
||||
m_closeBtn = new QPushButton(this);
|
||||
m_closeBtn->setFixedSize(32,32);
|
||||
|
|
|
@ -96,7 +96,7 @@ void Ipv4Page::initUI() {
|
|||
// IP的正则格式限制
|
||||
QRegExp rx("\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b");
|
||||
|
||||
Divider* divider = new Divider(true, this);
|
||||
Divider* divider = new Divider(false, this);
|
||||
m_dnsWidget = new MultipleDnsWidget(rx, true, this);
|
||||
|
||||
m_detailLayout = new QFormLayout(this);
|
||||
|
|
|
@ -77,7 +77,7 @@ void JoinHiddenWiFiPage::initUI()
|
|||
m_nameLabel->setFixedWidth(LABEL_MIN_WIDTH);
|
||||
m_nameEdit =new LineEdit(this);
|
||||
|
||||
m_bottomDivider = new Divider(this);
|
||||
m_bottomDivider = new Divider(false, this);
|
||||
m_showListBtn = new KBorderlessButton(this);
|
||||
m_cancelBtn =new QPushButton(this);
|
||||
m_joinBtn =new QPushButton(this);
|
||||
|
|
|
@ -400,7 +400,7 @@ void NetDetail::initUI()
|
|||
centerlayout->setContentsMargins(CENTER_LAYOUT_MARGINS); // 右边距为0,为安全页滚动区域留出空间
|
||||
centerlayout->addWidget(stackWidget);
|
||||
|
||||
Divider *divider = new Divider(true, this);
|
||||
Divider *divider = new Divider(false, this);
|
||||
|
||||
QHBoxLayout *bottomLayout = new QHBoxLayout(bottomWidget);
|
||||
bottomLayout->setContentsMargins(BOTTOM_LAYOUT_MARGINS);
|
||||
|
|
|
@ -60,7 +60,7 @@ void TabPage::initUI()
|
|||
m_titleLayout->addWidget(m_titleLabel);
|
||||
m_titleLayout->addStretch();
|
||||
m_titleLayout->addWidget(m_netSwitch);
|
||||
m_titleDivider = new Divider(this);
|
||||
m_titleDivider = new Divider(true, this);
|
||||
|
||||
//临时增加的下拉框选择网卡区域
|
||||
m_deviceFrame = new QFrame(this);
|
||||
|
@ -92,7 +92,7 @@ void TabPage::initUI()
|
|||
m_activatedNetLabel->setContentsMargins(TEXT_MARGINS);
|
||||
m_activatedNetLabel->setFixedHeight(TEXT_HEIGHT);
|
||||
m_activatedNetLayout->addWidget(m_activatedNetLabel);
|
||||
m_activatedNetDivider = new Divider(this);
|
||||
m_activatedNetDivider = new Divider(true, this);
|
||||
|
||||
m_inactivatedNetFrame = new QFrame(this);
|
||||
m_inactivatedNetFrame->setMinimumHeight(INACTIVE_AREA_MIN_HEIGHT);
|
||||
|
@ -120,7 +120,7 @@ void TabPage::initUI()
|
|||
m_inactivatedNetLayout->addWidget(m_inactivatedNetLabel);
|
||||
m_inactivatedNetLayout->addWidget(m_inactivatedNetListArea);
|
||||
|
||||
m_inactivatedNetDivider = new Divider(this);
|
||||
m_inactivatedNetDivider = new Divider(true, this);
|
||||
m_settingsFrame = new QFrame(this);
|
||||
m_settingsFrame->setFixedHeight(TITLE_FRAME_HEIGHT);
|
||||
|
||||
|
|
|
@ -27,34 +27,28 @@
|
|||
#define THEME_SCHAME "org.ukui.style"
|
||||
#define COLOR_THEME "styleName"
|
||||
|
||||
Divider::Divider(bool useLightPal, QWidget * parent)
|
||||
:m_useLightPal(useLightPal),
|
||||
Divider::Divider(bool useDarkPal, QWidget * parent)
|
||||
:m_useDarkPal(useDarkPal),
|
||||
QFrame(parent)
|
||||
{
|
||||
this->setFixedHeight(1);
|
||||
initPalette();
|
||||
connect(qApp, &QApplication::paletteChanged, this ,&Divider::onPaletteChanged);
|
||||
onPaletteChanged();
|
||||
}
|
||||
|
||||
void Divider::initPalette()
|
||||
void Divider::onPaletteChanged()
|
||||
{
|
||||
QPalette pal = qApp->palette();
|
||||
QGSettings * styleGsettings = nullptr;
|
||||
const QByteArray styleId(THEME_SCHAME);
|
||||
if (QGSettings::isSchemaInstalled(styleId)) {
|
||||
if (QGSettings::isSchemaInstalled(styleId) && m_useDarkPal) {
|
||||
styleGsettings = new QGSettings(styleId, QByteArray(), this);
|
||||
QString currentTheme = styleGsettings->get(COLOR_THEME).toString();
|
||||
if(currentTheme == "ukui-default"){
|
||||
pal = themePalette(true, this);
|
||||
}
|
||||
}
|
||||
this->setPalette(pal);
|
||||
}
|
||||
|
||||
void Divider::onPaletteChanged()
|
||||
{
|
||||
QPalette pal = this->palette();
|
||||
m_color = pal.color(QPalette::BrightText);
|
||||
m_color.setAlphaF(0.08);
|
||||
}
|
||||
|
|
|
@ -24,12 +24,11 @@
|
|||
class Divider : public QFrame
|
||||
{
|
||||
public:
|
||||
Divider(bool useLightPal = false, QWidget * parent = nullptr);
|
||||
Divider(bool useDarkPal = false, QWidget * parent = nullptr);
|
||||
~Divider() = default;
|
||||
private:
|
||||
bool m_useLightPal;
|
||||
bool m_useDarkPal;
|
||||
QColor m_color;
|
||||
void initPalette();
|
||||
private Q_SLOTS:
|
||||
void onPaletteChanged();
|
||||
protected:
|
||||
|
|
Loading…
Reference in New Issue