commit 9ebbaf40e5c25519b5a53ad0f15714c1fa21d519
parent 57308f108edb27fd0722a004bff56e93c07e887f
Author: William Casarin <jb55@jb55.com>
Date: Thu, 21 Mar 2024 14:30:44 +0100
style: initial logic for mobile style
we definitely watch pure black for oled mobile screens, better battery
life.
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/src/app.rs b/src/app.rs
@@ -399,7 +399,8 @@ fn process_message(damus: &mut Damus, relay: &str, msg: &RelayMessage) {
}
fn render_damus(damus: &mut Damus, ctx: &Context) {
- ctx.style_mut(set_app_style);
+ //ctx.style_mut(|s| set_app_style(s, is_mobile(ctx)));
+ ctx.style_mut(|s| set_app_style(s, true));
if is_mobile(ctx) {
render_damus_mobile(ctx, damus);
@@ -821,13 +822,17 @@ fn render_panel<'a>(ctx: &egui::Context, app: &'a mut Damus, timeline_ind: usize
});
}
-fn set_app_style(style: &mut Style) {
+fn set_app_style(style: &mut Style, is_mobile: bool) {
let visuals = &mut style.visuals;
visuals.hyperlink_color = colors::PURPLE;
if visuals.dark_mode {
visuals.override_text_color = Some(egui::Color32::from_rgb(250, 250, 250));
//visuals.panel_fill = egui::Color32::from_rgb(31, 31, 31);
- visuals.panel_fill = egui::Color32::from_rgb(0, 0, 0);
+ if is_mobile {
+ visuals.panel_fill = egui::Color32::from_rgb(0, 0, 0);
+ } else {
+ visuals.panel_fill = egui::Color32::from_rgb(31, 31, 31);
+ }
//visuals.override_text_color = Some(egui::Color32::from_rgb(170, 177, 190));
//visuals.panel_fill = egui::Color32::from_rgb(40, 44, 52);
} else {
@@ -880,6 +885,16 @@ fn render_damus_desktop(ctx: &egui::Context, app: &mut Damus) {
//postbox(ui, app);
timeline_view(ui, app, 0, 0);
});
+
+ /*
+ egui::Area::new("test")
+ .fixed_pos(egui::pos2(50.0, 50.0))
+ //.resizable(false)
+ //.title_bar(false)
+ .show(ctx, |ui| {
+ ui.label("Test");
+ });
+ */
});
return;