UI: leave no gap between the rows of a menu
The app's item spacing left 4 px between two menu entries where neither highlighted and a click did nothing. Menus (context menus, the menu bar, menu buttons and their submenus) now use a menu style with no row gap and rows taller by that gap, so they keep their size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9a7d3e7699
commit
afaa4bdeeb
@@ -1164,7 +1164,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
|
||||
if hresp.drag_started() {
|
||||
ctx.data_mut(|d| d.insert_temp(drag_id, g.uid));
|
||||
}
|
||||
hresp.context_menu(|ui| {
|
||||
crate::widgets::context_menu(&hresp, |ui| {
|
||||
let lid = layer.id.0;
|
||||
let mut item = |ui: &mut egui::Ui, label: &str, enabled: bool, cmd: &str, params: serde_json::Value| {
|
||||
if ui.add_enabled(enabled, egui::Button::new(label)).clicked() {
|
||||
@@ -1246,7 +1246,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
|
||||
let open = ui.input(|i| i.pointer.secondary_clicked())
|
||||
&& ui.rect_contains_pointer(body)
|
||||
&& (!egui::Popup::is_any_open(&ctx) || egui::Popup::is_id_open(&ctx, menu_id));
|
||||
egui::Popup::context_menu(&bg).id(menu_id).open_memory(open.then_some(egui::SetOpenCommand::Bool(true))).show(|ui| {
|
||||
egui::Popup::context_menu(&bg).style(crate::widgets::menu_style).id(menu_id).open_memory(open.then_some(egui::SetOpenCommand::Bool(true))).show(|ui| {
|
||||
ui.set_min_width(200.0);
|
||||
actions.extend(crate::menus::menu_contents(app, ui, "Effect"));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user