diff --git a/src/frontend/netdetails/coninfo.h b/src/frontend/netdetails/coninfo.h index 872b31af..1d384347 100644 --- a/src/frontend/netdetails/coninfo.h +++ b/src/frontend/netdetails/coninfo.h @@ -2,6 +2,9 @@ #define CONINFO_H #include +#include +#include +#include #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 lineEditList = widget->findChildren(); + for (int i = 0; i < lineEditList.count(); ++i) { + lineEditList.at(i)->setPalette(pal); + } + QList comboBoxList = widget->findChildren(); + for (int i = 0; i < comboBoxList.count(); ++i) { + comboBoxList.at(i)->setPalette(pal); + comboBoxList.at(i)->view()->setPalette(pal); + } +} + #endif // CONINFO_H diff --git a/src/frontend/netdetails/netdetail.cpp b/src/frontend/netdetails/netdetail.cpp index d0e7479d..9ce9d53c 100644 --- a/src/frontend/netdetails/netdetail.cpp +++ b/src/frontend/netdetails/netdetail.cpp @@ -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());