mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
feat(bar): add context menu for CustomButton right-click
- Show context menu instead of directly opening settings when no command is set - Context menu includes widget-settings option - Matches behavior of other bar widgets
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user