1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-13 06:33:30 -04:00

feat(keybinds): new mango overview workspace pill & keybind updates

This commit is contained in:
purian23
2026-06-04 23:23:03 -04:00
parent 713ce5f430
commit e0ab0a6b90
5 changed files with 65 additions and 1 deletions
@@ -945,6 +945,53 @@ Item {
spacing: Theme.spacingS
flow: isVertical ? Flow.TopToBottom : Flow.LeftToRight
// mango reports active_tags=0 while the overview is open; surface it as a pill
Item {
id: overviewPill
visible: CompositorService.isMango && MangoService.inOverview
width: root.isVertical ? root.widgetHeight : overviewBg.width
height: root.isVertical ? overviewBg.height : root.widgetHeight
readonly property real labelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
Rectangle {
id: overviewBg
anchors.centerIn: parent
width: root.isVertical ? Math.max(root.widgetHeight * 0.7, overviewContent.implicitWidth + Theme.spacingS) : (overviewContent.implicitWidth + Theme.spacingS * 2)
height: Math.max(root.widgetHeight * 0.5, overviewContent.implicitHeight + Theme.spacingXS)
radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.primary, 0.18)
Row {
id: overviewContent
anchors.centerIn: parent
spacing: Theme.spacingXS
DankIcon {
anchors.verticalCenter: parent.verticalCenter
name: "grid_view"
size: overviewPill.labelSize + 2
color: Theme.primary
}
StyledText {
anchors.verticalCenter: parent.verticalCenter
visible: !root.isVertical
text: I18n.tr("OVERVIEW")
color: Theme.primary
font.pixelSize: overviewPill.labelSize
font.weight: Font.DemiBold
}
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: Quickshell.execDetached(["mmsg", "dispatch", "toggleoverview"])
}
}
Repeater {
id: workspaceRepeater
model: ScriptModel {
+10
View File
@@ -33,6 +33,7 @@ Singleton {
// tags: [{ tag, state, clients, focused, urgent, layout }] }
property var outputs: ({})
property string activeOutput: ""
readonly property bool inOverview: isOutputInOverview(activeOutput)
property int tagCount: 9
property var displayScales: ({})
property string currentKeyboardLayout: ""
@@ -173,6 +174,15 @@ Singleton {
return output.tags.filter(tag => tag.state === 1).map(tag => tag.tag);
}
// mango reports active_tags=[0] (no real tag selected) while the overview is open.
function isOutputInOverview(outputName) {
const output = getOutputState(outputName);
if (!output)
return false;
const at = output.activeTags || [];
return at.length === 0 || at.every(t => t === 0);
}
function getTagsWithClients(outputName) {
const output = getOutputState(outputName);
if (!output || !output.tags)