notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit 5ecc43786f114f82604267e0a4246f39200a7dae
parent ef1e7e3ac8f45a6efb3fd30de14ceac4e19f7de7
Author: William Casarin <jb55@jb55.com>
Date:   Thu, 15 Feb 2024 14:53:09 -0800

ui: remove extra padding on main panel

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Msrc/app.rs | 19++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/app.rs b/src/app.rs @@ -10,7 +10,9 @@ use crate::Result; use egui::containers::scroll_area::ScrollBarVisibility; use egui::widgets::Spinner; -use egui::{Color32, Context, Frame, Hyperlink, Image, Label, Margin, RichText, TextureHandle}; +use egui::{ + Color32, Context, Frame, Hyperlink, Image, Label, Margin, RichText, Style, TextureHandle, +}; use enostr::{ClientMessage, Filter, Pubkey, RelayEvent, RelayMessage}; use nostrdb::{ @@ -870,14 +872,21 @@ fn render_damus_mobile(ctx: &egui::Context, app: &mut Damus) { let panel_width = ctx.screen_rect().width(); - egui::CentralPanel::default().show(ctx, |ui| { - set_app_style(ui); + main_panel(&ctx.style()).show(ctx, |ui| { timeline_panel(ui, panel_width, 0, |ui| { timeline_view(ui, app, 0); }); }); } +fn main_panel(style: &Style) -> egui::CentralPanel { + egui::CentralPanel::default().frame(Frame { + inner_margin: Margin::same(0.0), + fill: style.visuals.panel_fill, + ..Default::default() + }) +} + fn render_damus_desktop(ctx: &egui::Context, app: &mut Damus) { render_panel(ctx, app, 0); #[cfg(feature = "profiling")] @@ -895,7 +904,7 @@ fn render_damus_desktop(ctx: &egui::Context, app: &mut Damus) { if app.n_panels == 1 { let panel_width = ctx.screen_rect().width(); - egui::CentralPanel::default().show(ctx, |ui| { + main_panel(&ctx.style()).show(ctx, |ui| { set_app_style(ui); timeline_panel(ui, panel_width, 0, |ui| { //postbox(ui, app); @@ -906,7 +915,7 @@ fn render_damus_desktop(ctx: &egui::Context, app: &mut Damus) { return; } - egui::CentralPanel::default().show(ctx, |ui| { + main_panel(&ctx.style()).show(ctx, |ui| { set_app_style(ui); egui::ScrollArea::horizontal() .auto_shrink([false; 2])