diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index c78abc352..33cba6724 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -124,6 +124,8 @@ "icon-position-label": "Icon position", "icon-position-left": "Left", "icon-position-right": "Right", + "icon-position-top": "Top", + "icon-position-bottom": "Bottom", "ipc-identifier-description": "Unique identifier for IPC commands. Use this identifier with 'qs -c noctalia-shell ipc call cb [action] [identifier]' to control this button via IPC.", "ipc-identifier-label": "IPC Identifier", "left-click-description": "Command to execute when the button is left-clicked.", diff --git a/Modules/Bar/Extras/BarPillVertical.qml b/Modules/Bar/Extras/BarPillVertical.qml index 423ac7442..e41ef6ad1 100644 --- a/Modules/Bar/Extras/BarPillVertical.qml +++ b/Modules/Bar/Extras/BarPillVertical.qml @@ -50,8 +50,9 @@ Item { readonly property int maxPillHeight: rotateText ? Math.max(1, Math.round(textItem.implicitWidth + Style.margin2M + Math.round(iconCircle.height / 4))) : Math.max(1, Math.round(textItem.implicitHeight + Style.margin2M)) // Determine pill direction based on icon position (fallback to oppositeDirection if not set) - readonly property bool openDownward: iconPosition === "right" || (iconPosition === "" && oppositeDirection) - readonly property bool openUpward: iconPosition === "left" || (iconPosition === "" && !oppositeDirection) + // For vertical bar: iconPosition="left" (top) means icon at top, text expands downward + readonly property bool openDownward: (iconPosition === "left" || iconPosition === "right") ? (iconPosition === "left") : oppositeDirection + readonly property bool openUpward: (iconPosition === "left" || iconPosition === "right") ? (iconPosition === "right") : !oppositeDirection // Effective shown state (true if animated open or forced, but not if force closed) readonly property bool revealed: !forceClose && (forceOpen || showPill) diff --git a/Modules/Panels/Settings/Bar/BarWidgetSettingsDialog.qml b/Modules/Panels/Settings/Bar/BarWidgetSettingsDialog.qml index c21835607..fc08c19ee 100644 --- a/Modules/Panels/Settings/Bar/BarWidgetSettingsDialog.qml +++ b/Modules/Panels/Settings/Bar/BarWidgetSettingsDialog.qml @@ -15,6 +15,7 @@ Popup { property string widgetId: "" property string sectionId: "" property var screen: null + property bool barIsVertical: false property var settingsCache: ({}) readonly property real maxHeight: (screen ? screen.height : (parent ? parent.height : 800)) * 0.8 @@ -185,6 +186,7 @@ Popup { } settingsLoader.setSource(source, { "screen": screen, + "barIsVertical": barIsVertical, "widgetData": currentWidgetData, "widgetMetadata": BarWidgetRegistry.widgetMetadata[widgetId] }); diff --git a/Modules/Panels/Settings/Bar/WidgetSettings/CustomButtonSettings.qml b/Modules/Panels/Settings/Bar/WidgetSettings/CustomButtonSettings.qml index 3ac6d67f2..3bb8920c7 100644 --- a/Modules/Panels/Settings/Bar/WidgetSettings/CustomButtonSettings.qml +++ b/Modules/Panels/Settings/Bar/WidgetSettings/CustomButtonSettings.qml @@ -17,6 +17,9 @@ ColumnLayout { signal settingsChanged(var settings) + // Bar orientation (per-screen) - passed from parent + property bool barIsVertical: false + property string valueIcon: widgetData.icon !== undefined ? widgetData.icon : widgetMetadata.icon property string valueIconPosition: widgetData.iconPosition !== undefined ? widgetData.iconPosition : widgetMetadata.iconPosition property bool valueTextStream: widgetData.textStream !== undefined ? widgetData.textStream : widgetMetadata.textStream @@ -101,9 +104,19 @@ ColumnLayout { NComboBox { id: iconPositionComboBox + visible: valueShowIcon label: I18n.tr("bar.custom-button.icon-position-label") description: I18n.tr("bar.custom-button.icon-position-description") - model: [ + 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" diff --git a/Widgets/NSectionEditor.qml b/Widgets/NSectionEditor.qml index f2045460d..4fa085be6 100644 --- a/Widgets/NSectionEditor.qml +++ b/Widgets/NSectionEditor.qml @@ -267,7 +267,8 @@ NBox { "widgetData": widgetData, "widgetId": widgetData.id, "sectionId": root.sectionId, - "screen": root.screen + "screen": root.screen, + "barIsVertical": root.barIsVertical }); if (dialog) {