2022-11-17 16:38:48 +01:00
|
|
|
mod dbus;
|
|
|
|
|
mod graphics;
|
|
|
|
|
mod window;
|
|
|
|
|
|
|
|
|
|
use cosmic::{
|
|
|
|
|
iced::{sctk_settings::InitialSurface, Application},
|
|
|
|
|
iced_native::command::platform_specific::wayland::window::SctkWindowSettings,
|
|
|
|
|
iced_native::window::Settings,
|
2022-12-07 12:46:54 -05:00
|
|
|
settings, applet::CosmicAppletHelper,
|
2022-02-15 18:24:24 -05:00
|
|
|
};
|
2022-11-17 16:38:48 +01:00
|
|
|
use cosmic_panel_config::PanelSize;
|
|
|
|
|
use window::*;
|
|
|
|
|
|
|
|
|
|
pub fn main() -> cosmic::iced::Result {
|
|
|
|
|
let mut settings = settings();
|
2022-12-07 12:46:54 -05:00
|
|
|
let helper = CosmicAppletHelper::default();
|
|
|
|
|
let pixels = helper.suggested_icon_size() as u32;
|
2022-11-17 16:38:48 +01:00
|
|
|
settings.initial_surface = InitialSurface::XdgWindow(SctkWindowSettings {
|
|
|
|
|
iced_settings: Settings {
|
2022-12-07 12:46:54 -05:00
|
|
|
size: (pixels + 16, pixels + 16),
|
|
|
|
|
min_size: Some((pixels + 16, pixels + 16)),
|
|
|
|
|
max_size: Some((pixels + 16, pixels + 16)),
|
2022-11-17 16:38:48 +01:00
|
|
|
..Default::default()
|
|
|
|
|
},
|
|
|
|
|
..Default::default()
|
|
|
|
|
});
|
|
|
|
|
Window::run(settings)
|
2022-02-14 15:41:47 -05:00
|
|
|
}
|