From 0c517f952e47daedbd855e7e40b1787b096d9d99 Mon Sep 17 00:00:00 2001 From: ksn Date: Wed, 22 Sep 2021 16:31:02 +0800 Subject: [PATCH] show None when switch button closed --- src/frontend/tab-pages/lanpage.cpp | 10 +++++----- src/frontend/tab-pages/tabpage.cpp | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index 8a020517..db5329f1 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -81,17 +81,13 @@ void LanPage::onSwithGsettingsChanged(const QString &key) qDebug()<<"[LanPage] open wired device "<< m_devList.at(index); wiredOperation.openWiredNetworkWithDevice(m_devList.at(index)); } - - m_inactivatedLanListWidget->show(); - initDeviceCombox(); } else { for (int index = 0; index < m_devList.size(); ++index) { qDebug()<<"[LanPage] close wired device "<< m_devList.at(index); wiredOperation.closeWiredNetworkWithDevice(m_devList.at(index)); } - m_inactivatedLanListWidget->hide(); - m_deviceFrame->hide(); } + initDeviceCombox(); m_netSwitch->setSwitchStatus(isOn); m_netSwitch->blockSignals(false); } @@ -188,6 +184,10 @@ void LanPage::initDeviceCombox() bool isOn = m_switchGsettings->get(WIRED_SWITCH).toBool(); if (!isOn) { m_deviceFrame->hide(); + m_activatedNetFrame->hide(); + m_inactivatedNetFrame->hide(); + m_activatedNetDivider->hide(); + m_inactivatedNetDivider->hide(); } else { m_device->getNetworkDeviceList(NetworkManager::Device::Type::Ethernet, m_devList); for (int i=0; isetFixedHeight(TITLE_FRAME_HEIGHT); m_settingsLayout = new QHBoxLayout(m_settingsFrame); m_settingsLayout->setContentsMargins(SETTINGS_LAYOUT_MARGINS); m_settingsLabel = new QLabel(m_settingsFrame); @@ -92,6 +93,7 @@ void TabPage::initUI() m_mainLayout->addWidget(m_activatedNetDivider); m_mainLayout->addWidget(m_inactivatedNetFrame); m_mainLayout->addWidget(m_inactivatedNetDivider); + m_mainLayout->addStretch(); m_mainLayout->addWidget(m_settingsFrame); }