Skip to content

Commit 38dde24

Browse files
git-f0xwash2
authored andcommitted
chore(applet): add spacing field
1 parent ec7a531 commit 38dde24

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/applet/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use crate::{
2121
};
2222
pub use cosmic_panel_config;
2323
use cosmic_panel_config::{CosmicPanelBackground, PanelAnchor, PanelSize};
24-
use iced_core::{Layout, Padding, Shadow};
24+
use iced_core::{Padding, Shadow};
2525
use iced_widget::runtime::platform_specific::wayland::popup::{SctkPopupSettings, SctkPositioner};
2626
use sctk::reexports::protocols::xdg::shell::client::xdg_positioner::{Anchor, Gravity};
2727
use std::{borrow::Cow, num::NonZeroU32, rc::Rc, sync::LazyLock, time::Duration};
@@ -39,6 +39,7 @@ static TOOLTIP_WINDOW_ID: LazyLock<window::Id> = LazyLock::new(window::Id::uniqu
3939
pub struct Context {
4040
pub size: Size,
4141
pub anchor: PanelAnchor,
42+
pub spacing: u32,
4243
pub background: CosmicPanelBackground,
4344
pub output_name: String,
4445
pub panel_type: PanelType,
@@ -93,6 +94,10 @@ impl Default for Context {
9394
.ok()
9495
.and_then(|size| ron::from_str(size.as_str()).ok())
9596
.unwrap_or(PanelAnchor::Top),
97+
spacing: std::env::var("COSMIC_PANEL_SPACING")
98+
.ok()
99+
.and_then(|size| ron::from_str(size.as_str()).ok())
100+
.unwrap_or(4),
96101
background: std::env::var("COSMIC_PANEL_BACKGROUND")
97102
.ok()
98103
.and_then(|size| ron::from_str(size.as_str()).ok())

0 commit comments

Comments
 (0)