notedeck

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

commit 66377351b3d2e579e9fb44b30657f9794442a062
parent 4f0d96679d5dd6325498a53018980f25e6f7cd56
Author: William Casarin <jb55@jb55.com>
Date:   Tue, 15 Apr 2025 08:24:04 -0700

ui: add some margin to chrome sidebar

Looks a bit better

Diffstat:
Mcrates/notedeck_chrome/src/chrome.rs | 3+++
Mcrates/notedeck_columns/src/ui/side_panel.rs | 3++-
Acrates/notedeck_ui/src/constants.rs | 2++
Mcrates/notedeck_ui/src/lib.rs | 1+
4 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/crates/notedeck_chrome/src/chrome.rs b/crates/notedeck_chrome/src/chrome.rs @@ -268,6 +268,9 @@ impl Chrome { // minimize/close buttons if cfg!(target_os = "macos") { ui.add_space(28.0); + } else { + // we still want *some* padding so that it aligns with the + button regardless + ui.add_space(notedeck_ui::constants::FRAME_MARGIN.into()); } if ui.add(expand_side_panel_button()).clicked() { diff --git a/crates/notedeck_columns/src/ui/side_panel.rs b/crates/notedeck_columns/src/ui/side_panel.rs @@ -66,7 +66,8 @@ impl<'a> DesktopSidePanel<'a> { } pub fn show(&mut self, ui: &mut egui::Ui) -> Option<SidePanelResponse> { - let frame = egui::Frame::new().inner_margin(Margin::same(8)); + let frame = + egui::Frame::new().inner_margin(Margin::same(notedeck_ui::constants::FRAME_MARGIN)); if !ui.visuals().dark_mode { let rect = ui.available_rect_before_wrap(); diff --git a/crates/notedeck_ui/src/constants.rs b/crates/notedeck_ui/src/constants.rs @@ -0,0 +1,2 @@ +/// Default frame margin +pub const FRAME_MARGIN: i8 = 8; diff --git a/crates/notedeck_ui/src/lib.rs b/crates/notedeck_ui/src/lib.rs @@ -1,5 +1,6 @@ mod anim; pub mod colors; +pub mod constants; pub mod gif; pub mod icons; pub mod images;