split is_mobile to is_narrow and is_oled

is_mobile doesn't really make sense for android tablets. We were
overloading this variable to mean "is_narrow". What we really want is
is_oled for mobile devices and is_narrow for if its phone-like.

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-09-06 21:53:42 -07:00
parent 772bfbad5f
commit 4a4fb06425
9 changed files with 46 additions and 42 deletions

View File

@@ -1,5 +1,5 @@
use crate::{
account_manager::UserAccount, colors::PINK, profile::DisplayName, route::Route,
account_manager::UserAccount, colors::PINK, profile::DisplayName, route::Route, ui,
ui::profile_preview_controller, Damus, Result,
};
@@ -31,7 +31,7 @@ impl AccountSelectionWidget {
return;
}
if app.is_mobile() {
if ui::is_narrow(ui.ctx()) {
Self::show_mobile(ui);
} else {
account_switcher_window(&mut app.show_account_switcher.clone()).show(
@@ -256,8 +256,8 @@ mod previews {
}
impl AccountSelectionPreview {
fn new(is_mobile: bool) -> Self {
let app = test_data::test_app(is_mobile);
fn new() -> Self {
let app = test_data::test_app();
AccountSelectionPreview { app }
}
}
@@ -271,8 +271,8 @@ mod previews {
impl Preview for AccountSelectionWidget {
type Prev = AccountSelectionPreview;
fn preview(cfg: PreviewConfig) -> Self::Prev {
AccountSelectionPreview::new(cfg.is_mobile)
fn preview(_cfg: PreviewConfig) -> Self::Prev {
AccountSelectionPreview::new()
}
}
}