From 698be35791ce941d43b81002c08fbe31173c9b3d Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Fri, 31 Oct 2025 15:17:44 -0400 Subject: [PATCH] BatteryPanel: NBox wrapping --- Modules/Bar/Battery/BatteryPanel.qml | 63 +++++++++++++++------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/Modules/Bar/Battery/BatteryPanel.qml b/Modules/Bar/Battery/BatteryPanel.qml index a6f41829..db0e7693 100644 --- a/Modules/Bar/Battery/BatteryPanel.qml +++ b/Modules/Bar/Battery/BatteryPanel.qml @@ -34,59 +34,62 @@ NPanel { updateOptionsModel() } - panelContent: Rectangle { - color: Color.transparent + panelContent: Item { + anchors.fill: parent ColumnLayout { anchors.fill: parent - anchors.margins: Style.marginL + anchors.margins: Style.marginM spacing: Style.marginM // HEADER - RowLayout { + NBox { Layout.fillWidth: true - spacing: Style.marginM + Layout.preferredHeight: header.implicitHeight + Style.marginM * 2 - NText { - text: I18n.tr("battery.panel.title") - pointSize: Style.fontSizeL - font.weight: Style.fontWeightBold - color: Color.mOnSurface - Layout.fillWidth: true - } + RowLayout { + id: header + anchors.fill: parent + anchors.margins: Style.marginM + spacing: Style.marginM - NToggle { - id: batteryManagerSwitch - checked: BatteryService.chargingMode !== BatteryService.ChargingMode.Disabled - onToggled: checked => BatteryService.toggleEnabled(checked) - baseSize: Style.baseWidgetSize * 0.65 - } + NText { + text: I18n.tr("battery.panel.title") + pointSize: Style.fontSizeL + font.weight: Style.fontWeightBold + color: Color.mOnSurface + Layout.fillWidth: true + } - NIconButton { - icon: "close" - tooltipText: I18n.tr("tooltips.close") - baseSize: Style.baseWidgetSize * 0.8 - onClicked: { - root.close() + NToggle { + id: batteryManagerSwitch + checked: BatteryService.chargingMode !== BatteryService.ChargingMode.Disabled + onToggled: checked => BatteryService.toggleEnabled(checked) + baseSize: Style.baseWidgetSize * 0.65 + } + + NIconButton { + icon: "close" + tooltipText: I18n.tr("tooltips.close") + baseSize: Style.baseWidgetSize * 0.8 + onClicked: { + root.close() + } } } } - NDivider { - Layout.fillWidth: true - } - ButtonGroup { id: batteryGroup } - Rectangle { + NBox { Layout.fillWidth: true Layout.fillHeight: true - color: Color.transparent ColumnLayout { anchors.fill: parent + anchors.margins: Style.marginM spacing: Style.marginM Repeater {