added counts
This commit is contained in:
1 parent
e01cb293ea
commit
ad28d4171c
3 files changed
+17
-2
No files matched your search
@@ -61,7 +61,8 @@ overview/
|
||||
│ # owns selection state, key handling, and HyprlandFocusGrab
|
||||
├── MonitorBar.qml # mini-map of clickable per-monitor pills, positioned AND sized
|
||||
│ # proportionally to each monitor's real x/y/resolution (like a
|
||||
│ # display-arrangement UI); highlights browsedMonitor
|
||||
│ # display-arrangement UI); highlights browsedMonitor; each pill
|
||||
│ # shows that monitor's "workspaces/windows" count
|
||||
├── WorkspaceRow.qml # one workspace = carousel Row of WindowCards + label
|
||||
├── WindowCard.qml # live ScreencopyView preview + icon/title footer + selection ring
|
||||
└── Theme.qml # plain QtObject with colors/sizes/carousel tuning, instantiated
|
||||
|
||||
@@ -8,6 +8,7 @@ Item {
|
||||
|
||||
required property var theme
|
||||
required property var monitors
|
||||
required property var monitorStats
|
||||
required property string focusedMonitorName
|
||||
|
||||
signal monitorClicked(int index)
|
||||
@@ -67,7 +68,11 @@ Item {
|
||||
width: parent.width - 4
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
elide: Text.ElideRight
|
||||
text: (pill.index + 1) + ": " + pill.modelData.name
|
||||
text: {
|
||||
const s = root.monitorStats[pill.index];
|
||||
return (pill.index + 1) + ": " + pill.modelData.name
|
||||
+ (s ? " " + s.workspaces + "/" + s.windows : "");
|
||||
}
|
||||
color: root.theme.textColor
|
||||
font.pixelSize: Math.max(9, Math.min(11, pill.height * 0.3))
|
||||
font.bold: pill.active
|
||||
|
||||
@@ -115,6 +115,14 @@ PanelWindow {
|
||||
|
||||
readonly property var sortedMonitors: Hyprland.monitors ? Hyprland.monitors.values.slice().sort((a, b) => a.id - b.id) : []
|
||||
|
||||
// Per-monitor {workspaces, windows} totals for the monitor bar pills.
|
||||
readonly property var monitorStats: root.sortedMonitors.map(mon => {
|
||||
const workspaces = Hyprland.workspaces ? Hyprland.workspaces.values
|
||||
.filter(ws => ws && ws.id > 0 && ws.monitor && ws.monitor.name === mon.name) : [];
|
||||
const windows = workspaces.reduce((n, ws) => n + (ws.toplevels ? ws.toplevels.values.length : 0), 0);
|
||||
return { workspaces: workspaces.length, windows: windows };
|
||||
})
|
||||
|
||||
// Jump straight to the Nth monitor's overview (0-based), bound to number
|
||||
// keys 1-9 and the monitor bar.
|
||||
function focusMonitorByIndex(i) {
|
||||
@@ -233,6 +241,7 @@ PanelWindow {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
theme: root.theme
|
||||
monitors: root.sortedMonitors
|
||||
monitorStats: root.monitorStats
|
||||
focusedMonitorName: root.browsedMonitor
|
||||
onMonitorClicked: index => root.focusMonitorByIndex(index)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user