With window titles on, a pinned app that was running drew as a pill in its pin slot, so idle pinned icons ended up between pills. Now the dock shows the pinned apps that aren't running first, then every task: running pinned apps in pin order, then the other running apps. The divider sits between the two groups. Squeezing the pills to icons keeps the order; with titles off the plain pinned order stays. Move left / right in the menu follow the pin list, not the shown position. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hiPCFHRxaJQvwex6ry
This commit is contained in:
5 files changed
+72
-26
No files matched your search
@@ -113,21 +113,25 @@ test "the dock is the panel's task manager: empty + opens Applications, pin from
|
||||
}
|
||||
f
|
||||
}
|
||||
super_key(comp, 3U, 40U) // Super+2
|
||||
// Vim isn't running, so its icon comes first, then the tasks: Writer, Calc (pin order).
|
||||
assert_eq(comp.shell.dock_item_ids(), ["vim", "libreoffice-writer", "libreoffice-calc"])
|
||||
super_key(comp, 4U, 40U) // Super+3
|
||||
assert_eq(focused(), "Budget.ods")
|
||||
super_key(comp, 2U, 50U) // Super+1: Writer's newest window, then its other one
|
||||
super_key(comp, 3U, 50U) // Super+2: Writer's newest window, then its other one
|
||||
assert_eq(focused(), "Notes.odt")
|
||||
super_key(comp, 2U, 60U)
|
||||
super_key(comp, 3U, 60U)
|
||||
assert_eq(focused(), "Report.odt")
|
||||
// Writer's menu lists its two windows by title; picking one brings it forward.
|
||||
let r = comp.shell.slot_rect(slot)
|
||||
click_at(comp, r.x + 6 + 12, r.y + r.h / 2, 70U, btn=273U)
|
||||
let writer_x = r.x + 6 + 24 + 6 + 11 + 20 // after Vim's icon and the divider
|
||||
click_at(comp, writer_x, r.y + r.h / 2, 70U, btn=273U)
|
||||
assert_eq(comp.shell.menu_title, "LibreOffice Writer")
|
||||
let labels = comp.shell.menu_rows.map(r => r.label)
|
||||
assert_true(labels.contains("Report.odt") && labels.contains("Notes.odt"))
|
||||
ignore(@sys.write_file_bytes("_build/dock_bar_menu.png", @renderer.encode_png(comp.compose_frame())))
|
||||
dock_pick(comp, "Notes.odt", 80U)
|
||||
ignore(comp.compose_frame())
|
||||
assert_eq(focused(), "Notes.odt")
|
||||
comp.handle_input(@nested.InputEvent::PointerMove((r.x + 6 + 30 + 12).to_double(), (r.y + r.h / 2).to_double()), 90U)
|
||||
comp.handle_input(@nested.InputEvent::PointerMove((r.x + 6 + 12).to_double(), (r.y + r.h / 2).to_double()), 90U)
|
||||
ignore(@sys.write_file_bytes("_build/dock_bar.png", @renderer.encode_png(comp.compose_frame())))
|
||||
}
|
||||
@@ -184,11 +184,13 @@ fn DesktopShell::open_dock_menu(
|
||||
}
|
||||
if it.pinned {
|
||||
rows.push(dock_row("Unpin from dock", 8, it.id))
|
||||
let pinned = items.filter(x => x.pinned).length()
|
||||
if i > 0 {
|
||||
// Its place among the pins (the dock may show running pins after the idle ones).
|
||||
let pins = dock_config(w).pins(self.apps)
|
||||
let at = pins.search(it.id).unwrap_or(i)
|
||||
if at > 0 {
|
||||
rows.push(dock_row("Move left", 9, it.id, value="-1"))
|
||||
}
|
||||
if i < pinned - 1 {
|
||||
if at < pins.length() - 1 {
|
||||
rows.push(dock_row("Move right", 9, it.id, value="1"))
|
||||
}
|
||||
} else {
|
||||
@@ -467,3 +469,11 @@ fn DesktopShell::dock_click(self : DesktopShell, w : Widget) -> Bool {
|
||||
self.toggle_launcher()
|
||||
true
|
||||
}
|
||||
|
||||
///| The app ids of the first dock's items, in the order it shows them.
|
||||
pub fn DesktopShell::dock_item_ids(self : DesktopShell) -> Array[String] {
|
||||
match self.dock_widget() {
|
||||
Some(w) => self.dock_state(w).1.map(it => it.id)
|
||||
None => []
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user