waffles: map media controls bind to action center

This commit is contained in:
end-4
2025-11-26 19:40:19 +01:00
parent b4920a7cb6
commit 9ba8723a5d
4 changed files with 26 additions and 14 deletions
@@ -228,11 +228,6 @@ Rectangle {
component TabSwitchAnim: SequentialAnimation { component TabSwitchAnim: SequentialAnimation {
id: switchAnim id: switchAnim
property bool down: false property bool down: false
// ScriptAction {
// script: {
// switchAnim.down = root.selectedTab > root.previousIndex;
// }
// }
ParallelAnimation { ParallelAnimation {
PropertyAnimation { PropertyAnimation {
target: tabStack target: tabStack
@@ -74,7 +74,7 @@ function getCalendarLayout(dateObject, highlight) {
// Fill // Fill
var monthDiff = (weekdayOfMonthFirst == 0 ? 0 : -1); var monthDiff = (weekdayOfMonthFirst == 0 ? 0 : -1);
var toFill, dim; var toFill, dim;
if(weekdayOfMonthFirst == 0) { if (weekdayOfMonthFirst == 0) {
toFill = 1; toFill = 1;
dim = daysInMonth; dim = daysInMonth;
} }
@@ -88,8 +88,7 @@ function getCalendarLayout(dateObject, highlight) {
calendar[i][j] = { calendar[i][j] = {
"day": toFill, "day": toFill,
"today": ((toFill == day && monthDiff == 0 && highlight) ? 1 : ( "today": ((toFill == day && monthDiff == 0 && highlight) ? 1 : (
monthDiff == 0 ? 0 : monthDiff == 0 ? 0 : -1
-1
)) ))
}; };
// Increment // Increment
@@ -112,4 +111,3 @@ function getCalendarLayout(dateObject, highlight) {
} }
return calendar; return calendar;
} }
@@ -15,7 +15,8 @@ Scope {
target: GlobalStates target: GlobalStates
function onSidebarLeftOpenChanged() { function onSidebarLeftOpenChanged() {
if (GlobalStates.sidebarLeftOpen) panelLoader.active = true; if (GlobalStates.sidebarLeftOpen)
panelLoader.active = true;
} }
} }
@@ -42,13 +43,14 @@ Scope {
id: focusGrab id: focusGrab
active: true active: true
windows: [panelWindow] windows: [panelWindow]
onCleared: content.close(); onCleared: content.close()
} }
Connections { Connections {
target: GlobalStates target: GlobalStates
function onSidebarLeftOpenChanged() { function onSidebarLeftOpenChanged() {
if (!GlobalStates.sidebarLeftOpen) content.close(); if (!GlobalStates.sidebarLeftOpen)
content.close();
} }
} }
@@ -80,6 +82,23 @@ Scope {
name: "sidebarLeftToggle" name: "sidebarLeftToggle"
description: "Toggles left sidebar on press" 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;
}
} }
} }
+1 -1
View File
@@ -94,7 +94,7 @@ ShellRoot {
property list<string> families: ["ii", "waffle"] property list<string> families: ["ii", "waffle"]
property var panelFamilies: ({ property var panelFamilies: ({
"ii": ["iiBar", "iiBackground", "iiCheatsheet", "iiDock", "iiLock", "iiMediaControls", "iiNotificationPopup", "iiOnScreenDisplay", "iiOnScreenKeyboard", "iiOverlay", "iiOverview", "iiPolkit", "iiRegionSelector", "iiScreenCorners", "iiSessionScreen", "iiSidebarLeft", "iiSidebarRight", "iiVerticalBar", "iiWallpaperSelector"], "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() { function cyclePanelFamily() {
const currentIndex = families.indexOf(Config.options.panelFamily) const currentIndex = families.indexOf(Config.options.panelFamily)