Repository navigation
feat(ui): submenus open at least 100 px wide, their rows as tall as the menu's (#2398) - #2400
jgregoriorincon wants to merge 1 commit into
Conversation
…he menu's (opengeos#2398) A submenu of one-word rows (New Layout > Publication Layout > a page size's styles) opened as a narrow strip. Submenus now open at least SUBMENU_MIN_W (100) wide, half a ribbon menu's MENU_MIN_W (200). widgets::submenu opens one from a menu of plain buttons; submenu_row, from a menu of menu_item rows, so the row is as tall as the rows beside it (the report's Report Section and Data menus now use it).
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
| menu_item(ui, app, "new_layout", "New Template (a layout page)", "report.newTemplate", Value::Null); | ||
| let layouts: Vec<String> = app.session.project.layouts.iter().map(|l| l.name.clone()).collect(); | ||
| ui.menu_button(tl!("Existing Template"), |ui| { | ||
| submenu_row(ui, "", tl!("Existing Template"), |ui| { |
There was a problem hiding this comment.
Possible unannounced interaction change (confidence: moderate, not verified by running the UI). This line, and the other report-menu calls converted to submenu_row (Related Report, Subreport, Field, Statistics, and the nested field submenus), switch from ui.menu_button to egui's SubMenuButton. As I understand egui, menu_button opens its popup on click, while SubMenuButton opens on hover. If that holds, these report menus change from click-to-open to hover-to-open. The PR description only mentions the row height for these menus. Please confirm the hover behaviour is intended, and say so in the PR, or keep these calls as submenu-style plain menus if click is wanted.
Code reviewI read the full diff (three files in Bugs
Security
Performance
Quality
AGENTS.md
Inline comment posted
Change sizeCompared: the whole PR against main (merge base 7e9718e to PR head 9f5c7be).
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. |
A submenu whose rows are single words opened as a narrow strip beside its wider parent, e.g. Home › New Layout ▸ Publication Layout ▸ Letter (216 × 279 mm), whose styles (Classic, Banner, Panel…) opened 66 pt wide.
SUBMENU_MIN_W(100 pt) wide, half a ribbon menu'sMENU_MIN_W(200 pt, now a named constant instead of five literals). Submenus whose rows are longer are unchanged.widgets.rs, one per kind of menu, so the row that opens a submenu is as tall as the rows beside it:widgets::submenu(new) for menus of plain buttons: Publication Layout and its page sizes, Primary Symbology, the RGB band menus, and the layer and tile context menus (Group, Extrusion, Extrusion Base, Blend, Draw as). Row heights are unchanged there.widgets::submenu_row(existing) for menus ofmenu_itemrows. The report's Report Section (Existing Template, Related Report, Subreport) and Data (Field, Statistics…) menus now use it, so those rows are as tall as theirmenu_itemneighbours. Before, they were shorter.The change is in
ui-egui, so it reaches the desktop and the browser. The command line, Python and the Assistant have no menus to change.Testing
checks.sh:cargo fmt --check,cargo clippy -p rustgis-ui-egui --all-targets -D warnings,cargo nexteston the whole workspace (7691 passed), doctests andcargo xtask layers, all exit 0.ribbon::tests::a_submenu_of_short_rows_is_not_a_strip: opens New Layout ▸ Publication Layout ▸ Letter and checks that the styles' submenu isSUBMENU_MIN_Wwide and that the Letter row is as tall as a figure row beside it. It fails onmain, where the submenu is about 54 pt wide.ui_shotscreenshots before and after, measured: styles' submenu 66 → 112 pt wide (100 + margins), every row in Publication Layout 27 pt tall before and after.UI evidence
Before (
main) / after, New Layout ▸ Publication Layout ▸ Letter (216 × 279 mm):Related issue
Closes #2398