修改详情页IPv4 DNS列表 tab适配高分屏

This commit is contained in:
zhangyuanyuan1 2023-04-10 17:52:34 +08:00
parent 0399e290a2
commit 94c345dda8
3 changed files with 35 additions and 3 deletions

View File

@ -87,7 +87,7 @@ void DetailPage::setIpv4(const QString &ipv4) {
} }
void DetailPage::setIpv4Dns(const QString &ipv4Dns) { void DetailPage::setIpv4Dns(const QString &ipv4Dns) {
this->m_IPV4Dns->setText(ipv4Dns); this->m_IPV4Dns->setLabelText(ipv4Dns);
} }
void DetailPage::setIpv6(const QString &ipv6) { void DetailPage::setIpv6(const QString &ipv6) {

View File

@ -660,7 +660,7 @@ void NetDetail::getStaticIpInfo(ConInfo &conInfo, bool bActived)
// conInfo.ipv4ConfigType = connetSetting.m_ipv4ConfigIpType; // conInfo.ipv4ConfigType = connetSetting.m_ipv4ConfigIpType;
conInfo.ipv6ConfigType = connetSetting.m_ipv6ConfigIpType; conInfo.ipv6ConfigType = connetSetting.m_ipv6ConfigIpType;
conInfo.ipv4DnsList = connetSetting.m_ipv4Dns; // conInfo.ipv4DnsList = connetSetting.m_ipv4Dns;
conInfo.ipv6DnsList = connetSetting.m_ipv6Dns; conInfo.ipv6DnsList = connetSetting.m_ipv6Dns;
conInfo.isAutoConnect = connetSetting.m_isAutoConnect; conInfo.isAutoConnect = connetSetting.m_isAutoConnect;
@ -1196,7 +1196,26 @@ void NetDetail::setNetTabToolTip()
NetTabBar::NetTabBar(QWidget *parent) NetTabBar::NetTabBar(QWidget *parent)
:KTabBar(KTabBarStyle::SegmentDark, parent) :KTabBar(KTabBarStyle::SegmentDark, parent)
{ {
//模式切换
QDBusConnection::sessionBus().connect(QString("com.kylin.statusmanager.interface"),
QString("/"),
QString("com.kylin.statusmanager.interface"),
QString("mode_change_signal"), this, SLOT(onModeChanged(bool)));
//模式获取
QDBusInterface interface(QString("com.kylin.statusmanager.interface"),
QString("/"),
QString("com.kylin.statusmanager.interface"),
QDBusConnection::sessionBus());
if(!interface.isValid()) {
this->setFixedHeight(TAB_HEIGHT);
return;
}
QDBusReply<bool> reply = interface.call("get_current_tabletmode");
if (!reply.isValid()) {
this->setFixedHeight(TAB_HEIGHT);
return;
}
onModeChanged(reply.value());
} }
NetTabBar::~NetTabBar() NetTabBar::~NetTabBar()
@ -1219,6 +1238,15 @@ QSize NetTabBar::minimumTabSizeHint(int index) const
return size; return size;
} }
void NetTabBar::onModeChanged(bool mode)
{
if (mode) {
this->setFixedHeight(TAB_HEIGHT_TABLET); // 平板模式
} else {
this->setFixedHeight(TAB_HEIGHT); // PC模式
}
}
ThreadObject::ThreadObject(QString deviceName, QObject *parent) ThreadObject::ThreadObject(QString deviceName, QObject *parent)
:m_devName(deviceName), QObject(parent) :m_devName(deviceName), QObject(parent)

View File

@ -68,6 +68,10 @@ public:
protected: protected:
QSize sizeHint() const; QSize sizeHint() const;
QSize minimumTabSizeHint(int index) const; QSize minimumTabSizeHint(int index) const;
private Q_SLOTS:
void onModeChanged(bool mode);
}; };
class ThreadObject : public QObject class ThreadObject : public QObject
{ {