Dock and task manager are one module: titled window pills, pins, Super+1..9
CI / test (push) Failing after 30s
CI / test (push) Failing after 30s
The panel had a task list and, beside it, a dock showing the same running
apps again. They are now one module, the dock, in the task list's place:
- Pinned apps, then running ones; an app with windows is a pill with its
window's title (or name and window count) while there is room, an icon
when the panel is crowded ("Show window titles" in Dock settings).
- Its right-click menu has the task list's window commands (Minimize /
Restore, Maximize) for a single window, or the app's windows by title.
- It stretches like the task list did; new panels get it instead of
tasks. A saved panel's "tasks" becomes the dock (one dock, where the
task list was); pins are the dock's own setting, so they carry over.
- An empty dock shows a "+ Add apps" tile that opens the Applications
menu, where right-clicking an app offers Open and Pin to dock (adding a
dock to the panel if there is none).
- Super+1 .. Super+9 open the dock's first nine apps like a click
(shortcut "dock-apps", rebindable in Settings > Shortcuts).
- "New window" / "Open" only for apps the catalog can start.
The tasks component, lib/panel's pill geometry and the taskbar-widget
world are gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiPCFHRxaJQvwex6ry
This commit is contained in:
28 files changed
+801
-1131
No files matched your search
@@ -50,6 +50,10 @@ pub(all) enum ShortcutAction {
|
||||
RecordRegion
|
||||
RecordScreen
|
||||
RecordWindow
|
||||
/// The dock's apps by number: the combo opens the first, the same modifiers with 2 .. 9 the
|
||||
/// second to ninth (when the combo's key is 1). Like clicking the icon: start the app or bring
|
||||
/// its windows forward. See `Shortcuts::dock_app`.
|
||||
DockApps
|
||||
} derive(Eq, Debug)
|
||||
|
||||
///| One row of the shortcut table.
|
||||
@@ -77,6 +81,7 @@ pub let shortcut_table : Array[ShortcutDef] = [
|
||||
{ id: "record-region", label: "Record a region", action: RecordRegion, default_text: "Super+Shift+R" },
|
||||
{ id: "record-screen", label: "Record the screen", action: RecordScreen, default_text: "Super+Alt+R" },
|
||||
{ id: "record-window", label: "Record a window", action: RecordWindow, default_text: "Super+Ctrl+R" },
|
||||
{ id: "dock-apps", label: "Open dock app 1-9", action: DockApps, default_text: "Super+1" },
|
||||
]
|
||||
|
||||
///| evdev code -> key name, for the keys a combo can end in (US layout names).
|
||||
@@ -487,3 +492,42 @@ pub fn DesktopShell::publish_shortcuts(self : DesktopShell) -> Unit {
|
||||
}
|
||||
@wasm.publish(Shortcuts, t)
|
||||
}
|
||||
|
||||
///| evdev codes of the 1 and 9 keys (the row above the letters).
|
||||
let key_1 : UInt = 2
|
||||
|
||||
///|
|
||||
let key_9 : UInt = 10
|
||||
|
||||
///| Which of the dock's apps (1-9) `combo` opens: the "Open dock app" combo itself is the first,
|
||||
/// and when that combo ends in 1, the same modifiers with 2 .. 9 open the second to ninth.
|
||||
pub fn Shortcuts::dock_app(self : Shortcuts, combo : KeyCombo) -> Int? {
|
||||
let mods = combo.mods & combo_mods
|
||||
for i = 0; i < self.bindings.length(); i = i + 1 {
|
||||
if shortcut_table[i].action == DockApps {
|
||||
match self.bindings[i] {
|
||||
Some(c) if c.mods == mods => {
|
||||
if c.key == key_1 && combo.key >= key_1 && combo.key <= key_9 {
|
||||
return Some((combo.key - key_1).reinterpret_as_int() + 1)
|
||||
}
|
||||
if same_key(c.key, combo.key) {
|
||||
return Some(1)
|
||||
}
|
||||
}
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
///|
|
||||
test "Super+1 .. Super+9 open the dock's apps" {
|
||||
let sc = Shortcuts::defaults()
|
||||
assert_eq(sc.dock_app({ mods: mod_logo, key: 2 }), Some(1))
|
||||
assert_eq(sc.dock_app({ mods: mod_logo, key: 6 }), Some(5))
|
||||
assert_eq(sc.dock_app({ mods: mod_logo, key: 10 }), Some(9))
|
||||
assert_eq(sc.dock_app({ mods: mod_logo, key: 11 }), None) // 0
|
||||
assert_eq(sc.dock_app({ mods: mod_logo | mod_shift, key: 3 }), None)
|
||||
assert_eq(sc.dock_app({ mods: 0, key: 3 }), None)
|
||||
}
|
||||
Reference in new issue
Block a user