diff --git a/Modules/Bar/Widgets/CustomButton.qml b/Modules/Bar/Widgets/CustomButton.qml index 3c538290e..f7c772985 100644 --- a/Modules/Bar/Widgets/CustomButton.qml +++ b/Modules/Bar/Widgets/CustomButton.qml @@ -12,6 +12,27 @@ import qs.Widgets Item { id: root + NPopupContextMenu { + id: contextMenu + + model: [ + { + "label": I18n.tr("actions.widget-settings"), + "action": "widget-settings", + "icon": "settings" + }, + ] + + onTriggered: action => { + contextMenu.close(); + PanelService.closeContextMenu(screen); + + if (action === "widget-settings") { + BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings); + } + } + } + property ShellScreen screen // Widget properties passed from Bar.qml for per-instance settings @@ -425,21 +446,23 @@ Item { const text = parsed.text || ""; const icon = parsed.icon || ""; let tooltip = parsed.tooltip || ""; - + // Support both "color" (legacy) and "iconColor"/"textColor" (new) const legacyColor = parsed.color || ""; const iconColorKey = parsed.iconColor || ""; const textColorKey = parsed.textColor || ""; - + const validColors = ["primary", "secondary", "tertiary", "error", "none"]; - + // Helper to resolve color: legacy > specific > none function resolveColor(legacy, specific) { - if (legacy && validColors.includes(legacy)) return legacy; - if (specific && validColors.includes(specific)) return specific; + if (legacy && validColors.includes(legacy)) + return legacy; + if (specific && validColors.includes(specific)) + return specific; return ""; } - + const resolvedIconColor = resolveColor(legacyColor, iconColorKey); const resolvedTextColor = resolveColor(legacyColor, textColorKey); @@ -553,8 +576,8 @@ Item { if (rightClickExec) { Quickshell.execDetached(["sh", "-lc", rightClickExec]); Logger.i("CustomButton", `Executing command: ${rightClickExec}`); - } else if (!rightClickUpdateText) { - BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings); + } else { + PanelService.showContextMenu(contextMenu, pill, screen); } if (!textStream && rightClickUpdateText) { runTextCommand(); diff --git a/Modules/Panels/Media/MediaPlayerPanel.qml b/Modules/Panels/Media/MediaPlayerPanel.qml index 99275a6b5..721ba7b5f 100644 --- a/Modules/Panels/Media/MediaPlayerPanel.qml +++ b/Modules/Panels/Media/MediaPlayerPanel.qml @@ -74,7 +74,7 @@ SmartPanel { id: playerContent anchors.fill: parent - property real contentPreferredHeight: mainLayout.implicitHeight + Style.margin2L; + property real contentPreferredHeight: mainLayout.implicitHeight + Style.margin2L property Component visualizerSource: { switch (root.visualizerType) { diff --git a/Modules/Panels/Settings/Bar/WidgetSettings/CustomButtonSettings.qml b/Modules/Panels/Settings/Bar/WidgetSettings/CustomButtonSettings.qml index c629c0204..b058e80bf 100644 --- a/Modules/Panels/Settings/Bar/WidgetSettings/CustomButtonSettings.qml +++ b/Modules/Panels/Settings/Bar/WidgetSettings/CustomButtonSettings.qml @@ -122,29 +122,29 @@ ColumnLayout { label: I18n.tr("bar.custom-button.icon-position-label") description: I18n.tr("bar.custom-button.icon-position-description") model: barIsVertical ? [ - { - name: I18n.tr("bar.custom-button.icon-position-top"), - key: "left" - }, - { - name: I18n.tr("bar.custom-button.icon-position-bottom"), - key: "right" - } - ] : [ - { - name: I18n.tr("bar.custom-button.icon-position-left"), - key: "left" - }, - { - name: I18n.tr("bar.custom-button.icon-position-right"), - key: "right" - } - ] + { + name: I18n.tr("bar.custom-button.icon-position-top"), + key: "left" + }, + { + name: I18n.tr("bar.custom-button.icon-position-bottom"), + key: "right" + } + ] : [ + { + name: I18n.tr("bar.custom-button.icon-position-left"), + key: "left" + }, + { + name: I18n.tr("bar.custom-button.icon-position-right"), + key: "right" + } + ] currentKey: valueIconPosition onSelected: key => { - valueIconPosition = key; - saveSettings(); - } + valueIconPosition = key; + saveSettings(); + } defaultValue: widgetMetadata.iconPosition } diff --git a/Services/UI/BarWidgetRegistry.qml b/Services/UI/BarWidgetRegistry.qml index 47fed7f00..815c82022 100644 --- a/Services/UI/BarWidgetRegistry.qml +++ b/Services/UI/BarWidgetRegistry.qml @@ -126,7 +126,7 @@ Singleton { "customIconPath": "", "colorizeDistroLogo": false, "colorizeSystemIcon": "none", - "colorizeSystemText": "none", + "colorizeSystemText": "none", "enableColorization": false }, "CustomButton": { @@ -190,7 +190,7 @@ Singleton { "icon": "rocket", "customIconPath": "", "colorizeSystemIcon": "none", - "colorizeSystemText": "none", + "colorizeSystemText": "none", "enableColorization": false, "iconColor": "none" },