Separate CosmicAppletWindow and CosmicAppletButton
This commit is contained in:
parent
74f6c2eca6
commit
aac43de65d
16 changed files with 421 additions and 343 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use cascade::cascade;
|
||||
use gtk4::{glib, prelude::*};
|
||||
use relm4_macros::view;
|
||||
|
||||
mod dbus_service;
|
||||
mod deref_cell;
|
||||
|
|
@ -19,18 +19,20 @@ fn main() {
|
|||
|
||||
let notification_list = NotificationList::new(¬ifications);
|
||||
|
||||
let window = cascade! {
|
||||
libcosmic_applet::Applet::new();
|
||||
..set_button_icon_name("user-invisible-symbolic"); // TODO
|
||||
..set_popover_child(Some(¬ification_list));
|
||||
..show();
|
||||
};
|
||||
view! {
|
||||
window = libcosmic_applet::AppletWindow {
|
||||
#[wrap(Some)]
|
||||
set_child: applet_button = &libcosmic_applet::AppletButton {
|
||||
set_button_icon_name: "user-invisible-symbolic", // TODO
|
||||
set_popover_child: Some(¬ification_list)
|
||||
}
|
||||
}
|
||||
}
|
||||
window.show();
|
||||
|
||||
// XXX show in correct place
|
||||
cascade! {
|
||||
NotificationPopover::new(¬ifications);
|
||||
..set_parent(&window.child().unwrap()); // XXX better way?
|
||||
};
|
||||
let notification_popover = NotificationPopover::new(¬ifications);
|
||||
notification_popover.set_parent(&applet_button);
|
||||
|
||||
let main_loop = glib::MainLoop::new(None, false);
|
||||
main_loop.run();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue