forge
Explore
Log in

Don't you dare go Hollow

Library context menu opens at the pointer, not the picture floor

Browse files at this commit

c01a6efe46a1b66b2d90b93198187574516da5aaAhmet Kaan GümüşParent: 0cf5087
  • fix
    • library context menu opens at the pointer, not the picture floor
Show full message
🐛 fix(app): library context menu opens at the pointer, not the picture floor

The library row menu mounts on the root over the dock, where no picture
exists, but went through `menu_floor`'s picture-floor clamp anyway -- a
right-click high in the dock got teleported down near the bench. It now
sizes its rows against the full viewport and clamps only to window bounds
via `menu_at`, standard context-menu behavior; `menu_floor` stays for the
clip menu, which legitimately protects the picture behind it.
crates/app/src/ui/library.rsmodified+8 -9
@@ -1,6 +1,5 @@
1 //! The media library: the left panel's rows and the menu over them.1 //! The media library: the left panel's rows and the menu over them.
2 2
3-use crate::ui::stance::menu_floor;
4 use crate::ui::type_scale::Typeset;3 use crate::ui::type_scale::Typeset;
5 use crate::ui::widgets::*;4 use crate::ui::widgets::*;
6 use crate::*;5 use crate::*;
@@ -162,14 +161,14 @@ impl Player {
162 );161 );
163 }162 }
164 }163 }
165- // Placed by the height it is drawn to, and drawn to what the window has164+ // Placed at the pointer, clamped only to the window's own bounds --
166- // room for -- the clip menu's rule, one function for all three. The165+ // standard context-menu behavior. Unlike the clip menu, this menu
167- // floor clamp and the room the list sizes against are `menu_floor`'s,166+ // mounts on the root over the dock (no picture behind it to protect),
168- // so a menu taller than the footprint scrolls instead of climbing167+ // so it does not go through `menu_floor`'s picture-floor clamp; doing
169- // back over the picture.168+ // so pulled a right-click high in the dock down to the picture floor,
170- let (at, room) = menu_floor(menu.at, viewport, self.split_px(Split::Bench, viewport));169+ // teleporting the menu away from the pointer that opened it.
171- let list_h = menu_rows_h(rows.len(), room);170+ let list_h = menu_rows_h(rows.len(), viewport);
172- let (x, y) = menu_at(at, viewport, MENU_PAD * 2. + list_h);171+ let (x, y) = menu_at(menu.at, viewport, MENU_PAD * 2. + list_h);
173 let full: SharedString = path.display().to_string().into();172 let full: SharedString = path.display().to_string().into();
174 Some(173 Some(
175 scrim()174 scrim()