mobile: simplify is_mobile
we don't need context anymore Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -16,7 +16,7 @@ pub struct AccountLoginView<'a> {
|
||||
|
||||
impl<'a> View for AccountLoginView<'a> {
|
||||
fn ui(&mut self, ui: &mut egui::Ui) {
|
||||
let is_mobile = ui::is_mobile(ui.ctx());
|
||||
let is_mobile = ui::is_mobile();
|
||||
if let Some(key) = self.manager.check_for_successful_login() {
|
||||
// TODO: route to "home"
|
||||
println!("successful login with key: {:?}", key);
|
||||
|
||||
@@ -16,7 +16,7 @@ pub struct AccountManagementView<'a> {
|
||||
|
||||
impl<'a> View for AccountManagementView<'a> {
|
||||
fn ui(&mut self, ui: &mut egui::Ui) {
|
||||
if ui::is_mobile(ui.ctx()) {
|
||||
if ui::is_mobile() {
|
||||
self.show_mobile(ui);
|
||||
} else {
|
||||
self.show(ui);
|
||||
|
||||
@@ -48,8 +48,7 @@ pub fn hline(ui: &egui::Ui) {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[allow(unreachable_code)]
|
||||
pub fn is_mobile(_ctx: &egui::Context) -> bool {
|
||||
pub fn is_mobile() -> bool {
|
||||
#[cfg(feature = "emulate_mobile")]
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -207,7 +207,7 @@ impl<'a> Note<'a> {
|
||||
let profile_key = profile.as_ref().unwrap().record().note_key();
|
||||
let note_key = note_key.as_u64();
|
||||
|
||||
if is_mobile(ui.ctx()) {
|
||||
if is_mobile() {
|
||||
ui.add(ui::ProfilePic::new(&mut self.app.img_cache, pic));
|
||||
} else {
|
||||
let (rect, size) = ui::anim::hover_expand(
|
||||
|
||||
Reference in New Issue
Block a user