feat(applets): add overflow support
This commit is contained in:
parent
1e566c13aa
commit
d35cc71b90
3 changed files with 89 additions and 22 deletions
|
|
@ -84,6 +84,9 @@ pub enum Message {
|
|||
Focus(window::Id),
|
||||
/// Window focus lost
|
||||
Unfocus(window::Id),
|
||||
/// Tracks updates to window suggested size.
|
||||
#[cfg(feature = "applet")]
|
||||
Configure(cctk::sctk::shell::xdg::window::WindowConfigure),
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
|
|
@ -186,6 +189,12 @@ where
|
|||
| wayland::Event::Layer(wayland::LayerEvent::Done, _, id) => {
|
||||
return Some(Message::SurfaceClosed(id));
|
||||
}
|
||||
#[cfg(feature = "applet")]
|
||||
wayland::Event::Window(WindowEvent::Configure(conf), _surface, id)
|
||||
if id == window::Id::MAIN =>
|
||||
{
|
||||
return Some(Message::Configure(conf));
|
||||
}
|
||||
_ => (),
|
||||
},
|
||||
_ => (),
|
||||
|
|
@ -638,6 +647,16 @@ impl<T: Application> Cosmic<T> {
|
|||
core.focused_window = None;
|
||||
}
|
||||
}
|
||||
#[cfg(feature = "applet")]
|
||||
Message::Configure(configure) => {
|
||||
if let Some(w) = configure.new_size.0 {
|
||||
self.app.core_mut().set_window_width(w.get());
|
||||
}
|
||||
if let Some(h) = configure.new_size.1 {
|
||||
self.app.core_mut().set_window_height(h.get());
|
||||
}
|
||||
self.app.core_mut().applet.configure = Some(configure);
|
||||
}
|
||||
}
|
||||
|
||||
iced::Command::none()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue