2022-11-17 16:38:48 +01:00
|
|
|
mod dbus;
|
|
|
|
|
mod graphics;
|
2023-01-12 14:30:58 -05:00
|
|
|
mod localize;
|
2022-11-17 16:38:48 +01:00
|
|
|
mod window;
|
|
|
|
|
|
2023-01-12 14:30:58 -05:00
|
|
|
use cosmic::{
|
|
|
|
|
iced::{wayland::InitialSurface, Application, Settings},
|
2023-06-01 12:23:12 -04:00
|
|
|
iced_runtime::core::layout::Limits,
|
2023-01-12 14:30:58 -05:00
|
|
|
};
|
2023-06-01 12:23:12 -04:00
|
|
|
use cosmic_applet::{cosmic_panel_config::PanelAnchor, CosmicAppletHelper};
|
2023-01-12 14:30:58 -05:00
|
|
|
|
2022-11-17 16:38:48 +01:00
|
|
|
use window::*;
|
|
|
|
|
|
|
|
|
|
pub fn main() -> cosmic::iced::Result {
|
2022-12-07 12:46:54 -05:00
|
|
|
let helper = CosmicAppletHelper::default();
|
2023-01-12 14:30:58 -05:00
|
|
|
let mut settings: Settings<()> = helper.window_settings();
|
|
|
|
|
match helper.anchor {
|
|
|
|
|
PanelAnchor::Top | PanelAnchor::Bottom => {
|
|
|
|
|
match &mut settings.initial_surface {
|
|
|
|
|
InitialSurface::LayerSurface(_) => todo!(),
|
|
|
|
|
InitialSurface::XdgWindow(w) => {
|
|
|
|
|
w.autosize = true;
|
2023-06-20 20:48:13 -04:00
|
|
|
w.resizable = None;
|
2023-01-12 14:30:58 -05:00
|
|
|
w.size_limits = Limits::NONE
|
2023-06-01 12:23:12 -04:00
|
|
|
.min_height(1.0)
|
|
|
|
|
.max_height(200.0)
|
|
|
|
|
.min_width(1.0)
|
|
|
|
|
.max_width(1000.0);
|
2023-01-12 14:30:58 -05:00
|
|
|
}
|
2023-01-20 11:25:53 -05:00
|
|
|
InitialSurface::None => unimplemented!(),
|
2023-01-12 14:30:58 -05:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
_ => {}
|
|
|
|
|
};
|
|
|
|
|
Window::run(settings)
|
2022-02-14 15:41:47 -05:00
|
|
|
}
|