fix: fix update dep & fix window size
This commit is contained in:
parent
092fc40426
commit
d088acd62d
7 changed files with 27 additions and 45 deletions
|
|
@ -6,29 +6,20 @@ use cosmic::{
|
|||
iced::{sctk_settings::InitialSurface, Application},
|
||||
iced_native::command::platform_specific::wayland::window::SctkWindowSettings,
|
||||
iced_native::window::Settings,
|
||||
settings,
|
||||
settings, applet::CosmicAppletHelper,
|
||||
};
|
||||
use cosmic_panel_config::PanelSize;
|
||||
use window::*;
|
||||
|
||||
pub fn main() -> cosmic::iced::Result {
|
||||
let mut settings = settings();
|
||||
let pixels = std::env::var("COSMIC_PANEL_SIZE")
|
||||
.ok()
|
||||
.and_then(|size| match size.parse::<PanelSize>() {
|
||||
Ok(PanelSize::XL) => Some(64),
|
||||
Ok(PanelSize::L) => Some(48),
|
||||
Ok(PanelSize::M) => Some(36),
|
||||
Ok(PanelSize::S) => Some(24),
|
||||
Ok(PanelSize::XS) => Some(18),
|
||||
Err(_) => Some(36),
|
||||
})
|
||||
.unwrap_or(36);
|
||||
let helper = CosmicAppletHelper::default();
|
||||
let pixels = helper.suggested_icon_size() as u32;
|
||||
settings.initial_surface = InitialSurface::XdgWindow(SctkWindowSettings {
|
||||
iced_settings: Settings {
|
||||
size: (pixels + 32, pixels + 16),
|
||||
min_size: Some((pixels + 32, pixels + 16)),
|
||||
max_size: Some((pixels + 32, pixels + 16)),
|
||||
size: (pixels + 16, pixels + 16),
|
||||
min_size: Some((pixels + 16, pixels + 16)),
|
||||
max_size: Some((pixels + 16, pixels + 16)),
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue