Skip to content

Commit

Permalink
Only show the mobile OS warning banner on web (#1685)
Browse files Browse the repository at this point in the history
  • Loading branch information
jleibs authored Mar 23, 2023
1 parent e87ee88 commit 6e77012
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions crates/re_viewer/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1012,11 +1012,16 @@ impl AppState {
}
}

fn warning_panel(re_ui: &re_ui::ReUi, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
fn warning_panel(re_ui: &re_ui::ReUi, ui: &mut egui::Ui, frame: &mut eframe::Frame) {
// We have not yet optimized the UI experience for mobile. Show a warning banner
// with a link to the tracking issue.
if ui.ctx().os() == egui::os::OperatingSystem::IOS
|| ui.ctx().os() == egui::os::OperatingSystem::Android

// Although this banner is applicable to IOS / Android generically without limit to web
// There is a small issue in egui where Windows native currently reports as android.
// TODO(jleibs): Remove the is_web gate once https://github.com/emilk/egui/pull/2832 has landed.
if frame.is_web()
&& (ui.ctx().os() == egui::os::OperatingSystem::IOS
|| ui.ctx().os() == egui::os::OperatingSystem::Android)
{
let frame = egui::Frame {
fill: ui.visuals().panel_fill,
Expand Down

0 comments on commit 6e77012

Please sign in to comment.