trim exit button sizes

This commit is contained in:
Crispy 2024-10-07 18:56:09 +02:00
parent 90d2e35ade
commit 1b74f9c996

View file

@ -40,7 +40,7 @@ pub struct Editor {
exit_state: ExitState, exit_state: ExitState,
exit_menu: bool, exit_menu: bool,
complete_popup: Popup, complete_popup: Popup,
fail_popup: Popup, // fail_popup: Popup,
score: Option<Score>, score: Option<Score>,
} }
@ -103,7 +103,7 @@ impl Editor {
exit_state: ExitState::Dont, exit_state: ExitState::Dont,
exit_menu: false, exit_menu: false,
complete_popup: Popup::Start, complete_popup: Popup::Start,
fail_popup: Popup::Start, // fail_popup: Popup::Start,
score: solution.score, score: solution.score,
} }
} }
@ -370,27 +370,27 @@ impl Editor {
); );
if self.exit_menu { if self.exit_menu {
if simple_button(d, 5, 5, 80, 30) { if simple_button(d, 5, 5, 75, 30) {
self.exit_menu = false; self.exit_menu = false;
} }
d.draw_text("cancel", 10, 10, 20, Color::WHITE); d.draw_text("cancel", 10, 10, 20, Color::WHITE);
if simple_button(d, 90, 5, 80, 30) { if simple_button(d, 85, 5, 60, 30) {
self.exit_state = ExitState::ExitAndSave; self.exit_state = ExitState::ExitAndSave;
} }
d.draw_text("save", 95, 10, 20, Color::WHITE); d.draw_text("save", 90, 10, 20, Color::WHITE);
if simple_button(d, 175, 5, 80, 30) { if simple_button(d, 150, 5, 80, 30) {
self.exit_state = ExitState::ExitNoSave; self.exit_state = ExitState::ExitNoSave;
} }
d.draw_text("revert", 180, 10, 20, Color::WHITE); d.draw_text("revert", 155, 10, 20, Color::WHITE);
} else { } else {
if simple_button(d, 5, 5, 80, 30) { if simple_button(d, 5, 5, 75, 30) {
self.exit_menu = true; self.exit_menu = true;
} }
d.draw_text("exit", 10, 10, 20, Color::WHITE); d.draw_text("exit", 10, 10, 20, Color::WHITE);
if simple_button(d, 90, 5, 80, 30) { if simple_button(d, 85, 5, 60, 30) {
self.exit_state = ExitState::Save; self.exit_state = ExitState::Save;
} }
d.draw_text("save", 95, 10, 20, Color::WHITE); d.draw_text("save", 90, 10, 20, Color::WHITE);
} }
match self.sim_state { match self.sim_state {