mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-30 00:12:50 -05:00
Re-add padding as option
This commit is contained in:
@@ -28,6 +28,7 @@ Singleton {
|
|||||||
property bool showSystemResources: true
|
property bool showSystemResources: true
|
||||||
property bool showSystemTray: true
|
property bool showSystemTray: true
|
||||||
property bool showWorkspaceIndex: false
|
property bool showWorkspaceIndex: false
|
||||||
|
property bool showWorkspacePadding: false
|
||||||
property string appLauncherViewMode: "list"
|
property string appLauncherViewMode: "list"
|
||||||
property string spotlightLauncherViewMode: "list"
|
property string spotlightLauncherViewMode: "list"
|
||||||
property string networkPreference: "auto"
|
property string networkPreference: "auto"
|
||||||
@@ -61,6 +62,7 @@ Singleton {
|
|||||||
showSystemResources = settings.showSystemResources !== undefined ? settings.showSystemResources : true;
|
showSystemResources = settings.showSystemResources !== undefined ? settings.showSystemResources : true;
|
||||||
showSystemTray = settings.showSystemTray !== undefined ? settings.showSystemTray : true;
|
showSystemTray = settings.showSystemTray !== undefined ? settings.showSystemTray : true;
|
||||||
showWorkspaceIndex = settings.showWorkspaceIndex !== undefined ? settings.showWorkspaceIndex : false;
|
showWorkspaceIndex = settings.showWorkspaceIndex !== undefined ? settings.showWorkspaceIndex : false;
|
||||||
|
showWorkspacePadding = settings.showWorkspacePadding !== undefined ? settings.showWorkspacePadding : false;
|
||||||
appLauncherViewMode = settings.appLauncherViewMode !== undefined ? settings.appLauncherViewMode : "list";
|
appLauncherViewMode = settings.appLauncherViewMode !== undefined ? settings.appLauncherViewMode : "list";
|
||||||
spotlightLauncherViewMode = settings.spotlightLauncherViewMode !== undefined ? settings.spotlightLauncherViewMode : "list";
|
spotlightLauncherViewMode = settings.spotlightLauncherViewMode !== undefined ? settings.spotlightLauncherViewMode : "list";
|
||||||
networkPreference = settings.networkPreference !== undefined ? settings.networkPreference : "auto";
|
networkPreference = settings.networkPreference !== undefined ? settings.networkPreference : "auto";
|
||||||
@@ -97,6 +99,7 @@ Singleton {
|
|||||||
"showSystemResources": showSystemResources,
|
"showSystemResources": showSystemResources,
|
||||||
"showSystemTray": showSystemTray,
|
"showSystemTray": showSystemTray,
|
||||||
"showWorkspaceIndex": showWorkspaceIndex,
|
"showWorkspaceIndex": showWorkspaceIndex,
|
||||||
|
"showWorkspacePadding": showWorkspacePadding,
|
||||||
"appLauncherViewMode": appLauncherViewMode,
|
"appLauncherViewMode": appLauncherViewMode,
|
||||||
"spotlightLauncherViewMode": spotlightLauncherViewMode,
|
"spotlightLauncherViewMode": spotlightLauncherViewMode,
|
||||||
"networkPreference": networkPreference,
|
"networkPreference": networkPreference,
|
||||||
@@ -109,6 +112,11 @@ Singleton {
|
|||||||
saveSettings();
|
saveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setShowWorkspacePadding(enabled) {
|
||||||
|
showWorkspacePadding = enabled;
|
||||||
|
saveSettings();
|
||||||
|
}
|
||||||
|
|
||||||
function applyStoredTheme() {
|
function applyStoredTheme() {
|
||||||
if (typeof Theme !== "undefined") {
|
if (typeof Theme !== "undefined") {
|
||||||
Theme.isLightMode = isLightMode;
|
Theme.isLightMode = isLightMode;
|
||||||
|
|||||||
@@ -18,7 +18,10 @@ PanelWindow {
|
|||||||
// App management
|
// App management
|
||||||
property var categories: AppSearchService.getAllCategories()
|
property var categories: AppSearchService.getAllCategories()
|
||||||
property string selectedCategory: "All"
|
property string selectedCategory: "All"
|
||||||
property var recentApps: Prefs.getRecentApps()
|
property var recentApps: Prefs.recentlyUsedApps.map(recentApp => {
|
||||||
|
var app = AppSearchService.getAppByExec(recentApp.exec);
|
||||||
|
return app && !app.noDisplay ? app : null;
|
||||||
|
}).filter(app => app !== null)
|
||||||
property var pinnedApps: ["firefox", "code", "terminal", "file-manager"]
|
property var pinnedApps: ["firefox", "code", "terminal", "file-manager"]
|
||||||
property bool showCategories: false
|
property bool showCategories: false
|
||||||
property string viewMode: Prefs.appLauncherViewMode // "list" or "grid"
|
property string viewMode: Prefs.appLauncherViewMode // "list" or "grid"
|
||||||
@@ -137,7 +140,6 @@ PanelWindow {
|
|||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
launcher.isVisible = true;
|
launcher.isVisible = true;
|
||||||
recentApps = Prefs.getRecentApps(); // Refresh recent apps
|
|
||||||
searchDebounceTimer.stop(); // Stop any pending search
|
searchDebounceTimer.stop(); // Stop any pending search
|
||||||
updateFilteredModel();
|
updateFilteredModel();
|
||||||
Qt.callLater(function() {
|
Qt.callLater(function() {
|
||||||
@@ -173,7 +175,6 @@ PanelWindow {
|
|||||||
return cat !== "All";
|
return cat !== "All";
|
||||||
}));
|
}));
|
||||||
updateFilteredModel();
|
updateFilteredModel();
|
||||||
recentApps = Prefs.getRecentApps(); // Load recent apps on startup
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Full screen overlay setup for proper focus
|
// Full screen overlay setup for proper focus
|
||||||
@@ -221,13 +222,6 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onRecentlyUsedAppsChanged() {
|
|
||||||
recentApps = Prefs.getRecentApps();
|
|
||||||
}
|
|
||||||
|
|
||||||
target: Prefs
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: iconComponent
|
id: iconComponent
|
||||||
|
|||||||
@@ -624,6 +624,20 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Workspace Settings
|
||||||
|
SettingsSection {
|
||||||
|
title: "Workspaces"
|
||||||
|
iconName: "tab"
|
||||||
|
|
||||||
|
content: Column {
|
||||||
|
width: parent.width
|
||||||
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
SettingsToggle {
|
SettingsToggle {
|
||||||
text: "Workspace Index Numbers"
|
text: "Workspace Index Numbers"
|
||||||
description: "Show workspace index numbers in the top bar workspace switcher"
|
description: "Show workspace index numbers in the top bar workspace switcher"
|
||||||
@@ -633,6 +647,15 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsToggle {
|
||||||
|
text: "Workspace Padding"
|
||||||
|
description: "Always show a minimum of 3 workspaces, even if fewer are available"
|
||||||
|
checked: Prefs.showWorkspacePadding
|
||||||
|
onToggled: (checked) => {
|
||||||
|
return Prefs.setShowWorkspacePadding(checked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,18 @@ Rectangle {
|
|||||||
|
|
||||||
property string screenName: ""
|
property string screenName: ""
|
||||||
property int currentWorkspace: getDisplayActiveWorkspace()
|
property int currentWorkspace: getDisplayActiveWorkspace()
|
||||||
property var workspaceList: getDisplayWorkspaces()
|
property var workspaceList: {
|
||||||
|
var baseList = getDisplayWorkspaces();
|
||||||
|
return Prefs.showWorkspacePadding ? padWorkspaces(baseList) : baseList;
|
||||||
|
}
|
||||||
|
|
||||||
|
function padWorkspaces(list) {
|
||||||
|
var padded = list.slice();
|
||||||
|
while (padded.length < 3) {
|
||||||
|
padded.push(-1); // Use -1 as a placeholder
|
||||||
|
}
|
||||||
|
return padded;
|
||||||
|
}
|
||||||
|
|
||||||
function getDisplayWorkspaces() {
|
function getDisplayWorkspaces() {
|
||||||
if (!NiriWorkspaceService.niriAvailable || NiriWorkspaceService.allWorkspaces.length === 0)
|
if (!NiriWorkspaceService.niriAvailable || NiriWorkspaceService.allWorkspaces.length === 0)
|
||||||
@@ -44,7 +55,7 @@ Rectangle {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
width: workspaceRow.implicitWidth + Theme.spacingL * 2
|
width: Prefs.showWorkspacePadding ? Math.max(120, workspaceRow.implicitWidth + Theme.spacingL * 2) : workspaceRow.implicitWidth + Theme.spacingL * 2
|
||||||
height: 30
|
height: 30
|
||||||
radius: Theme.cornerRadiusLarge
|
radius: Theme.cornerRadiusLarge
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.08)
|
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.08)
|
||||||
@@ -52,7 +63,7 @@ Rectangle {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
function onAllWorkspacesChanged() {
|
function onAllWorkspacesChanged() {
|
||||||
root.workspaceList = root.getDisplayWorkspaces();
|
root.workspaceList = Prefs.showWorkspacePadding ? root.padWorkspaces(root.getDisplayWorkspaces()) : root.getDisplayWorkspaces();
|
||||||
root.currentWorkspace = root.getDisplayActiveWorkspace();
|
root.currentWorkspace = root.getDisplayActiveWorkspace();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +73,7 @@ Rectangle {
|
|||||||
|
|
||||||
function onNiriAvailableChanged() {
|
function onNiriAvailableChanged() {
|
||||||
if (NiriWorkspaceService.niriAvailable) {
|
if (NiriWorkspaceService.niriAvailable) {
|
||||||
root.workspaceList = root.getDisplayWorkspaces();
|
root.workspaceList = Prefs.showWorkspacePadding ? root.padWorkspaces(root.getDisplayWorkspaces()) : root.getDisplayWorkspaces();
|
||||||
root.currentWorkspace = root.getDisplayActiveWorkspace();
|
root.currentWorkspace = root.getDisplayActiveWorkspace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,6 +81,18 @@ Rectangle {
|
|||||||
target: NiriWorkspaceService
|
target: NiriWorkspaceService
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Force update when padding preference changes
|
||||||
|
Connections {
|
||||||
|
function onShowWorkspacePaddingChanged() {
|
||||||
|
// Force re-evaluation by updating the property
|
||||||
|
var baseList = root.getDisplayWorkspaces();
|
||||||
|
root.workspaceList = Prefs.showWorkspacePadding ? root.padWorkspaces(baseList) : baseList;
|
||||||
|
}
|
||||||
|
|
||||||
|
target: Prefs
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: workspaceRow
|
id: workspaceRow
|
||||||
|
|
||||||
@@ -88,13 +111,13 @@ Rectangle {
|
|||||||
width: isActive ? Theme.spacingXL + Theme.spacingM : Theme.spacingL + Theme.spacingXS
|
width: isActive ? Theme.spacingXL + Theme.spacingM : Theme.spacingL + Theme.spacingXS
|
||||||
height: Theme.spacingL
|
height: Theme.spacingL
|
||||||
radius: height / 2
|
radius: height / 2
|
||||||
color: isActive ? Theme.primary : isPlaceholder ? Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.12) : 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)
|
color: isActive ? Theme.primary : isPlaceholder ? Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.06) : 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)
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: mouseArea
|
id: mouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: !isPlaceholder
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: isPlaceholder ? Qt.ArrowCursor : Qt.PointingHandCursor
|
||||||
enabled: !isPlaceholder
|
enabled: !isPlaceholder
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (!isPlaceholder) {
|
if (!isPlaceholder) {
|
||||||
@@ -113,15 +136,6 @@ Rectangle {
|
|||||||
font.bold: isActive && !isPlaceholder
|
font.bold: isActive && !isPlaceholder
|
||||||
}
|
}
|
||||||
|
|
||||||
// If not showing index, show a subtle dot for placeholders
|
|
||||||
Rectangle {
|
|
||||||
visible: isPlaceholder && !Prefs.showWorkspaceIndex
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: Theme.spacingXS
|
|
||||||
height: Theme.spacingXS
|
|
||||||
radius: Theme.spacingXS / 2
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.18)
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on width {
|
Behavior on width {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
|
|||||||
Reference in New Issue
Block a user