ui: add some margin to chrome sidebar

Looks a bit better
This commit is contained in:
William Casarin
2025-04-15 08:24:04 -07:00
parent 4f0d96679d
commit 66377351b3
4 changed files with 8 additions and 1 deletions

View File

@@ -268,6 +268,9 @@ impl Chrome {
// minimize/close buttons // minimize/close buttons
if cfg!(target_os = "macos") { if cfg!(target_os = "macos") {
ui.add_space(28.0); 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() { if ui.add(expand_side_panel_button()).clicked() {

View File

@@ -66,7 +66,8 @@ impl<'a> DesktopSidePanel<'a> {
} }
pub fn show(&mut self, ui: &mut egui::Ui) -> Option<SidePanelResponse> { 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 { if !ui.visuals().dark_mode {
let rect = ui.available_rect_before_wrap(); let rect = ui.available_rect_before_wrap();

View File

@@ -0,0 +1,2 @@
/// Default frame margin
pub const FRAME_MARGIN: i8 = 8;

View File

@@ -1,5 +1,6 @@
mod anim; mod anim;
pub mod colors; pub mod colors;
pub mod constants;
pub mod gif; pub mod gif;
pub mod icons; pub mod icons;
pub mod images; pub mod images;