Panels: improvements

- slightly smaller and more homogenous sizing
- better look for battery panel (icons)
This commit is contained in:
ItsLemmy
2025-11-06 23:14:48 -05:00
parent df73582ae8
commit fc3db67def
9 changed files with 52 additions and 25 deletions
+2 -2
View File
@@ -17,8 +17,8 @@ SmartPanel {
property real localInputVolume: AudioService.inputVolume || 0 property real localInputVolume: AudioService.inputVolume || 0
property bool localInputVolumeChanging: false property bool localInputVolumeChanging: false
preferredWidth: 380 * Style.uiScaleRatio preferredWidth: Math.round(340 * Style.uiScaleRatio)
preferredHeight: 420 * Style.uiScaleRatio preferredHeight: Math.round(420 * Style.uiScaleRatio)
// Connections to update local volumes when AudioService changes // Connections to update local volumes when AudioService changes
Connections { Connections {
+28 -8
View File
@@ -59,19 +59,33 @@ SmartPanel {
Component { Component {
id: disabledComponent id: disabledComponent
NText {
text: I18n.tr("battery.panel.disabled") ColumnLayout {
pointSize: Style.fontSizeL anchors.centerIn: parent
color: Color.mOnSurfaceVariant spacing: Style.marginM
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter NIcon {
icon: "recharging"
pointSize: 48
color: Color.mOnSurfaceVariant
Layout.alignment: Qt.AlignHCenter
}
NText {
text: I18n.tr("battery.panel.disabled")
pointSize: Style.fontSizeL
color: Color.mOnSurfaceVariant
wrapMode: Text.WordWrap
Layout.alignment: Qt.AlignHCenter
}
} }
} }
panelContent: Item { panelContent: Item {
anchors.fill: parent anchors.fill: parent
property real contentPreferredHeight: mainLayout.implicitHeight + Style.marginM * 2
property real contentPreferredWidth: 350 * Style.uiScaleRatio property real contentPreferredWidth: Math.round(340 * Style.uiScaleRatio)
property real contentPreferredHeight: Math.round(mainLayout.implicitHeight + Style.marginM * 2)
ColumnLayout { ColumnLayout {
id: mainLayout id: mainLayout
@@ -91,6 +105,12 @@ SmartPanel {
anchors.margins: Style.marginM anchors.margins: Style.marginM
spacing: Style.marginM spacing: Style.marginM
NIcon {
icon: "battery-4"
pointSize: Style.fontSizeXXL
color: Color.mPrimary
}
NText { NText {
text: I18n.tr("battery.panel.title") text: I18n.tr("battery.panel.title")
pointSize: Style.fontSizeL pointSize: Style.fontSizeL
+5 -2
View File
@@ -12,13 +12,16 @@ import qs.Modules.MainScreen
SmartPanel { SmartPanel {
id: root id: root
preferredWidth: 420 * Style.uiScaleRatio preferredWidth: Math.round(340 * Style.uiScaleRatio)
preferredHeight: 500 * Style.uiScaleRatio preferredHeight: 500 * Style.uiScaleRatio
panelContent: Rectangle { panelContent: Rectangle {
color: Color.transparent color: Color.transparent
property real contentPreferredHeight: Math.min(preferredHeight, Math.max(240, mainColumn.implicitHeight + Style.marginL * 2))
ColumnLayout { ColumnLayout {
id: mainColumn
anchors.fill: parent anchors.fill: parent
anchors.margins: Style.marginL anchors.margins: Style.marginL
spacing: Style.marginM spacing: Style.marginM
@@ -92,7 +95,7 @@ SmartPanel {
NIcon { NIcon {
icon: "bluetooth-off" icon: "bluetooth-off"
pointSize: 64 pointSize: 48
color: Color.mOnSurfaceVariant color: Color.mOnSurfaceVariant
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
} }
+3 -3
View File
@@ -14,8 +14,8 @@ SmartPanel {
readonly property var now: Time.now readonly property var now: Time.now
preferredWidth: 500 * Style.uiScaleRatio preferredWidth: Math.round(440 * Style.uiScaleRatio)
preferredHeight: 700 * Style.uiScaleRatio preferredHeight: Math.round(700 * Style.uiScaleRatio)
// Helper function to calculate ISO week number // Helper function to calculate ISO week number
function getISOWeekNumber(date) { function getISOWeekNumber(date) {
@@ -641,7 +641,7 @@ SmartPanel {
sourceComponent: WeatherCard { sourceComponent: WeatherCard {
Layout.fillWidth: true Layout.fillWidth: true
forecastDays: 6 forecastDays: 5
showLocation: false showLocation: false
} }
} }
@@ -9,7 +9,7 @@ import qs.Widgets
NBox { NBox {
id: root id: root
property int forecastDays: 7 property int forecastDays: 6
property bool showLocation: true property bool showLocation: true
readonly property bool weatherReady: Settings.data.location.weatherEnabled && (LocationService.data.weather !== null) readonly property bool weatherReady: Settings.data.location.weatherEnabled && (LocationService.data.weather !== null)
@@ -14,7 +14,7 @@ SmartPanel {
panelAnchorHorizontalCenter: true panelAnchorHorizontalCenter: true
panelAnchorVerticalCenter: true panelAnchorVerticalCenter: true
preferredWidth: Math.round(460 * Style.uiScaleRatio) preferredWidth: Math.round(440 * Style.uiScaleRatio)
preferredHeight: { preferredHeight: {
var height = 0 var height = 0
var count = 0 var count = 0
@@ -13,8 +13,8 @@ import qs.Modules.MainScreen
SmartPanel { SmartPanel {
id: root id: root
preferredWidth: 380 * Style.uiScaleRatio preferredWidth: Math.round(340 * Style.uiScaleRatio)
preferredHeight: 480 * Style.uiScaleRatio preferredHeight: Math.round(420 * Style.uiScaleRatio)
onOpened: function () { onOpened: function () {
NotificationService.updateLastSeenTs() NotificationService.updateLastSeenTs()
@@ -25,6 +25,7 @@ SmartPanel {
color: Color.transparent color: Color.transparent
ColumnLayout { ColumnLayout {
id: mainColumn
anchors.fill: parent anchors.fill: parent
anchors.margins: Style.marginL anchors.margins: Style.marginL
spacing: Style.marginM spacing: Style.marginM
@@ -95,7 +96,7 @@ SmartPanel {
NIcon { NIcon {
icon: "bell-off" icon: "bell-off"
pointSize: 64 pointSize: 48
color: Color.mOnSurfaceVariant color: Color.mOnSurfaceVariant
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
} }
+2 -2
View File
@@ -14,8 +14,8 @@ import qs.Modules.MainScreen
SmartPanel { SmartPanel {
id: root id: root
preferredWidth: 400 * Style.uiScaleRatio preferredWidth: Math.round(400 * Style.uiScaleRatio)
preferredHeight: 340 * Style.uiScaleRatio preferredHeight: Math.round(340 * Style.uiScaleRatio)
panelAnchorHorizontalCenter: true panelAnchorHorizontalCenter: true
panelAnchorVerticalCenter: true panelAnchorVerticalCenter: true
+6 -3
View File
@@ -11,8 +11,8 @@ import qs.Modules.MainScreen
SmartPanel { SmartPanel {
id: root id: root
preferredWidth: 420 * Style.uiScaleRatio preferredWidth: Math.round(340 * Style.uiScaleRatio)
preferredHeight: 500 * Style.uiScaleRatio preferredHeight: Math.round(500 * Style.uiScaleRatio)
property string passwordSsid: "" property string passwordSsid: ""
property string passwordInput: "" property string passwordInput: ""
@@ -23,7 +23,10 @@ SmartPanel {
panelContent: Rectangle { panelContent: Rectangle {
color: Color.transparent color: Color.transparent
property real contentPreferredHeight: Math.min(preferredHeight, Math.max(240, mainColumn.implicitHeight + Style.marginL * 2))
ColumnLayout { ColumnLayout {
id: mainColumn
anchors.fill: parent anchors.fill: parent
anchors.margins: Style.marginL anchors.margins: Style.marginL
spacing: Style.marginM spacing: Style.marginM
@@ -131,7 +134,7 @@ SmartPanel {
NIcon { NIcon {
icon: "wifi-off" icon: "wifi-off"
pointSize: 64 pointSize: 48
color: Color.mOnSurfaceVariant color: Color.mOnSurfaceVariant
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
} }