Library context menu opens at the pointer, not the picture floor
Browse files at this commitc01a6efe46a1b66b2d90b93198187574516da5aaParent: 0cf5087- fix
- library context menu opens at the pointer, not the picture floor
1 changed file +8 -9
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 has | 164 | + // 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. The | 165 | + // 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 climbing | 167 | + // 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() |