mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 07:52:50 -05:00
workspaces: remove arbitrary padding and minimum width
This commit is contained in:
@@ -9,15 +9,7 @@ Rectangle {
|
|||||||
|
|
||||||
property string screenName: ""
|
property string screenName: ""
|
||||||
property int currentWorkspace: getDisplayActiveWorkspace()
|
property int currentWorkspace: getDisplayActiveWorkspace()
|
||||||
property var workspaceList: padWorkspaces(getDisplayWorkspaces())
|
property var workspaceList: getDisplayWorkspaces()
|
||||||
|
|
||||||
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)
|
||||||
@@ -52,7 +44,7 @@ Rectangle {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
width: Math.max(120, workspaceRow.implicitWidth + Theme.spacingL * 2)
|
width: 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)
|
||||||
@@ -60,7 +52,7 @@ Rectangle {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
function onAllWorkspacesChanged() {
|
function onAllWorkspacesChanged() {
|
||||||
root.workspaceList = padWorkspaces(root.getDisplayWorkspaces());
|
root.workspaceList = root.getDisplayWorkspaces();
|
||||||
root.currentWorkspace = root.getDisplayActiveWorkspace();
|
root.currentWorkspace = root.getDisplayActiveWorkspace();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +62,7 @@ Rectangle {
|
|||||||
|
|
||||||
function onNiriAvailableChanged() {
|
function onNiriAvailableChanged() {
|
||||||
if (NiriWorkspaceService.niriAvailable) {
|
if (NiriWorkspaceService.niriAvailable) {
|
||||||
root.workspaceList = padWorkspaces(root.getDisplayWorkspaces());
|
root.workspaceList = root.getDisplayWorkspaces();
|
||||||
root.currentWorkspace = root.getDisplayActiveWorkspace();
|
root.currentWorkspace = root.getDisplayActiveWorkspace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user