mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-07 05:55:37 -05:00
Added number indexing option for the workspace switcher
This commit is contained in:
@@ -31,6 +31,8 @@ Singleton {
|
||||
property bool showClipboard: true
|
||||
property bool showSystemResources: true
|
||||
property bool showSystemTray: true
|
||||
// WorkspaceSwitcher index toggle
|
||||
property bool showWorkspaceIndex: true
|
||||
// View mode preferences for launchers
|
||||
property string appLauncherViewMode: "list"
|
||||
property string spotlightLauncherViewMode: "list"
|
||||
@@ -62,6 +64,7 @@ Singleton {
|
||||
showClipboard = settings.showClipboard !== undefined ? settings.showClipboard : true;
|
||||
showSystemResources = settings.showSystemResources !== undefined ? settings.showSystemResources : true;
|
||||
showSystemTray = settings.showSystemTray !== undefined ? settings.showSystemTray : true;
|
||||
showWorkspaceIndex = settings.showWorkspaceIndex !== undefined ? settings.showWorkspaceIndex : true;
|
||||
appLauncherViewMode = settings.appLauncherViewMode !== undefined ? settings.appLauncherViewMode : "list";
|
||||
spotlightLauncherViewMode = settings.spotlightLauncherViewMode !== undefined ? settings.spotlightLauncherViewMode : "list";
|
||||
networkPreference = settings.networkPreference !== undefined ? settings.networkPreference : "auto";
|
||||
@@ -96,6 +99,7 @@ Singleton {
|
||||
"showClipboard": showClipboard,
|
||||
"showSystemResources": showSystemResources,
|
||||
"showSystemTray": showSystemTray,
|
||||
"showWorkspaceIndex": showWorkspaceIndex,
|
||||
"appLauncherViewMode": appLauncherViewMode,
|
||||
"spotlightLauncherViewMode": spotlightLauncherViewMode,
|
||||
"networkPreference": networkPreference
|
||||
@@ -103,6 +107,12 @@ Singleton {
|
||||
console.log("Saving settings - themeIndex:", themeIndex, "isDynamic:", themeIsDynamic, "lightMode:", isLightMode, "transparency:", topBarTransparency, "recentApps:", recentlyUsedApps.length);
|
||||
}
|
||||
|
||||
function setShowWorkspaceIndex(enabled) {
|
||||
console.log("Prefs setShowWorkspaceIndex called - showWorkspaceIndex:", enabled);
|
||||
showWorkspaceIndex = enabled;
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
function applyStoredTheme() {
|
||||
console.log("Applying stored theme:", themeIndex, themeIsDynamic, "lightMode:", isLightMode);
|
||||
if (typeof Theme !== "undefined") {
|
||||
|
||||
@@ -489,6 +489,15 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
|
||||
SettingsToggle {
|
||||
text: "Workspace Index Numbers"
|
||||
description: "Show workspace index numbers in the top bar workspace switcher"
|
||||
checked: Prefs.showWorkspaceIndex
|
||||
onToggled: (checked) => {
|
||||
return Prefs.setShowWorkspaceIndex(checked);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ Rectangle {
|
||||
property int sequentialNumber: index + 1
|
||||
|
||||
width: isActive ? Theme.spacingXL + Theme.spacingM : Theme.spacingL + Theme.spacingXS
|
||||
height: Theme.spacingM
|
||||
height: Theme.spacingL
|
||||
radius: height / 2
|
||||
color: isActive ? Theme.primary : isHovered ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.5) : Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.3)
|
||||
|
||||
@@ -99,6 +99,16 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
// Only show index if enabled in preferences
|
||||
Text {
|
||||
visible: Prefs.showWorkspaceIndex
|
||||
anchors.centerIn: parent
|
||||
text: sequentialNumber
|
||||
color: Theme.surfaceText
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.bold: isActive
|
||||
}
|
||||
|
||||
Behavior on width {
|
||||
NumberAnimation {
|
||||
duration: Theme.mediumDuration
|
||||
|
||||
Reference in New Issue
Block a user