feat: add cosmic::theme::spacing()
This commit is contained in:
parent
2afa192573
commit
ab887aeeac
2 changed files with 9 additions and 1 deletions
|
|
@ -205,6 +205,7 @@ impl cosmic::Application for App {
|
||||||
.on_input(Message::Input2)
|
.on_input(Message::Input2)
|
||||||
.on_clear(Message::Ignore),
|
.on_clear(Message::Ignore),
|
||||||
]
|
]
|
||||||
|
.spacing(cosmic::theme::spacing().space_s)
|
||||||
.width(iced::Length::Fill)
|
.width(iced::Length::Fill)
|
||||||
.height(iced::Length::Shrink)
|
.height(iced::Length::Shrink)
|
||||||
.align_x(iced::Alignment::Center),
|
.align_x(iced::Alignment::Center),
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,12 @@
|
||||||
#[cfg(feature = "xdg-portal")]
|
#[cfg(feature = "xdg-portal")]
|
||||||
pub mod portal;
|
pub mod portal;
|
||||||
pub mod style;
|
pub mod style;
|
||||||
|
use cosmic_theme::Spacing;
|
||||||
use cosmic_theme::ThemeMode;
|
use cosmic_theme::ThemeMode;
|
||||||
pub use style::*;
|
pub use style::*;
|
||||||
|
|
||||||
use cosmic_config::config_subscription;
|
|
||||||
use cosmic_config::CosmicConfigEntry;
|
use cosmic_config::CosmicConfigEntry;
|
||||||
|
use cosmic_config::config_subscription;
|
||||||
use cosmic_theme::Component;
|
use cosmic_theme::Component;
|
||||||
use cosmic_theme::LayeredTheme;
|
use cosmic_theme::LayeredTheme;
|
||||||
use iced_futures::Subscription;
|
use iced_futures::Subscription;
|
||||||
|
|
@ -63,6 +64,12 @@ pub fn active_type() -> ThemeType {
|
||||||
THEME.lock().unwrap().theme_type.clone()
|
THEME.lock().unwrap().theme_type.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Preferred interface spacing parameters defined by the active theme.
|
||||||
|
#[inline(always)]
|
||||||
|
pub fn spacing() -> Spacing {
|
||||||
|
active().cosmic().spacing
|
||||||
|
}
|
||||||
|
|
||||||
/// Whether the active theme has a dark preference.
|
/// Whether the active theme has a dark preference.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn is_dark() -> bool {
|
pub fn is_dark() -> bool {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue