From c0d50b87c0b718212038296b3621ee2a293fdb25 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Fri, 31 Oct 2025 15:07:06 -0400 Subject: [PATCH] Wifit: NBox wrapping --- Modules/Bar/WiFi/WiFiPanel.qml | 85 ++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/Modules/Bar/WiFi/WiFiPanel.qml b/Modules/Bar/WiFi/WiFiPanel.qml index 90e40b43..281ace59 100644 --- a/Modules/Bar/WiFi/WiFiPanel.qml +++ b/Modules/Bar/WiFi/WiFiPanel.qml @@ -10,7 +10,7 @@ import qs.Widgets NPanel { id: root - preferredWidth: 400 * Style.uiScaleRatio + preferredWidth: 420 * Style.uiScaleRatio preferredHeight: 500 * Style.uiScaleRatio panelKeyboardFocus: true @@ -29,51 +29,53 @@ NPanel { spacing: Style.marginM // Header - RowLayout { + NBox { Layout.fillWidth: true - spacing: Style.marginM + Layout.preferredHeight: headerRow.implicitHeight + Style.marginM * 2 - NIcon { - icon: Settings.data.network.wifiEnabled ? "wifi" : "wifi-off" - pointSize: Style.fontSizeXXL - color: Settings.data.network.wifiEnabled ? Color.mPrimary : Color.mOnSurfaceVariant - } + RowLayout { + id: headerRow + anchors.fill: parent + anchors.margins: Style.marginM + spacing: Style.marginM - NText { - text: I18n.tr("wifi.panel.title") - pointSize: Style.fontSizeL - font.weight: Style.fontWeightBold - color: Color.mOnSurface - Layout.fillWidth: true - } + NIcon { + icon: Settings.data.network.wifiEnabled ? "wifi" : "wifi-off" + pointSize: Style.fontSizeXXL + color: Settings.data.network.wifiEnabled ? Color.mPrimary : Color.mOnSurfaceVariant + } - NToggle { - id: wifiSwitch - checked: Settings.data.network.wifiEnabled - onToggled: checked => NetworkService.setWifiEnabled(checked) - baseSize: Style.baseWidgetSize * 0.65 - } + NText { + text: I18n.tr("wifi.panel.title") + pointSize: Style.fontSizeL + font.weight: Style.fontWeightBold + color: Color.mOnSurface + Layout.fillWidth: true + } - NIconButton { - icon: "refresh" - tooltipText: I18n.tr("tooltips.refresh") - baseSize: Style.baseWidgetSize * 0.8 - enabled: Settings.data.network.wifiEnabled && !NetworkService.scanning - onClicked: NetworkService.scan() - } + NToggle { + id: wifiSwitch + checked: Settings.data.network.wifiEnabled + onToggled: checked => NetworkService.setWifiEnabled(checked) + baseSize: Style.baseWidgetSize * 0.65 + } - NIconButton { - icon: "close" - tooltipText: I18n.tr("tooltips.close") - baseSize: Style.baseWidgetSize * 0.8 - onClicked: root.close() + NIconButton { + icon: "refresh" + tooltipText: I18n.tr("tooltips.refresh") + baseSize: Style.baseWidgetSize * 0.8 + enabled: Settings.data.network.wifiEnabled && !NetworkService.scanning + onClicked: NetworkService.scan() + } + + NIconButton { + icon: "close" + tooltipText: I18n.tr("tooltips.close") + baseSize: Style.baseWidgetSize * 0.8 + onClicked: root.close() + } } } - - NDivider { - Layout.fillWidth: true - } - // Error message Rectangle { visible: NetworkService.lastError.length > 0 @@ -113,16 +115,15 @@ NPanel { } // Main content area - Rectangle { + NBox { Layout.fillWidth: true Layout.fillHeight: true - color: Color.transparent // WiFi disabled state ColumnLayout { visible: !Settings.data.network.wifiEnabled anchors.fill: parent - spacing: Style.marginM + anchors.margins: Style.marginM Item { Layout.fillHeight: true @@ -158,6 +159,7 @@ NPanel { ColumnLayout { visible: Settings.data.network.wifiEnabled && NetworkService.scanning && Object.keys(NetworkService.networks).length === 0 anchors.fill: parent + anchors.margins: Style.marginM spacing: Style.marginL Item { @@ -187,6 +189,7 @@ NPanel { NScrollView { visible: Settings.data.network.wifiEnabled && (!NetworkService.scanning || Object.keys(NetworkService.networks).length > 0) anchors.fill: parent + anchors.margins: Style.marginM horizontalPolicy: ScrollBar.AlwaysOff verticalPolicy: ScrollBar.AsNeeded clip: true