From cfd7dec04dce855910fe39a638d24974da6c00b7 Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Tue, 9 Sep 2025 09:13:27 -0400 Subject: [PATCH 1/4] WeatherCard: Vertical centering of icons --- Modules/SidePanel/Cards/WeatherCard.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/SidePanel/Cards/WeatherCard.qml b/Modules/SidePanel/Cards/WeatherCard.qml index baa04c8..63c7b47 100644 --- a/Modules/SidePanel/Cards/WeatherCard.qml +++ b/Modules/SidePanel/Cards/WeatherCard.qml @@ -27,6 +27,7 @@ NBox { RowLayout { spacing: Style.marginS * scaling NIcon { + Layout.alignment: Qt.AlignVCenter icon: weatherReady ? LocationService.weatherSymbolFromCode( LocationService.data.weather.current_weather.weathercode) : "" font.pointSize: Style.fontSizeXXXL * 1.75 * scaling @@ -98,6 +99,7 @@ NBox { color: Color.mOnSurface } NIcon { + Layout.alignment: Qt.AlignVCenter icon: LocationService.weatherSymbolFromCode(LocationService.data.weather.daily.weathercode[index]) font.pointSize: Style.fontSizeXXL * scaling color: Color.mPrimary @@ -128,4 +130,4 @@ NBox { NBusyIndicator {} } } -} +} \ No newline at end of file From fe139c208a98d90550779cc2f19071a04dca14d7 Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Tue, 9 Sep 2025 09:16:48 -0400 Subject: [PATCH 2/4] CustomIcomButton: changed default icon to "heart" --- Services/BarWidgetRegistry.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Services/BarWidgetRegistry.qml b/Services/BarWidgetRegistry.qml index fc99a0e..6005842 100644 --- a/Services/BarWidgetRegistry.qml +++ b/Services/BarWidgetRegistry.qml @@ -60,7 +60,7 @@ Singleton { }, "CustomButton": { "allowUserSettings": true, - "icon": "favorite", + "icon": "heart", "leftClickExec": "", "rightClickExec": "", "middleClickExec": "" From a6ccc8b0da91fc22b8928f57dad9a47fc54f1076 Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Tue, 9 Sep 2025 09:22:05 -0400 Subject: [PATCH 3/4] NButton: fix issue when no icon defined --- Modules/SidePanel/Cards/WeatherCard.qml | 2 +- Widgets/NButton.qml | 36 ++++++++++++------------- Widgets/NIcon.qml | 6 ++++- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Modules/SidePanel/Cards/WeatherCard.qml b/Modules/SidePanel/Cards/WeatherCard.qml index 63c7b47..d0b55cb 100644 --- a/Modules/SidePanel/Cards/WeatherCard.qml +++ b/Modules/SidePanel/Cards/WeatherCard.qml @@ -130,4 +130,4 @@ NBox { NBusyIndicator {} } } -} \ No newline at end of file +} diff --git a/Widgets/NButton.qml b/Widgets/NButton.qml index 1bf82b0..000eb43 100644 --- a/Widgets/NButton.qml +++ b/Widgets/NButton.qml @@ -80,29 +80,27 @@ Rectangle { spacing: Style.marginXS * scaling // Icon (optional) - Loader { - active: root.icon !== "" - sourceComponent: NIcon { - Layout.alignment: Qt.AlignVCenter + NIcon { + Layout.alignment: Qt.AlignVCenter + visible: root.icon !== "" - icon: root.icon - font.pointSize: root.iconSize - color: { - if (!root.enabled) - return Color.mOnSurfaceVariant - if (root.outlined) { - if (root.pressed || root.hovered) - return root.backgroundColor + icon: root.icon + font.pointSize: root.iconSize + color: { + if (!root.enabled) + return Color.mOnSurfaceVariant + if (root.outlined) { + if (root.pressed || root.hovered) return root.backgroundColor - } - return root.textColor + return root.backgroundColor } + return root.textColor + } - Behavior on color { - ColorAnimation { - duration: Style.animationFast - easing.type: Easing.OutCubic - } + Behavior on color { + ColorAnimation { + duration: Style.animationFast + easing.type: Easing.OutCubic } } } diff --git a/Widgets/NIcon.qml b/Widgets/NIcon.qml index fedbaa0..d253730 100644 --- a/Widgets/NIcon.qml +++ b/Widgets/NIcon.qml @@ -7,8 +7,12 @@ Text { readonly property string defaultIcon: "balloon" property string icon: defaultIcon + visible: (icon !== undefined) && (icon !== "") text: { - if (icon === undefined || Bootstrap.icons[icon] === undefined) { + if ((icon === undefined) || (icon === "")) { + return "" + } + if (Bootstrap.icons[icon] === undefined) { Logger.warn("Icon", `"${icon}"`, "doesn't exist in the bootstrap font") Logger.callStack() return Bootstrap.icons[defaultIcon] From 5f1cfb907296d0e1a1885c16ede3ce663cd7c4c8 Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Tue, 9 Sep 2025 09:27:46 -0400 Subject: [PATCH 4/4] CustomButton: no border --- Modules/Bar/Widgets/CustomButton.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/Bar/Widgets/CustomButton.qml b/Modules/Bar/Widgets/CustomButton.qml index 08d3dc8..ab1868b 100644 --- a/Modules/Bar/Widgets/CustomButton.qml +++ b/Modules/Bar/Widgets/CustomButton.qml @@ -38,6 +38,8 @@ NIconButton { readonly property string middleClickExec: widgetSettings.middleClickExec || widgetMetadata.middleClickExec readonly property bool hasExec: (leftClickExec || rightClickExec || middleClickExec) + colorBorder: Color.transparent + colorBorderHover: Color.transparent sizeRatio: 0.8 icon: customIcon tooltipText: {