mobile: make mobile flag runtime-configurable
we need to pass a few more things around but it's not that bad. This will allow you to launch damus with --mobile for mobile testing without recompilation.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::imgcache::ImageCache;
|
||||
use crate::ui::{Preview, View};
|
||||
use crate::ui::{Preview, PreviewConfig, View};
|
||||
use egui::{vec2, Sense, TextureHandle};
|
||||
|
||||
pub struct ProfilePic<'cache, 'url> {
|
||||
@@ -185,7 +185,7 @@ mod preview {
|
||||
impl<'cache, 'url> Preview for ProfilePic<'cache, 'url> {
|
||||
type Prev = ProfilePicPreview;
|
||||
|
||||
fn preview() -> Self::Prev {
|
||||
fn preview(_cfg: PreviewConfig) -> Self::Prev {
|
||||
ProfilePicPreview::new()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ impl<'a, 'cache> egui::Widget for SimpleProfilePreview<'a, 'cache> {
|
||||
mod previews {
|
||||
use super::*;
|
||||
use crate::test_data::test_profile_record;
|
||||
use crate::ui::{Preview, View};
|
||||
use crate::ui::{Preview, PreviewConfig, View};
|
||||
|
||||
pub struct ProfilePreviewPreview<'a> {
|
||||
profile: ProfileRecord<'a>,
|
||||
@@ -142,7 +142,7 @@ mod previews {
|
||||
/// A preview of the profile preview :D
|
||||
type Prev = ProfilePreviewPreview<'a>;
|
||||
|
||||
fn preview() -> Self::Prev {
|
||||
fn preview(_cfg: PreviewConfig) -> Self::Prev {
|
||||
ProfilePreviewPreview::new()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user