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:
@@ -255,7 +255,7 @@ impl<'a> NoteView<'a> {
|
||||
let profile_key = profile.as_ref().unwrap().record().note_key();
|
||||
let note_key = note_key.as_u64();
|
||||
|
||||
if self.app.is_mobile() {
|
||||
if ui::is_narrow(ui.ctx()) {
|
||||
ui.add(ui::ProfilePic::new(&mut self.app.img_cache, pic));
|
||||
} else {
|
||||
let (rect, size, _resp) = ui::anim::hover_expand(
|
||||
|
||||
@@ -174,9 +174,9 @@ mod preview {
|
||||
}
|
||||
|
||||
impl PostPreview {
|
||||
fn new(is_mobile: bool) -> Self {
|
||||
fn new() -> Self {
|
||||
PostPreview {
|
||||
app: test_data::test_app(is_mobile),
|
||||
app: test_data::test_app(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -191,8 +191,8 @@ mod preview {
|
||||
impl<'app, 'p> Preview for PostView<'app, 'p> {
|
||||
type Prev = PostPreview;
|
||||
|
||||
fn preview(cfg: PreviewConfig) -> Self::Prev {
|
||||
PostPreview::new(cfg.is_mobile)
|
||||
fn preview(_cfg: PreviewConfig) -> Self::Prev {
|
||||
PostPreview::new()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user