From 9ba8723a5dfe51c364042fa20130cac9483683d3 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Wed, 26 Nov 2025 19:40:19 +0100 Subject: [PATCH] waffles: map media controls bind to action center --- .../ii/sidebarRight/BottomWidgetGroup.qml | 5 ---- .../sidebarRight/calendar/calendar_layout.js | 6 ++--- .../actionCenter/WaffleActionCenter.qml | 27 ++++++++++++++++--- dots/.config/quickshell/ii/shell.qml | 2 +- 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/BottomWidgetGroup.qml b/dots/.config/quickshell/ii/modules/ii/sidebarRight/BottomWidgetGroup.qml index 638e2d56f..4c6ea6dd9 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/BottomWidgetGroup.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/BottomWidgetGroup.qml @@ -228,11 +228,6 @@ Rectangle { component TabSwitchAnim: SequentialAnimation { id: switchAnim property bool down: false - // ScriptAction { - // script: { - // switchAnim.down = root.selectedTab > root.previousIndex; - // } - // } ParallelAnimation { PropertyAnimation { target: tabStack diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/calendar/calendar_layout.js b/dots/.config/quickshell/ii/modules/ii/sidebarRight/calendar/calendar_layout.js index 7f750b411..e2042bff7 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/calendar/calendar_layout.js +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/calendar/calendar_layout.js @@ -74,7 +74,7 @@ function getCalendarLayout(dateObject, highlight) { // Fill var monthDiff = (weekdayOfMonthFirst == 0 ? 0 : -1); var toFill, dim; - if(weekdayOfMonthFirst == 0) { + if (weekdayOfMonthFirst == 0) { toFill = 1; dim = daysInMonth; } @@ -88,8 +88,7 @@ function getCalendarLayout(dateObject, highlight) { calendar[i][j] = { "day": toFill, "today": ((toFill == day && monthDiff == 0 && highlight) ? 1 : ( - monthDiff == 0 ? 0 : - -1 + monthDiff == 0 ? 0 : -1 )) }; // Increment @@ -112,4 +111,3 @@ function getCalendarLayout(dateObject, highlight) { } return calendar; } - diff --git a/dots/.config/quickshell/ii/modules/waffle/actionCenter/WaffleActionCenter.qml b/dots/.config/quickshell/ii/modules/waffle/actionCenter/WaffleActionCenter.qml index 56fbedda3..48e81bbc2 100644 --- a/dots/.config/quickshell/ii/modules/waffle/actionCenter/WaffleActionCenter.qml +++ b/dots/.config/quickshell/ii/modules/waffle/actionCenter/WaffleActionCenter.qml @@ -15,7 +15,8 @@ Scope { target: GlobalStates function onSidebarLeftOpenChanged() { - if (GlobalStates.sidebarLeftOpen) panelLoader.active = true; + if (GlobalStates.sidebarLeftOpen) + panelLoader.active = true; } } @@ -42,13 +43,14 @@ Scope { id: focusGrab active: true windows: [panelWindow] - onCleared: content.close(); + onCleared: content.close() } Connections { target: GlobalStates function onSidebarLeftOpenChanged() { - if (!GlobalStates.sidebarLeftOpen) content.close(); + if (!GlobalStates.sidebarLeftOpen) + content.close(); } } @@ -80,6 +82,23 @@ Scope { name: "sidebarLeftToggle" description: "Toggles left sidebar on press" - onPressed: root.toggleOpen(); + onPressed: root.toggleOpen() + } + + IpcHandler { + target: "mediaControls" + + function toggle(): void { + GlobalStates.sidebarLeftOpen = !GlobalStates.sidebarLeftOpen; + } + } + + GlobalShortcut { + name: "mediaControlsToggle" + description: "Toggles media controls on press" + + onPressed: { + GlobalStates.sidebarLeftOpen = !GlobalStates.sidebarLeftOpen; + } } } diff --git a/dots/.config/quickshell/ii/shell.qml b/dots/.config/quickshell/ii/shell.qml index 6f401c90f..3f57c0c28 100644 --- a/dots/.config/quickshell/ii/shell.qml +++ b/dots/.config/quickshell/ii/shell.qml @@ -94,7 +94,7 @@ ShellRoot { property list families: ["ii", "waffle"] property var panelFamilies: ({ "ii": ["iiBar", "iiBackground", "iiCheatsheet", "iiDock", "iiLock", "iiMediaControls", "iiNotificationPopup", "iiOnScreenDisplay", "iiOnScreenKeyboard", "iiOverlay", "iiOverview", "iiPolkit", "iiRegionSelector", "iiScreenCorners", "iiSessionScreen", "iiSidebarLeft", "iiSidebarRight", "iiVerticalBar", "iiWallpaperSelector"], - "waffle": ["wActionCenter", "wBar", "wBackground", "wNotificationCenter", "wOnScreenDisplay", "iiCheatsheet", "iiLock", "iiMediaControls", "iiNotificationPopup", "iiOnScreenKeyboard", "iiOverlay", "iiOverview", "iiPolkit", "iiRegionSelector", "iiSessionScreen", "iiWallpaperSelector"], + "waffle": ["wActionCenter", "wBar", "wBackground", "wNotificationCenter", "wOnScreenDisplay", "iiCheatsheet", "iiLock", "iiNotificationPopup", "iiOnScreenKeyboard", "iiOverlay", "iiOverview", "iiPolkit", "iiRegionSelector", "iiSessionScreen", "iiWallpaperSelector"], }) function cyclePanelFamily() { const currentIndex = families.indexOf(Config.options.panelFamily)