mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-25 05:52:50 -05:00
Merge branch 'master' of github.com:bbedward/DankMaterialShell
This commit is contained in:
@@ -1187,7 +1187,7 @@ Item {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
logoutDialog.close()
|
||||
NiriService.quit()
|
||||
CompositorService.logout()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,11 +378,28 @@ Item {
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "(Hyprland Soon™)"
|
||||
text: "&"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceVariantText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: `<a href="https://github.com/hyprwm/Hyprland" style="text-decoration:none; color:${Theme.primary};">hyprland</a>`
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
linkColor: Theme.primary
|
||||
textFormat: Text.RichText
|
||||
color: Theme.surfaceVariantText
|
||||
onLinkActivated: url => Qt.openUrlExternally(url)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
acceptedButtons: Qt.NoButton
|
||||
propagateComposedEvents: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
||||
@@ -24,35 +24,47 @@ Rectangle {
|
||||
}
|
||||
|
||||
function getDisplayWorkspaces() {
|
||||
if (!CompositorService.isNiri
|
||||
|| NiriService.allWorkspaces.length === 0)
|
||||
return [1, 2]
|
||||
if (CompositorService.isNiri) {
|
||||
if (NiriService.allWorkspaces.length === 0)
|
||||
return [1, 2]
|
||||
|
||||
if (!root.screenName)
|
||||
return NiriService.getCurrentOutputWorkspaceNumbers()
|
||||
if (!root.screenName)
|
||||
return NiriService.getCurrentOutputWorkspaceNumbers()
|
||||
|
||||
var displayWorkspaces = []
|
||||
for (var i = 0; i < NiriService.allWorkspaces.length; i++) {
|
||||
var ws = NiriService.allWorkspaces[i]
|
||||
if (ws.output === root.screenName)
|
||||
displayWorkspaces.push(ws.idx + 1)
|
||||
var displayWorkspaces = []
|
||||
for (var i = 0; i < NiriService.allWorkspaces.length; i++) {
|
||||
var ws = NiriService.allWorkspaces[i]
|
||||
if (ws.output === root.screenName)
|
||||
displayWorkspaces.push(ws.idx + 1)
|
||||
}
|
||||
return displayWorkspaces.length > 0 ? displayWorkspaces : [1, 2]
|
||||
} else if (CompositorService.isHyprland) {
|
||||
var workspaces = HyprlandService.getWorkspaceDisplayNumbers()
|
||||
return workspaces.length > 0 ? workspaces : [1]
|
||||
}
|
||||
return displayWorkspaces.length > 0 ? displayWorkspaces : [1, 2]
|
||||
|
||||
return [1, 2]
|
||||
}
|
||||
|
||||
function getDisplayActiveWorkspace() {
|
||||
if (!CompositorService.isNiri
|
||||
|| NiriService.allWorkspaces.length === 0)
|
||||
if (CompositorService.isNiri) {
|
||||
if (NiriService.allWorkspaces.length === 0)
|
||||
return 1
|
||||
|
||||
if (!root.screenName)
|
||||
return NiriService.getCurrentWorkspaceNumber()
|
||||
|
||||
for (var i = 0; i < NiriService.allWorkspaces.length; i++) {
|
||||
var ws = NiriService.allWorkspaces[i]
|
||||
if (ws.output === root.screenName && ws.is_active)
|
||||
return ws.idx + 1
|
||||
}
|
||||
return 1
|
||||
|
||||
if (!root.screenName)
|
||||
return NiriService.getCurrentWorkspaceNumber()
|
||||
|
||||
for (var i = 0; i < NiriService.allWorkspaces.length; i++) {
|
||||
var ws = NiriService.allWorkspaces[i]
|
||||
if (ws.output === root.screenName && ws.is_active)
|
||||
return ws.idx + 1
|
||||
} else if (CompositorService.isHyprland) {
|
||||
var activeWs = HyprlandService.getCurrentWorkspaceNumber()
|
||||
return activeWs
|
||||
}
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
@@ -68,7 +80,7 @@ Rectangle {
|
||||
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b,
|
||||
baseColor.a * Theme.widgetTransparency)
|
||||
}
|
||||
visible: CompositorService.isNiri
|
||||
visible: CompositorService.isNiri || CompositorService.isHyprland
|
||||
|
||||
Connections {
|
||||
function onAllWorkspacesChanged() {
|
||||
@@ -84,6 +96,28 @@ Rectangle {
|
||||
}
|
||||
|
||||
target: NiriService
|
||||
enabled: CompositorService.isNiri
|
||||
}
|
||||
|
||||
Connections {
|
||||
function onWorkspacesUpdated() {
|
||||
root.workspaceList
|
||||
= SettingsData.showWorkspacePadding ? root.padWorkspaces(
|
||||
root.getDisplayWorkspaces(
|
||||
)) : root.getDisplayWorkspaces()
|
||||
root.currentWorkspace = root.getDisplayActiveWorkspace()
|
||||
}
|
||||
|
||||
function onFocusedWorkspaceUpdated() {
|
||||
root.currentWorkspace = root.getDisplayActiveWorkspace()
|
||||
}
|
||||
|
||||
function onFocusedMonitorUpdated() {
|
||||
root.currentWorkspace = root.getDisplayActiveWorkspace()
|
||||
}
|
||||
|
||||
target: HyprlandService
|
||||
enabled: CompositorService.isHyprland
|
||||
}
|
||||
|
||||
|
||||
@@ -112,12 +146,22 @@ Rectangle {
|
||||
property bool isHovered: mouseArea.containsMouse
|
||||
property int sequentialNumber: index + 1
|
||||
property var workspaceData: {
|
||||
if (isPlaceholder || !CompositorService.isNiri)
|
||||
if (isPlaceholder)
|
||||
return null
|
||||
for (var i = 0; i < NiriService.allWorkspaces.length; i++) {
|
||||
var ws = NiriService.allWorkspaces[i]
|
||||
if (ws.idx + 1 === modelData)
|
||||
return ws
|
||||
|
||||
if (CompositorService.isNiri) {
|
||||
for (var i = 0; i < NiriService.allWorkspaces.length; i++) {
|
||||
var ws = NiriService.allWorkspaces[i]
|
||||
if (ws.idx + 1 === modelData)
|
||||
return ws
|
||||
}
|
||||
} else if (CompositorService.isHyprland) {
|
||||
var hyprWorkspaces = HyprlandService.getWorkspacesForMonitor(root.screenName)
|
||||
for (var j = 0; j < hyprWorkspaces.length; j++) {
|
||||
var hws = hyprWorkspaces[j]
|
||||
if (hws.id === modelData)
|
||||
return hws
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
@@ -140,8 +184,13 @@ Rectangle {
|
||||
cursorShape: isPlaceholder ? Qt.ArrowCursor : Qt.PointingHandCursor
|
||||
enabled: !isPlaceholder
|
||||
onClicked: {
|
||||
if (!isPlaceholder)
|
||||
NiriService.switchToWorkspace(modelData - 1)
|
||||
if (!isPlaceholder) {
|
||||
if (CompositorService.isNiri) {
|
||||
NiriService.switchToWorkspace(modelData - 1)
|
||||
} else if (CompositorService.isHyprland) {
|
||||
HyprlandService.switchToWorkspace(modelData)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user