mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
BarWidgets: All the right click contextual menus. Fix #541
This commit is contained in:
@@ -398,6 +398,27 @@
|
||||
"clock": {
|
||||
"tooltip": "Kalender öffnen"
|
||||
},
|
||||
"context-menu": {
|
||||
"clear-history": "Verlauf löschen",
|
||||
"cycle-visualizer": "Zyklus-Visualisierer",
|
||||
"disable-bluetooth": "Bluetooth deaktivieren",
|
||||
"disable-dnd": "Bitte nicht stören deaktivieren",
|
||||
"disable-wifi": "WLAN deaktivieren",
|
||||
"enable-bluetooth": "Bluetooth aktivieren",
|
||||
"enable-dnd": "Nicht stören aktivieren",
|
||||
"enable-wifi": "WLAN aktivieren",
|
||||
"next": "Nächste/r/s",
|
||||
"open-calendar": "Kalender öffnen",
|
||||
"open-display-settings": "Anzeigeeinstellungen",
|
||||
"open-launcher": "Launcher öffnen",
|
||||
"open-mixer": "Audiomischer",
|
||||
"open-settings": "Einstellungen öffnen",
|
||||
"pause": "Pause",
|
||||
"play": "Spielen",
|
||||
"previous": "Vorherige",
|
||||
"toggle-mute": "Stummschaltung umschalten",
|
||||
"widget-settings": "Widget-Einstellungen"
|
||||
},
|
||||
"dock": {
|
||||
"menu": {
|
||||
"close": "Schließen",
|
||||
|
||||
+46
-29
@@ -360,16 +360,16 @@
|
||||
}
|
||||
},
|
||||
"battery": {
|
||||
"charging": "Charging.",
|
||||
"charging-rate": "Charging rate: {rate} W.",
|
||||
"discharging": "Discharging.",
|
||||
"discharging-rate": "Discharging rate: {rate} W.",
|
||||
"charging": "Charging",
|
||||
"charging-rate": "Charging rate: {rate} W",
|
||||
"discharging": "Discharging",
|
||||
"discharging-rate": "Discharging rate: {rate} W",
|
||||
"health": "Health: {percent}%",
|
||||
"idle": "Idle.",
|
||||
"no-battery-detected": "No battery detected.",
|
||||
"plugged-in": "Plugged in.",
|
||||
"time-left": "Time left: {time}.",
|
||||
"time-until-full": "Time until full: {time}."
|
||||
"idle": "Idle",
|
||||
"no-battery-detected": "No battery detected",
|
||||
"plugged-in": "Plugged in",
|
||||
"time-left": "Time left: {time}",
|
||||
"time-until-full": "Time until full: {time}"
|
||||
},
|
||||
"bluetooth": {
|
||||
"panel": {
|
||||
@@ -387,11 +387,6 @@
|
||||
"title": "Bluetooth"
|
||||
}
|
||||
},
|
||||
"context-menu": {
|
||||
"open-mixer": "Audio mixer",
|
||||
"toggle-mute": "Toggle mute",
|
||||
"widget-settings": "Widget settings"
|
||||
},
|
||||
"calendar": {
|
||||
"panel": {
|
||||
"week": "Week"
|
||||
@@ -403,6 +398,28 @@
|
||||
"clock": {
|
||||
"tooltip": "Open calendar"
|
||||
},
|
||||
"context-menu": {
|
||||
"clear-history": "Clear history",
|
||||
"cycle-visualizer": "Cycle visualizer",
|
||||
"disable-bluetooth": "Disable Bluetooth",
|
||||
"disable-dnd": "Disable Do Not Disturb",
|
||||
"disable-wifi": "Disable Wi-Fi",
|
||||
"enable-bluetooth": "Enable Bluetooth",
|
||||
"enable-dnd": "Enable Do Not Disturb",
|
||||
"enable-wifi": "Enable Wi-Fi",
|
||||
"next": "Next",
|
||||
"open-calendar": "Open calendar",
|
||||
"open-display-settings": "Display settings",
|
||||
"open-launcher": "Open launcher",
|
||||
"open-mixer": "Audio mixer",
|
||||
"open-settings": "Open settings",
|
||||
"pause": "Pause",
|
||||
"play": "Play",
|
||||
"previous": "Previous",
|
||||
"random-wallpaper": "Random wallpaper",
|
||||
"toggle-mute": "Toggle mute",
|
||||
"widget-settings": "Widget settings"
|
||||
},
|
||||
"dock": {
|
||||
"menu": {
|
||||
"close": "Close",
|
||||
@@ -1965,39 +1982,39 @@
|
||||
"tooltips": {
|
||||
"add-widget": "Add widget",
|
||||
"bluetooth-devices": "Bluetooth devices",
|
||||
"brightness-at": "Brightness: {brightness}%\nRight click for settings.\nScroll to modify brightness.",
|
||||
"brightness-at": "Brightness: {brightness}%\nScroll to modify brightness",
|
||||
"cancel-timer": "Cancel timer",
|
||||
"clear-history": "Clear history",
|
||||
"click-to-start-recording": "Click to start recording",
|
||||
"click-to-stop-recording": "Click to stop recording",
|
||||
"close": "Close",
|
||||
"connect-disconnect-devices": "Left click to connect. Right click to forget.",
|
||||
"connect-disconnect-devices": "Left click to connect\nRight click to forget",
|
||||
"delete-notification": "Delete notification",
|
||||
"disable-keep-awake": "Click to disable keep awake.\nScroll to adjust timeout.",
|
||||
"disable-keep-awake": "Click to disable keep awake.\nScroll to adjust timeout",
|
||||
"do-not-disturb-disabled": "'Do not disturb' disabled",
|
||||
"do-not-disturb-enabled": "'Do not disturb' enabled",
|
||||
"enable-keep-awake": "Click to enable keep awake.\nScroll to adjust timeout.",
|
||||
"enable-keep-awake": "Click to enable keep awake.\nScroll to adjust timeout",
|
||||
"forget-network": "Forget network",
|
||||
"home": "Home",
|
||||
"input-muted": "Toggle input mute",
|
||||
"keep-awake": "Keep awake",
|
||||
"keyboard-layout": "{layout} keyboard layout",
|
||||
"manage-wifi": "Manage Wi-Fi",
|
||||
"microphone-volume-at": "Microphone volume at {volume}%\nLeft click for settings. Right click to toggle mute.\nScroll to modify volume.",
|
||||
"microphone-volume-at": "Microphone volume at {volume}%\nScroll to modify volume",
|
||||
"move-to-center-section": "Move to center section",
|
||||
"move-to-left-section": "Move to left section",
|
||||
"move-to-right-section": "Move to right section",
|
||||
"next-media": "Next media",
|
||||
"next-month": "Next month",
|
||||
"night-light-disabled": "Night light is disabled.\nLeft click to cycle mode.\nRight click to access settings.",
|
||||
"night-light-enabled": "Night light is enabled.\nLeft click to cycle mode.\nRight click to access settings.",
|
||||
"night-light-forced": "Night light is forced.\nLeft click to cycle mode.\nRight click to access settings.",
|
||||
"night-light-not-installed": "Night light is not available.\nwlsunset is not installed.",
|
||||
"noctalia-performance-disabled": "Noctalia performance mode is disabled.\nLeft click to enable.",
|
||||
"noctalia-performance-enabled": "Noctalia performance mode is enabled.\nLeft click to disable.",
|
||||
"night-light-disabled": "Night light is disabled.\nLeft click to cycle mode\nRight click to access settings",
|
||||
"night-light-enabled": "Night light is enabled.\nLeft click to cycle mode\nRight click to access settings",
|
||||
"night-light-forced": "Night light is forced.\nLeft click to cycle mode\nRight click to access settings",
|
||||
"night-light-not-installed": "Night light is not available\nwlsunset is not installed",
|
||||
"noctalia-performance-disabled": "Noctalia performance mode is disabled\nLeft click to enable",
|
||||
"noctalia-performance-enabled": "Noctalia performance mode is enabled\nLeft click to disable",
|
||||
"open-control-center": "Open control center",
|
||||
"open-notification-history-disable-dnd": "Open notification history\nRight-click to disable \"Do not disturb\".",
|
||||
"open-notification-history-enable-dnd": "Open notification history\nRight-click to enable \"Do not disturb\".",
|
||||
"open-notification-history-disable-dnd": "Open notification history\nRight-click to disable \"Do not disturb\"",
|
||||
"open-notification-history-enable-dnd": "Open notification history\nRight-click to enable \"Do not disturb\"",
|
||||
"open-settings": "Open settings",
|
||||
"open-tray-dropdown": "Open tray dropdown",
|
||||
"open-wallpaper-selector": "Open wallpaper selector",
|
||||
@@ -2020,8 +2037,8 @@
|
||||
"switch-to-dark-mode": "Switch to dark mode",
|
||||
"switch-to-light-mode": "Switch to light mode",
|
||||
"up": "Up",
|
||||
"volume-at": "Output volume at {volume}%\nLeft click for settings. Right click to toggle mute.\nScroll to modify volume.",
|
||||
"wallpaper-selector": "Left click: Open wallpaper selector.\nRight click: Set random wallpaper.",
|
||||
"volume-at": "Output volume at {volume}%\nScroll to modify volume",
|
||||
"wallpaper-selector": "Left click: Open wallpaper selector.\nRight click: Set random wallpaper",
|
||||
"widget-settings": "Widget settings"
|
||||
},
|
||||
"wallpaper": {
|
||||
|
||||
@@ -398,6 +398,27 @@
|
||||
"clock": {
|
||||
"tooltip": "Abrir calendario"
|
||||
},
|
||||
"context-menu": {
|
||||
"clear-history": "Borrar historial",
|
||||
"cycle-visualizer": "Visualizador de ciclos",
|
||||
"disable-bluetooth": "Desactivar Bluetooth",
|
||||
"disable-dnd": "Desactivar No molestar",
|
||||
"disable-wifi": "Desactivar Wi-Fi",
|
||||
"enable-bluetooth": "Activar Bluetooth",
|
||||
"enable-dnd": "Activar No molestar",
|
||||
"enable-wifi": "Activar Wi-Fi",
|
||||
"next": "Siguiente",
|
||||
"open-calendar": "Abrir calendario",
|
||||
"open-display-settings": "Configuración de pantalla",
|
||||
"open-launcher": "Abrir lanzador",
|
||||
"open-mixer": "Mezclador de audio",
|
||||
"open-settings": "Abrir ajustes",
|
||||
"pause": "Pausa",
|
||||
"play": "Jugar",
|
||||
"previous": "Anterior",
|
||||
"toggle-mute": "Activar/desactivar silencio",
|
||||
"widget-settings": "Configuración del widget"
|
||||
},
|
||||
"dock": {
|
||||
"menu": {
|
||||
"close": "Cerrar",
|
||||
|
||||
@@ -398,6 +398,27 @@
|
||||
"clock": {
|
||||
"tooltip": "Ouvrir le calendrier"
|
||||
},
|
||||
"context-menu": {
|
||||
"clear-history": "Effacer l'historique",
|
||||
"cycle-visualizer": "Visualiseur de cycle",
|
||||
"disable-bluetooth": "Désactiver le Bluetooth",
|
||||
"disable-dnd": "Désactiver le mode Ne pas déranger",
|
||||
"disable-wifi": "Désactiver le Wi-Fi",
|
||||
"enable-bluetooth": "Activer le Bluetooth",
|
||||
"enable-dnd": "Activer le mode Ne pas déranger",
|
||||
"enable-wifi": "Activer le Wi-Fi",
|
||||
"next": "Suivant",
|
||||
"open-calendar": "Ouvrir le calendrier",
|
||||
"open-display-settings": "Paramètres d'affichage",
|
||||
"open-launcher": "Ouvrir le lanceur",
|
||||
"open-mixer": "Table de mixage audio",
|
||||
"open-settings": "Ouvrir les paramètres",
|
||||
"pause": "Pause",
|
||||
"play": "Jouer",
|
||||
"previous": "Précédent",
|
||||
"toggle-mute": "Activer/désactiver le mode muet",
|
||||
"widget-settings": "Paramètres du widget"
|
||||
},
|
||||
"dock": {
|
||||
"menu": {
|
||||
"close": "Fermer",
|
||||
|
||||
@@ -398,6 +398,27 @@
|
||||
"clock": {
|
||||
"tooltip": "Kalender openen"
|
||||
},
|
||||
"context-menu": {
|
||||
"clear-history": "Geschiedenis wissen",
|
||||
"cycle-visualizer": "Cyclusvisualisatie",
|
||||
"disable-bluetooth": "Bluetooth uitschakelen",
|
||||
"disable-dnd": "Niet Storen uitschakelen",
|
||||
"disable-wifi": "Wi-Fi uitschakelen",
|
||||
"enable-bluetooth": "Bluetooth inschakelen",
|
||||
"enable-dnd": "Niet Storen inschakelen",
|
||||
"enable-wifi": "Wi-Fi inschakelen",
|
||||
"next": "Volgende",
|
||||
"open-calendar": "Open agenda",
|
||||
"open-display-settings": "Beeldscherminstellingen",
|
||||
"open-launcher": "Launcher openen",
|
||||
"open-mixer": "Audiomixer",
|
||||
"open-settings": "Instellingen openen",
|
||||
"pause": "Pauze",
|
||||
"play": "Spelen",
|
||||
"previous": "Vorige",
|
||||
"toggle-mute": "Dempen aan/uit",
|
||||
"widget-settings": "Widgetinstellingen"
|
||||
},
|
||||
"dock": {
|
||||
"menu": {
|
||||
"close": "Sluiten",
|
||||
|
||||
@@ -398,6 +398,27 @@
|
||||
"clock": {
|
||||
"tooltip": "Abrir calendário"
|
||||
},
|
||||
"context-menu": {
|
||||
"clear-history": "Limpar histórico",
|
||||
"cycle-visualizer": "Visualizador de ciclo",
|
||||
"disable-bluetooth": "Desativar Bluetooth",
|
||||
"disable-dnd": "Desativar o Não Perturbe",
|
||||
"disable-wifi": "Desativar Wi-Fi",
|
||||
"enable-bluetooth": "Ativar Bluetooth",
|
||||
"enable-dnd": "Ativar Não Perturbe",
|
||||
"enable-wifi": "Ativar Wi-Fi",
|
||||
"next": "Próximo(a)",
|
||||
"open-calendar": "Abrir calendário",
|
||||
"open-display-settings": "Configurações de exibição",
|
||||
"open-launcher": "Abrir iniciador",
|
||||
"open-mixer": "Mesa de som",
|
||||
"open-settings": "Abrir configurações",
|
||||
"pause": "Pausa",
|
||||
"play": "Jogar",
|
||||
"previous": "Anterior",
|
||||
"toggle-mute": "Alternar mudo",
|
||||
"widget-settings": "Configurações do widget"
|
||||
},
|
||||
"dock": {
|
||||
"menu": {
|
||||
"close": "Fechar",
|
||||
|
||||
@@ -398,6 +398,27 @@
|
||||
"clock": {
|
||||
"tooltip": "Открыть календарь"
|
||||
},
|
||||
"context-menu": {
|
||||
"clear-history": "Очистить историю",
|
||||
"cycle-visualizer": "Визуализатор циклов",
|
||||
"disable-bluetooth": "Отключить Bluetooth",
|
||||
"disable-dnd": "Отключить режим \"Не беспокоить\"",
|
||||
"disable-wifi": "Отключить Wi-Fi",
|
||||
"enable-bluetooth": "Включить Bluetooth",
|
||||
"enable-dnd": "Не беспокоить",
|
||||
"enable-wifi": "Включить Wi-Fi",
|
||||
"next": "Следующий",
|
||||
"open-calendar": "Открыть календарь",
|
||||
"open-display-settings": "Настройки экрана",
|
||||
"open-launcher": "Открыть лаунчер",
|
||||
"open-mixer": "Аудиомикшер",
|
||||
"open-settings": "Открыть настройки",
|
||||
"pause": "Пауза",
|
||||
"play": "Играть",
|
||||
"previous": "Предыдущий",
|
||||
"toggle-mute": "Включить/выключить звук",
|
||||
"widget-settings": "Настройки виджета"
|
||||
},
|
||||
"dock": {
|
||||
"menu": {
|
||||
"close": "Закрыть",
|
||||
|
||||
@@ -398,6 +398,27 @@
|
||||
"clock": {
|
||||
"tooltip": "Takvimi aç"
|
||||
},
|
||||
"context-menu": {
|
||||
"clear-history": "Geçmişi temizle",
|
||||
"cycle-visualizer": "Döngü görselleştirici",
|
||||
"disable-bluetooth": "Bluetooth'u kapat",
|
||||
"disable-dnd": "Rahatsız Etmeyin'i Kapat",
|
||||
"disable-wifi": "Wi-Fi'ı kapat",
|
||||
"enable-bluetooth": "Bluetooth'u etkinleştir",
|
||||
"enable-dnd": "Rahatsız Etmeyin'i Etkinleştir",
|
||||
"enable-wifi": "Wi-Fi'ı etkinleştir",
|
||||
"next": "Sonraki",
|
||||
"open-calendar": "Takvimi aç",
|
||||
"open-display-settings": "Ekran ayarları",
|
||||
"open-launcher": "Başlatıcıyı aç",
|
||||
"open-mixer": "Ses mikseri",
|
||||
"open-settings": "Ayarları aç",
|
||||
"pause": "Duraklat",
|
||||
"play": "Oyna",
|
||||
"previous": "Önceki",
|
||||
"toggle-mute": "Sesi kapat/aç",
|
||||
"widget-settings": "Araç ayarları"
|
||||
},
|
||||
"dock": {
|
||||
"menu": {
|
||||
"close": "Kapat",
|
||||
|
||||
@@ -398,6 +398,27 @@
|
||||
"clock": {
|
||||
"tooltip": "Відкрити календар"
|
||||
},
|
||||
"context-menu": {
|
||||
"clear-history": "Очистити історію",
|
||||
"cycle-visualizer": "Візуалізатор циклів",
|
||||
"disable-bluetooth": "Вимкнути Bluetooth",
|
||||
"disable-dnd": "Вимкнути режим \"Не турбувати\"",
|
||||
"disable-wifi": "Вимкнути Wi-Fi",
|
||||
"enable-bluetooth": "Увімкнути Bluetooth",
|
||||
"enable-dnd": "Увімкнути режим \"Не турбувати\"",
|
||||
"enable-wifi": "Увімкнути Wi-Fi",
|
||||
"next": "Наступний",
|
||||
"open-calendar": "Відкрити календар",
|
||||
"open-display-settings": "Параметри дисплея",
|
||||
"open-launcher": "Відкрити панель запуску",
|
||||
"open-mixer": "Аудіомікшер",
|
||||
"open-settings": "Відкрити налаштування",
|
||||
"pause": "Пауза",
|
||||
"play": "Грати",
|
||||
"previous": "Попередній",
|
||||
"toggle-mute": "Увімкнути/вимкнути звук",
|
||||
"widget-settings": "Налаштування віджета"
|
||||
},
|
||||
"dock": {
|
||||
"menu": {
|
||||
"close": "Закрити",
|
||||
|
||||
@@ -398,6 +398,27 @@
|
||||
"clock": {
|
||||
"tooltip": "打开日历"
|
||||
},
|
||||
"context-menu": {
|
||||
"clear-history": "清除历史记录",
|
||||
"cycle-visualizer": "周期可视化工具",
|
||||
"disable-bluetooth": "禁用蓝牙",
|
||||
"disable-dnd": "关闭勿扰模式",
|
||||
"disable-wifi": "禁用Wi-Fi",
|
||||
"enable-bluetooth": "启用蓝牙",
|
||||
"enable-dnd": "启用勿扰模式",
|
||||
"enable-wifi": "启用 Wi-Fi",
|
||||
"next": "下一个",
|
||||
"open-calendar": "打开日历",
|
||||
"open-display-settings": "显示设置",
|
||||
"open-launcher": "打开启动器",
|
||||
"open-mixer": "音频调音台",
|
||||
"open-settings": "打开设置",
|
||||
"pause": "暂停",
|
||||
"play": "玩",
|
||||
"previous": "上一个",
|
||||
"toggle-mute": "切换静音",
|
||||
"widget-settings": "小部件设置"
|
||||
},
|
||||
"dock": {
|
||||
"menu": {
|
||||
"close": "关闭",
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Widgets
|
||||
import qs.Commons
|
||||
import qs.Modules.Bar.Extras
|
||||
import qs.Services.Compositor
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
@@ -166,6 +168,29 @@ Item {
|
||||
font.weight: Style.fontWeightMedium
|
||||
}
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: [
|
||||
{
|
||||
"label": I18n.tr("context-menu.widget-settings"),
|
||||
"action": "widget-settings",
|
||||
"icon": "settings"
|
||||
},
|
||||
]
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "widget-settings") {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: windowActiveRect
|
||||
visible: root.visible
|
||||
@@ -409,7 +434,7 @@ Item {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onEntered: {
|
||||
if ((windowTitle !== "") && isVerticalBar || (scrollingMode === "never")) {
|
||||
TooltipService.show(root, windowTitle, BarService.getTooltipDirection());
|
||||
@@ -418,6 +443,16 @@ Item {
|
||||
onExited: {
|
||||
TooltipService.hide();
|
||||
}
|
||||
onClicked: mouse => {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(root, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(root, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Modules.Bar.Extras
|
||||
import qs.Services.Media
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
@@ -103,22 +105,61 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: [
|
||||
{
|
||||
"label": I18n.tr("context-menu.cycle-visualizer"),
|
||||
"action": "cycle-visualizer",
|
||||
"icon": "chart-column"
|
||||
},
|
||||
{
|
||||
"label": I18n.tr("context-menu.widget-settings"),
|
||||
"action": "widget-settings",
|
||||
"icon": "settings"
|
||||
},
|
||||
]
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "cycle-visualizer") {
|
||||
const types = ["linear", "mirrored", "wave"];
|
||||
const currentIndex = types.indexOf(currentVisualizerType);
|
||||
const nextIndex = (currentIndex + 1) % types.length;
|
||||
Settings.data.audio.visualizerType = types[nextIndex];
|
||||
} else if (action === "widget-settings") {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Click to cycle through visualizer types
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
hoverEnabled: true
|
||||
acceptedButtons: Qt.LeftButton
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
|
||||
onClicked: mouse => {
|
||||
const types = ["linear", "mirrored", "wave"];
|
||||
const currentIndex = types.indexOf(currentVisualizerType);
|
||||
const nextIndex = (currentIndex + 1) % types.length;
|
||||
const newType = types[nextIndex];
|
||||
|
||||
// Update settings directly, maybe this should be a widget setting...
|
||||
Settings.data.audio.visualizerType = newType;
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(root, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(root, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
} else {
|
||||
const types = ["linear", "mirrored", "wave"];
|
||||
const currentIndex = types.indexOf(currentVisualizerType);
|
||||
const nextIndex = (currentIndex + 1) % types.length;
|
||||
Settings.data.audio.visualizerType = types[nextIndex];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Services.UPower
|
||||
@@ -84,6 +85,29 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: [
|
||||
{
|
||||
"label": I18n.tr("context-menu.widget-settings"),
|
||||
"action": "widget-settings",
|
||||
"icon": "settings"
|
||||
},
|
||||
]
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "widget-settings") {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BarPill {
|
||||
id: pill
|
||||
|
||||
@@ -141,5 +165,13 @@ Item {
|
||||
}
|
||||
return lines.join("\n");
|
||||
}
|
||||
onRightClicked: {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(pill, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(pill, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Modules.Bar.Extras
|
||||
import qs.Services.Networking
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@@ -33,6 +35,36 @@ Item {
|
||||
implicitWidth: pill.width
|
||||
implicitHeight: pill.height
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: [
|
||||
{
|
||||
"label": BluetoothService.enabled ? I18n.tr("context-menu.disable-bluetooth") : I18n.tr("context-menu.enable-bluetooth"),
|
||||
"action": "toggle-bluetooth",
|
||||
"icon": BluetoothService.enabled ? "bluetooth-off" : "bluetooth"
|
||||
},
|
||||
{
|
||||
"label": I18n.tr("context-menu.widget-settings"),
|
||||
"action": "widget-settings",
|
||||
"icon": "settings"
|
||||
},
|
||||
]
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "toggle-bluetooth") {
|
||||
BluetoothService.setBluetoothEnabled(!BluetoothService.enabled);
|
||||
} else if (action === "widget-settings") {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BarPill {
|
||||
id: pill
|
||||
|
||||
@@ -57,7 +89,14 @@ Item {
|
||||
forceOpen: !isBarVertical && root.displayMode === "alwaysShow"
|
||||
forceClose: isBarVertical || root.displayMode === "alwaysHide" || BluetoothService.connectedDevices.length === 0
|
||||
onClicked: PanelService.getPanel("bluetoothPanel", screen)?.toggle(this)
|
||||
onRightClicked: BluetoothService.setBluetoothEnabled(!BluetoothService.enabled)
|
||||
onRightClicked: {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(pill, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(pill, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
}
|
||||
tooltipText: {
|
||||
if (pill.text !== "") {
|
||||
return pill.text;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Modules.Bar.Extras
|
||||
@@ -74,6 +75,38 @@ Item {
|
||||
onTriggered: pill.hide()
|
||||
}
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: [
|
||||
{
|
||||
"label": I18n.tr("context-menu.open-display-settings"),
|
||||
"action": "open-display-settings",
|
||||
"icon": "sun"
|
||||
},
|
||||
{
|
||||
"label": I18n.tr("context-menu.widget-settings"),
|
||||
"action": "widget-settings",
|
||||
"icon": "settings"
|
||||
},
|
||||
]
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "open-display-settings") {
|
||||
var settingsPanel = PanelService.getPanel("settingsPanel", screen);
|
||||
settingsPanel.requestedTab = SettingsPanel.Tab.Display;
|
||||
settingsPanel.open();
|
||||
} else if (action === "widget-settings") {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BarPill {
|
||||
id: pill
|
||||
|
||||
@@ -116,9 +149,12 @@ Item {
|
||||
}
|
||||
|
||||
onRightClicked: {
|
||||
var settingsPanel = PanelService.getPanel("settingsPanel", screen);
|
||||
settingsPanel.requestedTab = SettingsPanel.Tab.Display;
|
||||
settingsPanel.open();
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(pill, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(pill, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Modules.Bar.Extras
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
|
||||
@@ -115,11 +117,42 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: [
|
||||
{
|
||||
"label": I18n.tr("context-menu.open-calendar"),
|
||||
"action": "open-calendar",
|
||||
"icon": "calendar"
|
||||
},
|
||||
{
|
||||
"label": I18n.tr("context-menu.widget-settings"),
|
||||
"action": "widget-settings",
|
||||
"icon": "settings"
|
||||
},
|
||||
]
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "open-calendar") {
|
||||
PanelService.getPanel("calendarPanel", screen)?.toggle(root);
|
||||
} else if (action === "widget-settings") {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: clockMouseArea
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
hoverEnabled: true
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onEntered: {
|
||||
if (!PanelService.getPanel("calendarPanel", screen)?.active) {
|
||||
TooltipService.show(root, I18n.tr("clock.tooltip"), BarService.getTooltipDirection());
|
||||
@@ -128,9 +161,18 @@ Rectangle {
|
||||
onExited: {
|
||||
TooltipService.hide();
|
||||
}
|
||||
onClicked: {
|
||||
TooltipService.hide();
|
||||
PanelService.getPanel("calendarPanel", screen)?.toggle(this);
|
||||
}
|
||||
onClicked: mouse => {
|
||||
TooltipService.hide();
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(root, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(root, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
} else {
|
||||
PanelService.getPanel("calendarPanel", screen)?.toggle(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Effects
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import qs.Commons
|
||||
import qs.Modules.Bar.Extras
|
||||
import qs.Services.System
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
@@ -50,16 +52,61 @@ NIconButton {
|
||||
colorBgHover: useDistroLogo ? Color.mSurfaceVariant : Color.mHover
|
||||
colorBorder: Color.transparent
|
||||
colorBorderHover: useDistroLogo ? Color.mHover : Color.transparent
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: [
|
||||
{
|
||||
"label": I18n.tr("context-menu.open-launcher"),
|
||||
"action": "open-launcher",
|
||||
"icon": "search"
|
||||
},
|
||||
{
|
||||
"label": I18n.tr("context-menu.open-settings"),
|
||||
"action": "open-settings",
|
||||
"icon": "adjustments"
|
||||
},
|
||||
{
|
||||
"label": I18n.tr("context-menu.widget-settings"),
|
||||
"action": "widget-settings",
|
||||
"icon": "settings"
|
||||
},
|
||||
]
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "open-launcher") {
|
||||
PanelService.getPanel("launcherPanel", screen)?.toggle();
|
||||
} else if (action === "open-settings") {
|
||||
PanelService.getPanel("settingsPanel", screen)?.toggle();
|
||||
} else if (action === "widget-settings") {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
var controlCenterPanel = PanelService.getPanel("controlCenterPanel", screen);
|
||||
if (Settings.data.controlCenter.position === "close_to_bar_button") {
|
||||
// Willopen the panel next to the bar button.
|
||||
// Will open the panel next to the bar button.
|
||||
controlCenterPanel?.toggle(this);
|
||||
} else {
|
||||
controlCenterPanel?.toggle();
|
||||
}
|
||||
}
|
||||
onRightClicked: PanelService.getPanel("settingsPanel", screen)?.toggle()
|
||||
onRightClicked: {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(root, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(root, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
}
|
||||
onMiddleClicked: PanelService.getPanel("launcherPanel", screen)?.toggle()
|
||||
|
||||
IconImage {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
@@ -39,6 +40,29 @@ Item {
|
||||
implicitWidth: pill.width
|
||||
implicitHeight: pill.height
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: [
|
||||
{
|
||||
"label": I18n.tr("context-menu.widget-settings"),
|
||||
"action": "widget-settings",
|
||||
"icon": "settings"
|
||||
},
|
||||
]
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "widget-settings") {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BarPill {
|
||||
id: pill
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@@ -54,9 +78,14 @@ Item {
|
||||
})
|
||||
forceOpen: root.displayMode === "forceOpen"
|
||||
forceClose: root.displayMode === "alwaysHide"
|
||||
onClicked:
|
||||
|
||||
// You could open keyboard settings here if needed.
|
||||
{}
|
||||
onClicked: {}
|
||||
onRightClicked: {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(pill, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(pill, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import qs.Commons
|
||||
import qs.Modules.Bar.Extras
|
||||
import qs.Modules.Panels.Settings
|
||||
import qs.Services.Keyboard
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
|
||||
//import qs.Modules.Bar.Extras
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
property ShellScreen screen
|
||||
|
||||
property string widgetId: ""
|
||||
property string section: ""
|
||||
property int sectionWidgetIndex: -1
|
||||
@@ -47,6 +50,44 @@ Rectangle {
|
||||
radius: Style.radiusM
|
||||
color: Style.capsuleColor
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: [
|
||||
{
|
||||
"label": I18n.tr("context-menu.widget-settings"),
|
||||
"action": "widget-settings",
|
||||
"icon": "settings"
|
||||
},
|
||||
]
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "widget-settings") {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton
|
||||
onClicked: mouse => {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(root, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(root, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: layout
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
@@ -3,6 +3,7 @@ import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Modules.Bar.Extras
|
||||
import qs.Services.Media
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
@@ -162,6 +163,58 @@ Item {
|
||||
pointSize: Style.fontSizeS * scaling
|
||||
}
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: {
|
||||
var items = [];
|
||||
if (hasActivePlayer && MediaService.canPlay) {
|
||||
items.push({
|
||||
"label": MediaService.isPlaying ? I18n.tr("context-menu.pause") : I18n.tr("context-menu.play"),
|
||||
"action": "play-pause",
|
||||
"icon": MediaService.isPlaying ? "media-pause" : "media-play"
|
||||
});
|
||||
}
|
||||
if (hasActivePlayer && MediaService.canGoPrevious) {
|
||||
items.push({
|
||||
"label": I18n.tr("context-menu.previous"),
|
||||
"action": "previous",
|
||||
"icon": "media-prev"
|
||||
});
|
||||
}
|
||||
if (hasActivePlayer && MediaService.canGoNext) {
|
||||
items.push({
|
||||
"label": I18n.tr("context-menu.next"),
|
||||
"action": "next",
|
||||
"icon": "media-next"
|
||||
});
|
||||
}
|
||||
items.push({
|
||||
"label": I18n.tr("context-menu.widget-settings"),
|
||||
"action": "widget-settings",
|
||||
"icon": "settings"
|
||||
});
|
||||
return items;
|
||||
}
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "play-pause") {
|
||||
MediaService.playPause();
|
||||
} else if (action === "previous") {
|
||||
MediaService.previous();
|
||||
} else if (action === "next") {
|
||||
MediaService.next();
|
||||
} else if (action === "widget-settings") {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: mediaMini
|
||||
visible: root.visible
|
||||
@@ -466,18 +519,24 @@ Item {
|
||||
cursorShape: hasActivePlayer ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||
onClicked: mouse => {
|
||||
if (!hasActivePlayer || !MediaService.currentPlayer || !MediaService.canPlay) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mouse.button === Qt.LeftButton) {
|
||||
if (!hasActivePlayer || !MediaService.currentPlayer || !MediaService.canPlay) {
|
||||
return;
|
||||
}
|
||||
MediaService.playPause();
|
||||
} else if (mouse.button == Qt.RightButton) {
|
||||
MediaService.next();
|
||||
TooltipService.hide();
|
||||
} else if (mouse.button == Qt.MiddleButton) {
|
||||
MediaService.previous();
|
||||
} else if (mouse.button === Qt.RightButton) {
|
||||
TooltipService.hide();
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(mediaMini, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(mediaMini, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
} else if (mouse.button === Qt.MiddleButton) {
|
||||
if (hasActivePlayer && MediaService.canGoPrevious) {
|
||||
MediaService.previous();
|
||||
TooltipService.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Services.Pipewire
|
||||
@@ -84,6 +85,47 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
function openExternalMixer() {
|
||||
Quickshell.execDetached(["sh", "-c", "pwvucontrol || pavucontrol"]);
|
||||
}
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: [
|
||||
{
|
||||
"label": I18n.tr("context-menu.toggle-mute"),
|
||||
"action": "toggle-mute",
|
||||
"icon": AudioService.inputMuted ? "microphone-off" : "microphone"
|
||||
},
|
||||
{
|
||||
"label": I18n.tr("context-menu.open-mixer"),
|
||||
"action": "open-mixer",
|
||||
"icon": "adjustments"
|
||||
},
|
||||
{
|
||||
"label": I18n.tr("context-menu.widget-settings"),
|
||||
"action": "widget-settings",
|
||||
"icon": "settings"
|
||||
},
|
||||
]
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "toggle-mute") {
|
||||
AudioService.setInputMuted(!AudioService.inputMuted);
|
||||
} else if (action === "open-mixer") {
|
||||
root.openExternalMixer();
|
||||
} else if (action === "widget-settings") {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BarPill {
|
||||
id: pill
|
||||
|
||||
@@ -117,10 +159,13 @@ Item {
|
||||
PanelService.getPanel("audioPanel", screen)?.toggle(this);
|
||||
}
|
||||
onRightClicked: {
|
||||
AudioService.setInputMuted(!AudioService.inputMuted);
|
||||
}
|
||||
onMiddleClicked: {
|
||||
Quickshell.execDetached(["pwvucontrol"]);
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(pill, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(pill, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
}
|
||||
onMiddleClicked: root.openExternalMixer()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import qs.Commons
|
||||
import qs.Modules.Bar.Extras
|
||||
import qs.Services.System
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
@@ -56,12 +57,56 @@ NIconButton {
|
||||
colorBorder: Color.transparent
|
||||
colorBorderHover: Color.transparent
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: [
|
||||
{
|
||||
"label": NotificationService.doNotDisturb ? I18n.tr("context-menu.disable-dnd") : I18n.tr("context-menu.enable-dnd"),
|
||||
"action": "toggle-dnd",
|
||||
"icon": NotificationService.doNotDisturb ? "bell" : "bell-off"
|
||||
},
|
||||
{
|
||||
"label": I18n.tr("context-menu.clear-history"),
|
||||
"action": "clear-history",
|
||||
"icon": "trash"
|
||||
},
|
||||
{
|
||||
"label": I18n.tr("context-menu.widget-settings"),
|
||||
"action": "widget-settings",
|
||||
"icon": "settings"
|
||||
},
|
||||
]
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "toggle-dnd") {
|
||||
NotificationService.doNotDisturb = !NotificationService.doNotDisturb;
|
||||
} else if (action === "clear-history") {
|
||||
NotificationService.clearHistory();
|
||||
} else if (action === "widget-settings") {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
var panel = PanelService.getPanel("notificationHistoryPanel", screen);
|
||||
panel?.toggle(this);
|
||||
}
|
||||
|
||||
onRightClicked: NotificationService.doNotDisturb = !NotificationService.doNotDisturb
|
||||
onRightClicked: {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(root, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(root, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
anchors.right: parent.right
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Modules.Bar.Extras
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
|
||||
@@ -55,5 +57,37 @@ NIconButton {
|
||||
colorFg: root.iconColor
|
||||
colorBorder: Color.transparent
|
||||
colorBorderHover: Color.transparent
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: [
|
||||
{
|
||||
"label": I18n.tr("context-menu.widget-settings"),
|
||||
"action": "widget-settings",
|
||||
"icon": "settings"
|
||||
},
|
||||
]
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "widget-settings") {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: PanelService.getPanel("sessionMenuPanel", screen)?.toggle()
|
||||
onRightClicked: {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(root, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(root, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Modules.Bar.Extras
|
||||
import qs.Modules.Panels.Settings
|
||||
import qs.Services.System
|
||||
import qs.Services.UI
|
||||
@@ -111,6 +113,44 @@ Rectangle {
|
||||
radius: Style.radiusM
|
||||
color: Style.capsuleColor
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: [
|
||||
{
|
||||
"label": I18n.tr("context-menu.widget-settings"),
|
||||
"action": "widget-settings",
|
||||
"icon": "settings"
|
||||
},
|
||||
]
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "widget-settings") {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton
|
||||
onClicked: mouse => {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(root, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(root, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Status indicator component definition
|
||||
Component {
|
||||
id: statusIndicatorComponent
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Modules.Bar.Extras
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
|
||||
@@ -20,6 +22,30 @@ NIconButton {
|
||||
colorFg: Color.mOnSurface
|
||||
colorBorder: Color.transparent
|
||||
colorBorderHover: Color.transparent
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: [
|
||||
{
|
||||
"label": I18n.tr("context-menu.random-wallpaper"),
|
||||
"action": "random-wallpaper",
|
||||
"icon": "dice"
|
||||
},
|
||||
]
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "random-wallpaper") {
|
||||
WallpaperService.setRandomWallpaper();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
var wallpaperPanel = PanelService.getPanel("wallpaperPanel", screen);
|
||||
if (Settings.data.wallpaper.panelPosition === "follow_bar") {
|
||||
@@ -28,4 +54,12 @@ NIconButton {
|
||||
wallpaperPanel?.toggle();
|
||||
}
|
||||
}
|
||||
onRightClicked: {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(root, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(root, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Modules.Bar.Extras
|
||||
import qs.Services.Networking
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@@ -33,6 +35,36 @@ Item {
|
||||
implicitWidth: pill.width
|
||||
implicitHeight: pill.height
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: [
|
||||
{
|
||||
"label": Settings.data.network.wifiEnabled ? I18n.tr("context-menu.disable-wifi") : I18n.tr("context-menu.enable-wifi"),
|
||||
"action": "toggle-wifi",
|
||||
"icon": Settings.data.network.wifiEnabled ? "wifi-off" : "wifi"
|
||||
},
|
||||
{
|
||||
"label": I18n.tr("context-menu.widget-settings"),
|
||||
"action": "widget-settings",
|
||||
"icon": "settings"
|
||||
},
|
||||
]
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "toggle-wifi") {
|
||||
NetworkService.setWifiEnabled(!Settings.data.network.wifiEnabled);
|
||||
} else if (action === "widget-settings") {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BarPill {
|
||||
id: pill
|
||||
|
||||
@@ -79,7 +111,14 @@ Item {
|
||||
forceOpen: !isBarVertical && root.displayMode === "alwaysShow"
|
||||
forceClose: isBarVertical || root.displayMode === "alwaysHide" || !pill.text
|
||||
onClicked: PanelService.getPanel("wifiPanel", screen)?.toggle(this)
|
||||
onRightClicked: NetworkService.setWifiEnabled(!Settings.data.network.wifiEnabled)
|
||||
onRightClicked: {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(pill, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(pill, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
}
|
||||
tooltipText: {
|
||||
if (pill.text !== "") {
|
||||
return pill.text;
|
||||
|
||||
@@ -6,6 +6,7 @@ import QtQuick.Window
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import qs.Commons
|
||||
import qs.Modules.Bar.Extras
|
||||
import qs.Services.Compositor
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
@@ -220,6 +221,29 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
NPopupContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
model: [
|
||||
{
|
||||
"label": I18n.tr("context-menu.widget-settings"),
|
||||
"action": "widget-settings",
|
||||
"icon": "settings"
|
||||
},
|
||||
]
|
||||
|
||||
onTriggered: action => {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.close();
|
||||
}
|
||||
|
||||
if (action === "widget-settings") {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: workspaceBackground
|
||||
width: isVertical ? Style.capsuleHeight : parent.width
|
||||
@@ -229,6 +253,21 @@ Item {
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton
|
||||
onClicked: mouse => {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
const pos = BarService.getContextMenuPosition(workspaceBackground, contextMenu.implicitWidth, contextMenu.implicitHeight);
|
||||
contextMenu.openAtItem(workspaceBackground, pos.x, pos.y);
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Debounce timer for wheel interactions
|
||||
|
||||
Reference in New Issue
Block a user