Bind SUPER + CTRL + a number to the bar's right panels (#6702)

The letters name a panel; the numbers count them. One is the leftmost
panel in the right section, so the number matches the icon a user would
point at: a widget with no panel of its own is passed over, and so is one
that is hiding itself.

Counting rather than naming means the hotkeys follow the bar. Rearranging
the section, or adding a widget to it, renumbers the panels with no
binding to rewrite.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier HanssonandClaude Opus 5 authored and GitHub committed 2026-08-11 13:03:20 +02:00
1 parent efe805387e
commit 5edc3497fa
5 files changed
+72

No files matched your search

+15
View File
@@ -417,6 +417,21 @@ Item {
return slots
}
// The Nth panel in a bar region, counted the way the bar reads: layout order,
// and only the panels actually on screen. A widget with no panel (the tray)
// and one that is hiding itself are passed over, so the number lands on the
// Nth panel icon the user can see rather than the Nth layout entry.
// One-based, because it exists for hotkeys; anything else lands on no slot.
//
// Counting any bar surface is enough: every monitor lays its bar out from the
// one layout, and summoning the id routes through pickPanelSlot, which opens
// the focused monitor's copy whichever surface was counted.
function panelWidgetIdAt(region, index) {
var slots = panelNavigationSlots(String(region || ""), null)
var slot = slots[Math.round(Number(index)) - 1]
return slot ? String(slot.moduleName || "") : ""
}
function switchPanelFrom(owner, direction) {
if (!owner) return false