mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 23:42:51 -05:00
feat: Added reverse workspace scrolling (#1179)
* added reverse scrolling to settings and widget * added support for dankbar scrolling * Better settings description * removed isNiri conditional from search index
This commit is contained in:
@@ -172,6 +172,7 @@ Singleton {
|
|||||||
property int maxWorkspaceIcons: 3
|
property int maxWorkspaceIcons: 3
|
||||||
property bool workspacesPerMonitor: true
|
property bool workspacesPerMonitor: true
|
||||||
property bool showOccupiedWorkspacesOnly: false
|
property bool showOccupiedWorkspacesOnly: false
|
||||||
|
property bool reverseScrolling: false
|
||||||
property bool dwlShowAllTags: false
|
property bool dwlShowAllTags: false
|
||||||
property var workspaceNameIcons: ({})
|
property var workspaceNameIcons: ({})
|
||||||
property bool waveProgressEnabled: true
|
property bool waveProgressEnabled: true
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ var SPEC = {
|
|||||||
maxWorkspaceIcons: { def: 3 },
|
maxWorkspaceIcons: { def: 3 },
|
||||||
workspacesPerMonitor: { def: true },
|
workspacesPerMonitor: { def: true },
|
||||||
showOccupiedWorkspacesOnly: { def: false },
|
showOccupiedWorkspacesOnly: { def: false },
|
||||||
|
reverseScrolling: { def: false },
|
||||||
dwlShowAllTags: { def: false },
|
dwlShowAllTags: { def: false },
|
||||||
workspaceNameIcons: { def: {} },
|
workspaceNameIcons: { def: {} },
|
||||||
waveProgressEnabled: { def: true },
|
waveProgressEnabled: { def: true },
|
||||||
|
|||||||
@@ -713,7 +713,7 @@ PanelWindow {
|
|||||||
|
|
||||||
if (CompositorService.isNiri && xBehavior !== "none" && Math.abs(deltaX) > Math.abs(deltaY)) {
|
if (CompositorService.isNiri && xBehavior !== "none" && Math.abs(deltaX) > Math.abs(deltaY)) {
|
||||||
const isMouseWheel = Math.abs(deltaX) >= 120 && (Math.abs(deltaX) % 120) === 0;
|
const isMouseWheel = Math.abs(deltaX) >= 120 && (Math.abs(deltaX) % 120) === 0;
|
||||||
const direction = deltaX < 0 ? 1 : -1;
|
const direction = deltaX * -SettingsData.reverseScrolling < 0 ? 1 : -1;
|
||||||
|
|
||||||
if (isMouseWheel) {
|
if (isMouseWheel) {
|
||||||
if (handleScrollAction(xBehavior, direction)) {
|
if (handleScrollAction(xBehavior, direction)) {
|
||||||
@@ -741,7 +741,7 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isMouseWheel = Math.abs(deltaY) >= 120 && (Math.abs(deltaY) % 120) === 0;
|
const isMouseWheel = Math.abs(deltaY) >= 120 && (Math.abs(deltaY) % 120) === 0;
|
||||||
const direction = deltaY < 0 ? 1 : -1;
|
const direction = deltaY * -SettingsData.reverseScrolling < 0 ? 1 : -1;
|
||||||
|
|
||||||
if (isMouseWheel) {
|
if (isMouseWheel) {
|
||||||
if (handleScrollAction(yBehavior, direction)) {
|
if (handleScrollAction(yBehavior, direction)) {
|
||||||
|
|||||||
@@ -675,7 +675,7 @@ Item {
|
|||||||
|
|
||||||
const delta = wheel.angleDelta.y;
|
const delta = wheel.angleDelta.y;
|
||||||
const isMouseWheel = Math.abs(delta) >= 120 && (Math.abs(delta) % 120) === 0;
|
const isMouseWheel = Math.abs(delta) >= 120 && (Math.abs(delta) % 120) === 0;
|
||||||
const direction = delta < 0 ? 1 : -1;
|
const direction = delta * -SettingsData.reverseScrolling < 0 ? 1 : -1;
|
||||||
|
|
||||||
if (isMouseWheel) {
|
if (isMouseWheel) {
|
||||||
root.switchWorkspace(direction);
|
root.switchWorkspace(direction);
|
||||||
|
|||||||
@@ -113,6 +113,16 @@ Item {
|
|||||||
onToggled: checked => SettingsData.set("showOccupiedWorkspacesOnly", checked)
|
onToggled: checked => SettingsData.set("showOccupiedWorkspacesOnly", checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
settingKey: "reverseScrolling"
|
||||||
|
tags: ["workspace", "scroll", "scrolling", "reverse", "direction"]
|
||||||
|
text: I18n.tr("Reverse Scrolling Direction")
|
||||||
|
description: I18n.tr("Reverse workspace switch direction when scrolling over the bar")
|
||||||
|
checked: SettingsData.reverseScrolling
|
||||||
|
visible: CompositorService.isNiri || CompositorService.isHyprland
|
||||||
|
onToggled: checked => SettingsData.set("reverseScrolling", checked)
|
||||||
|
}
|
||||||
|
|
||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
settingKey: "dwlShowAllTags"
|
settingKey: "dwlShowAllTags"
|
||||||
tags: ["dwl", "tags", "workspace"]
|
tags: ["dwl", "tags", "workspace"]
|
||||||
|
|||||||
@@ -793,6 +793,26 @@
|
|||||||
"description": "Display only workspaces that contain windows",
|
"description": "Display only workspaces that contain windows",
|
||||||
"conditionKey": "isNiri"
|
"conditionKey": "isNiri"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"section": "reverseScrolling",
|
||||||
|
"label": "Reverse Scrolling Direction",
|
||||||
|
"tabIndex": 4,
|
||||||
|
"category": "Workspaces",
|
||||||
|
"keywords": [
|
||||||
|
"active",
|
||||||
|
"contain",
|
||||||
|
"desktop",
|
||||||
|
"desktops",
|
||||||
|
"scroll",
|
||||||
|
"scrolling",
|
||||||
|
"reverse",
|
||||||
|
"direction",
|
||||||
|
"windows",
|
||||||
|
"workspace",
|
||||||
|
"workspaces"
|
||||||
|
],
|
||||||
|
"description": "Display only workspaces that contain windows"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"section": "showWorkspaceApps",
|
"section": "showWorkspaceApps",
|
||||||
"label": "Show Workspace Apps",
|
"label": "Show Workspace Apps",
|
||||||
|
|||||||
Reference in New Issue
Block a user