From 8a4042913bdbd1dd825f888d31794a2614b02fc7 Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Tue, 9 Sep 2025 12:27:25 -0400 Subject: [PATCH 1/2] Bootstrap: make the icons map readonly --- Commons/Bootstrap.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Commons/Bootstrap.qml b/Commons/Bootstrap.qml index 8df065c..459172c 100644 --- a/Commons/Bootstrap.qml +++ b/Commons/Bootstrap.qml @@ -41,7 +41,7 @@ Singleton { } } - property var icons: { + readonly property var icons: { "alarm-fill": "\uF101", "alarm": "\uF102", "align-bottom": "\uF103", From 6ed2daa38680c1d6ab52a7013236e439e7f35c7e Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Tue, 9 Sep 2025 12:28:09 -0400 Subject: [PATCH 2/2] NIconButton/CustomButton: added an extra flag to allow click when the button is disabled. Helps with custom button to get redirected to the settings --- Modules/Bar/Widgets/CustomButton.qml | 3 ++- Widgets/NIconButton.qml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Modules/Bar/Widgets/CustomButton.qml b/Modules/Bar/Widgets/CustomButton.qml index ab1868b..8027135 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) + enabled: hasExec + allowClickWhenDisabled: true // we want to be able to open config with left click when its not setup properly colorBorder: Color.transparent colorBorderHover: Color.transparent sizeRatio: 0.8 @@ -59,7 +61,6 @@ NIconButton { return lines.join("
") } } - opacity: hasExec ? Style.opacityFull : Style.opacityMedium onClicked: { if (leftClickExec) { diff --git a/Widgets/NIconButton.qml b/Widgets/NIconButton.qml index 296279e..efbd8e9 100644 --- a/Widgets/NIconButton.qml +++ b/Widgets/NIconButton.qml @@ -14,6 +14,7 @@ Rectangle { property string icon property string tooltipText property bool enabled: true + property bool allowClickWhenDisabled: false property bool hovering: false property color colorBg: Color.mSurfaceVariant @@ -94,7 +95,7 @@ Rectangle { if (tooltipText) { tooltip.hide() } - if (!root.enabled) { + if (!root.enabled && !allowClickWhenDisabled) { return } if (mouse.button === Qt.LeftButton) {