Move Menu beside Project in the viewport toolbar

This commit is contained in:
Dandaedre 2026-11-14 16:45:53 +01:00
parent fd9b0c115c
commit 6167159bde
2 changed files with 17 additions and 18 deletions

View File

@ -2381,6 +2381,15 @@ impl Editor {
));
},
);
ui.scope_builder(
egui::UiBuilder::new()
.max_rect(button(15))
.layout(egui::Layout::left_to_right(egui::Align::Center)),
|ui| {
ui.spacing_mut().interact_size.y = 32.0;
toolbar_menu(ui, "Menu", |ui| self.application_menu(ui));
},
);
ui.scope_builder(
egui::UiBuilder::new()
.max_rect(button(0))
@ -3240,18 +3249,6 @@ impl Editor {
ink.text(24.0, 11.0, "MIDRA / LAYOUT", 18.0, palette.text);
ink.line([206.0, 13.0], [206.0, 31.0], palette.line);
ink.text(222.0, 15.0, "Layer positioning helper", 13.0, palette.muted);
ui.scope_builder(
egui::UiBuilder::new()
.max_rect(Rect::from_min_size(
ink.point(420.0, 7.0),
Vec2::new(80.0, 30.0),
))
.layout(egui::Layout::left_to_right(egui::Align::Center)),
|ui| {
ui.spacing_mut().interact_size.y = 30.0;
ui.menu_button("Menu", |ui| self.application_menu(ui));
},
);
ink.text(r.width() - 347.0, 15.0, "EIKOS 4K", 12.0, palette.cyan);
ink.button(r.width() - 212.0, 5.0, 188.0, "Copy coordinates", false);
if click(
@ -3486,14 +3483,14 @@ enum ToolbarIcon {
}
// Keep related tools together when wrapping; reserve caption space per group.
fn toolbar_groups(width: f32, captions: bool) -> ([Rect; 15], Vec<Rect>, f32) {
let mut buttons = [Rect::NOTHING; 15];
fn toolbar_groups(width: f32, captions: bool) -> ([Rect; 16], Vec<Rect>, f32) {
let mut buttons = [Rect::NOTHING; 16];
let mut groups = Vec::new();
let mut x = 24.0;
let mut y = 20.0;
let height = if captions { 58.0 } else { 36.0 };
for slots in [
&[0, 1][..],
&[15, 0, 1][..],
&[2, 3],
&[4, 5],
&[6, 7, 8, 9],
@ -3501,7 +3498,7 @@ fn toolbar_groups(width: f32, captions: bool) -> ([Rect; 15], Vec<Rect>, f32) {
&[13, 14],
] {
let cell_width = |slot| match slot {
0 => 68.0,
0 | 15 => 68.0,
11 => 56.0,
8 | 9 if captions => 80.0,
_ if captions => 56.0,
@ -3521,7 +3518,7 @@ fn toolbar_groups(width: f32, captions: bool) -> ([Rect; 15], Vec<Rect>, f32) {
for &slot in slots {
let cell = cell_width(slot);
let button_width = match slot {
0 => 64.0,
0 | 15 => 64.0,
11 => 52.0,
1 | 10 | 14 => 40.0,
_ => 32.0,
@ -4488,7 +4485,7 @@ mod tests {
assert!(buttons[..i].iter().all(|other| !other.intersects(*button)));
}
for slots in [
&[0, 1][..],
&[15, 0, 1][..],
&[2, 3],
&[4, 5],
&[6, 7, 8, 9],

View File

@ -4,6 +4,8 @@
## Unreleased
- Move Menu from the title header to the toolbar immediately before Project, within the same wrapping group.
- Place Load before Send in the status bar.
- Align status-bar connection, mapping, send/load and scope controls in one vertically centered row with consistent spacing and button heights; let labels determine positions instead of fixed offsets.