notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit 553a88d5746d668a80f19e957ac61af99afc50ab
parent 18226a35ffafca3621606c5e0fd9b2aba4e00913
Author: Ken Sedgwick <ken@bonsai.com>
Date:   Mon, 16 Dec 2024 20:40:35 -0800

android: use more app top margin for android

A more refined solution would query the android environment for the
system bar height ...

Closes: https://github.com/damus-io/notedeck/pull/585
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mcrates/notedeck_columns/src/app.rs | 19++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/crates/notedeck_columns/src/app.rs b/crates/notedeck_columns/src/app.rs @@ -512,9 +512,26 @@ fn render_damus_mobile(app: &mut Damus, app_ctx: &mut AppContext<'_>) { }); } +fn margin_top(narrow: bool) -> f32 { + #[cfg(target_os = "android")] + { + // FIXME - query the system bar height and adjust more precisely + let _ = narrow; // suppress compiler warning on android + 40.0 + } + #[cfg(not(target_os = "android"))] + { + if narrow { + 50.0 + } else { + 0.0 + } + } +} + fn main_panel(style: &Style, narrow: bool) -> egui::CentralPanel { let inner_margin = egui::Margin { - top: if narrow { 50.0 } else { 0.0 }, + top: margin_top(narrow), left: 0.0, right: 0.0, bottom: 0.0,