Skip to content

Commit

Permalink
Use cross justify to expand the trigger window
Browse files Browse the repository at this point in the history
  • Loading branch information
melody-rs committed Jul 1, 2024
1 parent 765cb6c commit b0160a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions crates/components/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,14 @@ impl<'e, T: ToString + PartialEq + strum::IntoEnumIterator> egui::Widget for Enu
let mut changed = false;
let mut response = ui
.vertical(|ui| {
for variant in T::iter() {
let text = variant.to_string();
if ui.radio_value(self.current_value, variant, text).changed() {
changed = true;
ui.with_cross_justify(|ui| {
for variant in T::iter() {
let text = variant.to_string();
if ui.radio_value(self.current_value, variant, text).changed() {
changed = true;
}
}
}
});
})
.response;
if changed {
Expand Down
4 changes: 2 additions & 2 deletions crates/ui/src/windows/event_edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl luminol_core::Window for Window {
);
ui.label("is ON");
// ensure we expand to fit the side panel
ui.add_space(ui.available_width());
ui.add_space(ui.available_width()); // cross justify doesn't seem to be able to replace this?
});
});

Expand Down Expand Up @@ -257,7 +257,7 @@ impl luminol_core::Window for Window {
egui::TopBottomPanel::bottom(id_source.with("bottom_panel")).show_inside(
ui,
|ui| {
ui.add_space(ui.style().spacing.item_spacing.y);
ui.add_space(1.0); // it still looks a little squished, even with this. how can we fix this?
luminol_components::close_options_ui(ui, open, &mut needs_save)
},
);
Expand Down

0 comments on commit b0160a4

Please sign in to comment.