Skip to content

Commit

Permalink
ui: remove extra padding on main panel
Browse files Browse the repository at this point in the history
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
jb55 committed Feb 15, 2024
1 parent ef1e7e3 commit 5ecc437
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -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")]
Expand All @@ -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);
Expand All @@ -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])
Expand Down

0 comments on commit 5ecc437

Please sign in to comment.