Context menus stay in view near the window edge; planes offer Create Sketch (#1398)
List menus open below-right of the cursor and flip to end at the cursor where they don't fit (shared context_menu::place / show for viewport, browser, toolbar and Select Other). Right-clicking a plane in the viewport, a construction plane row or an origin plane row (new menu with Create Sketch and Show/Hide) offers Create Sketch on that plane. Fixes #1354.
This commit is contained in:
1 parent
fb55c1341a
commit
29e72806f6
6 files changed
+177
-10
No files matched your search
@@ -508,8 +508,10 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {
|
||||
let mut hovered = None;
|
||||
let mut picked = None;
|
||||
let w = crate::context_menu::LIST_W - 10.0;
|
||||
// Title, rows up to the scroll height, margins and border.
|
||||
let size = vec2(w + 10.0, 30.0 + (p.rows.len() as f32 * 24.0).min(360.0));
|
||||
let resp = crate::frame::area(egui::Id::new("sc_select_other"))
|
||||
.fixed_pos(p.at + vec2(12.0, 12.0))
|
||||
.fixed_pos(crate::context_menu::place(p.at, vec2(12.0, 12.0), size, ctx.content_rect()))
|
||||
.constrain(true)
|
||||
.order(egui::Order::Foreground)
|
||||
.show(ctx, |ui| {
|
||||
|
||||
Reference in new issue
Block a user