Interface Explorer: compact dialog (14 rows) with mouse-wheel scrolling and scrollbar
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7a37039673
commit
5b32cf9808
4 files changed
+441
-2
No files matched your search
@@ -467,6 +467,20 @@ pub fn MoonPlasmaCompositor::handle_input(
|
||||
self.ptr_y = y
|
||||
let xi = x.to_int()
|
||||
let yi = y.to_int()
|
||||
if self.shell.inspecting() {
|
||||
self.leave_pointer()
|
||||
let id = match self.shell.component_at(xi, yi) {
|
||||
"" =>
|
||||
match self.window_at(xi, yi) {
|
||||
Some((_, true)) => "window-surface"
|
||||
Some((_, false)) => "window-decoration"
|
||||
None => "desktop"
|
||||
}
|
||||
sid => sid
|
||||
}
|
||||
self.shell.set_hover(id, xi, yi)
|
||||
return
|
||||
}
|
||||
if self.shell.pointer_move(xi, yi) || self.shell.hit(xi, yi) {
|
||||
self.leave_pointer()
|
||||
return
|
||||
@@ -500,6 +514,11 @@ pub fn MoonPlasmaCompositor::handle_input(
|
||||
_ => self.leave_pointer()
|
||||
}
|
||||
}
|
||||
Scroll(v) => {
|
||||
// ~10 units per wheel notch -> 3 lines.
|
||||
let lines = if v > 0.0 { (v / 10.0).to_int() + 1 } else { (v / 10.0).to_int() - 1 }
|
||||
ignore(self.shell.scroll_inspector(lines))
|
||||
}
|
||||
PointerButton(button, pressed) => {
|
||||
let xi = self.ptr_x.to_int()
|
||||
let yi = self.ptr_y.to_int()
|
||||
@@ -542,7 +561,12 @@ pub fn MoonPlasmaCompositor::handle_input(
|
||||
}
|
||||
}
|
||||
Key(code, pressed) =>
|
||||
if self.shell.popup_open() {
|
||||
if self.shell.inspecting() {
|
||||
// Escape leaves inspect mode; other keys are not forwarded while inspecting.
|
||||
if code == 1U && pressed {
|
||||
self.shell.set_inspecting(false)
|
||||
}
|
||||
} else if self.shell.popup_open() {
|
||||
if pressed {
|
||||
let name = key_name(code, (self.mods & 1U) != 0U)
|
||||
if name.length() > 0 {
|
||||
|
||||
Reference in new issue
Block a user