Launcher: a thumb scrolls the app list
On a touchscreen a drag over the launcher's list scrolls it by pixels, a flick keeps it going, and a tap still launches (or stops a moving list). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cb0ff0715e
commit
7029c92e6e
8 files changed
+313
-32
No files matched your search
@@ -850,6 +850,25 @@ pub fn DesktopShell::scroll_popup(self : DesktopShell, x : Int, y : Int, px : Do
|
||||
true
|
||||
}
|
||||
|
||||
///| Whether (x, y) is on the launcher's popup, whose list a finger scrolls.
|
||||
pub fn DesktopShell::launcher_list_at(self : DesktopShell, x : Int, y : Int) -> Bool {
|
||||
!(self.menu_open && inside(self.menu_rect, x, y)) &&
|
||||
(match self.popup_at(x, y) {
|
||||
Some(w) => w.module_id == launcher_module
|
||||
None => false
|
||||
})
|
||||
}
|
||||
|
||||
///| Scroll the open launcher's list by `px` pixels (+: down). False when it didn't move: at an
|
||||
/// end, or closed.
|
||||
pub fn DesktopShell::scroll_launcher(self : DesktopShell, px : Int) -> Bool {
|
||||
match self.open_popup_widget() {
|
||||
Some(w) if w.module_id == launcher_module =>
|
||||
self.deliver(w, true, KeyDown("ScrollPx:" + px.to_string()))
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
|
||||
///| Close the launcher's popup if it is open.
|
||||
pub fn DesktopShell::close_launcher(self : DesktopShell) -> Unit {
|
||||
for w in self.widgets {
|
||||
|
||||
Reference in new issue
Block a user