fix: move density to cosmic_theme

This commit is contained in:
Vukašin Vojinović 2024-09-18 20:09:25 +02:00 committed by Ashley Wulber
parent 69e6fb63fb
commit 0a34660a80
6 changed files with 85 additions and 71 deletions

View file

@ -48,6 +48,8 @@ pub mod message {
pub use self::command::Command;
pub use self::core::Core;
pub use self::settings::Settings;
use crate::config::interface_density;
use crate::cosmic_theme::Density;
use crate::prelude::*;
use crate::theme::THEME;
use crate::widget::{context_drawer, horizontal_space, id_container, menu, nav_bar, popover};
@ -652,6 +654,11 @@ impl<App: Application> ApplicationExt for App {
.focused_window()
.is_some_and(|i| i == self.main_window_id());
let padding = match interface_density() {
Density::Compact => 2,
_ => 8,
};
let content_row = crate::widget::row::with_children({
let mut widgets = Vec::with_capacity(4);
@ -732,7 +739,7 @@ impl<App: Application> ApplicationExt for App {
let content: Element<_> = if core.window.content_container {
content_row
.apply(crate::widget::container)
.padding([0, 8, 8, 8])
.padding([0, padding, padding, padding])
.width(iced::Length::Fill)
.height(iced::Length::Fill)
.style(crate::theme::Container::WindowBackground)