详情页UI

This commit is contained in:
Jinxujie 2021-12-03 10:31:33 +08:00
parent bceddecb20
commit 0faf6a57cb
2 changed files with 22 additions and 0 deletions

View File

@ -2,6 +2,9 @@
#define CONINFO_H
#include <QString>
#include <QPalette>
#include <QComboBox>
#include <QAbstractItemView>
#include "kywirelessnetitem.h"
#include "kylinconnectresource.h"
#include "kylinactiveconnectresource.h"
@ -72,4 +75,17 @@ static void setLineEditMenuPolicy(QFrame *widget) {
lineEditList.at(i)->setContextMenuPolicy(Qt::NoContextMenu);
}
}
static void setFramePalette(QFrame *widget, QPalette &pal) {
QList<QLineEdit *> lineEditList = widget->findChildren<QLineEdit *>();
for (int i = 0; i < lineEditList.count(); ++i) {
lineEditList.at(i)->setPalette(pal);
}
QList<QComboBox *> comboBoxList = widget->findChildren<QComboBox *>();
for (int i = 0; i < comboBoxList.count(); ++i) {
comboBoxList.at(i)->setPalette(pal);
comboBoxList.at(i)->view()->setPalette(pal);
}
}
#endif // CONINFO_H

View File

@ -120,6 +120,12 @@ void NetDetail::onPaletteChanged()
this->setPalette(pal);
setFramePalette(detailPage, pal);
setFramePalette(ipv4Page, pal);
setFramePalette(ipv6Page, pal);
setFramePalette(securityPage, pal);
setFramePalette(createNetPage, pal);
QPalette listwidget_pal(detailPage->m_listWidget->palette());
listwidget_pal.setColor(QPalette::Base, this->palette().base().color());
listwidget_pal.setColor(QPalette::AlternateBase, this->palette().alternateBase().color());