BarWidgets: open widget settings

This commit is contained in:
ItsLemmy
2025-11-17 21:03:59 -05:00
parent 3283aacf9b
commit 81c0c302d4
3 changed files with 88 additions and 20 deletions
+17 -18
View File
@@ -77,36 +77,35 @@ Item {
model: [
{
"label": I18n.tr("context-menu.toggle-mute"),
"action": "toggle_mute",
"action": "toggle-mute",
"icon": AudioService.muted ? "volume-off" : "volume"
},
{
"label": I18n.tr("context-menu.open-mixer"),
"action": "open_mixer",
"action": "open-mixer",
"icon": "adjustments"
}
// ,
// {
// "label": I18n.tr("context-menu.widget-settings"),
// "action": "widget_settings",
// "icon": "settings"
// },
},
{
"label": I18n.tr("context-menu.widget-settings"),
"action": "widget-settings",
"icon": "settings"
},
]
onTriggered: action => {
if (action === "toggle_mute") {
AudioService.setOutputMuted(!AudioService.muted);
} else if (action === "open_mixer") {
root.openExternalMixer();
} else if (action === "widget_settings")
// TODO: Open widget settings
{}
// Close the popup menu window after handling the action
// Close the popup menu window before handling the action
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
if (popupMenuWindow) {
popupMenuWindow.close();
}
if (action === "toggle-mute") {
AudioService.setOutputMuted(!AudioService.muted);
} else if (action === "open-mixer") {
root.openExternalMixer();
} else if (action === "widget-settings") {
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
}
}
}