Skip to content

Commit

Permalink
android: use more app top margin for android
Browse files Browse the repository at this point in the history
A more refined solution would query the android environment for the
system bar height ...

Closes: #585
Reviewed-by: William Casarin <[email protected]>
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
ksedgwic authored and jb55 committed Dec 17, 2024
1 parent 18226a3 commit 553a88d
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion crates/notedeck_columns/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 553a88d

Please sign in to comment.