diff --git a/src/gui/views/goblin/widgets.rs b/src/gui/views/goblin/widgets.rs index 7d240f78..5d756dde 100644 --- a/src/gui/views/goblin/widgets.rs +++ b/src/gui/views/goblin/widgets.rs @@ -537,14 +537,25 @@ pub fn numpad(ui: &mut Ui, amount: &mut String) -> bool { ["7", "8", "9"], [".", "0", "<"], ]; - let key_h = 56.0; - let gap = 10.0; + let key_h = 58.0; + let gap = 14.0; // Center a fixed-width pad so the three columns line up directly under - // the centered amount above, on any width. - let pad_w = ui.available_width().min(300.0); + // the centered amount above, on any width. Wider than before to give the + // columns more breathing room (Cash App-style). + let pad_w = ui.available_width().min(332.0); let key_w = (pad_w - 2.0 * gap) / 3.0; let side = ((ui.available_width() - pad_w) / 2.0).max(0.0); - for row in keys.iter() { + // Spread the four rows toward the bottom when there's room (the Pay tab, + // which otherwise leaves a big empty gap), staying compact on dense + // screens (the send flow). Reserve space below for the action buttons and + // the floating tab bar. Clamped so it never stretches absurdly or overflows. + let reserve_below = 170.0; + let avail = (ui.available_height() - reserve_below).max(0.0); + let row_gap = ((avail - key_h * 4.0) / 3.0).clamp(6.0, 30.0); + for (ri, row) in keys.iter().enumerate() { + if ri > 0 { + ui.add_space(row_gap); + } ui.horizontal(|ui| { ui.add_space(side); for (i, &k) in row.iter().enumerate() { @@ -562,7 +573,7 @@ pub fn numpad(ui: &mut Ui, amount: &mut String) -> bool { rect.center(), egui::Align2::CENTER_CENTER, label, - FontId::new(28.0, fonts::medium()), + FontId::new(30.0, fonts::medium()), col, ); if resp.clicked() { @@ -571,7 +582,6 @@ pub fn numpad(ui: &mut Ui, amount: &mut String) -> bool { } } }); - ui.add_space(4.0); } changed }