Use libcosmic-applet in audio, notifications
This commit is contained in:
parent
f56b160635
commit
68986d773c
7 changed files with 87 additions and 148 deletions
|
|
@ -17,43 +17,21 @@ fn main() {
|
|||
// XXX Implement DBus service somewhere other than applet?
|
||||
let notifications = Notifications::new();
|
||||
|
||||
let provider = gtk4::CssProvider::new();
|
||||
provider.load_from_data(include_bytes!("style.css"));
|
||||
gtk4::StyleContext::add_provider_for_display(
|
||||
>k4::gdk::Display::default().expect("Could not connect to a display."),
|
||||
&provider,
|
||||
gtk4::STYLE_PROVIDER_PRIORITY_APPLICATION,
|
||||
);
|
||||
|
||||
let notification_list = NotificationList::new(¬ifications);
|
||||
|
||||
let popover = cascade! {
|
||||
gtk4::Popover::new();
|
||||
..set_child(Some(¬ification_list));
|
||||
};
|
||||
|
||||
let menu_button = cascade! {
|
||||
gtk4::MenuButton::new();
|
||||
..set_icon_name("user-invisible-symbolic"); // TODO
|
||||
..set_popover(Some(&popover));
|
||||
let window = cascade! {
|
||||
libcosmic_applet::Applet::new();
|
||||
..set_button_icon_name("user-invisible-symbolic"); // TODO
|
||||
..set_popover_child(Some(¬ification_list));
|
||||
..show();
|
||||
};
|
||||
|
||||
// XXX show in correct place
|
||||
cascade! {
|
||||
NotificationPopover::new(¬ifications);
|
||||
..set_parent(&menu_button);
|
||||
..set_parent(&window.child().unwrap()); // XXX better way?
|
||||
};
|
||||
|
||||
gtk4::Window::builder()
|
||||
.decorated(false)
|
||||
.child(&menu_button)
|
||||
.resizable(false)
|
||||
.width_request(1)
|
||||
.height_request(1)
|
||||
.css_classes(vec!["root_window".to_string()])
|
||||
.build()
|
||||
.show();
|
||||
|
||||
let main_loop = glib::MainLoop::new(None, false);
|
||||
main_loop.run();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
.loading-overlay {
|
||||
background-color: #2f2f2f;
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
image.panel_icon {
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
|
||||
button.panel_icon {
|
||||
border-radius: 12px;
|
||||
transition: 100ms;
|
||||
padding: 4px;
|
||||
border-color: transparent;
|
||||
background: transparent;
|
||||
outline-color: transparent;
|
||||
}
|
||||
|
||||
button.panel_icon:hover {
|
||||
border-radius: 12px;
|
||||
transition: 100ms;
|
||||
padding: 4px;
|
||||
border-color: rgba(255, 255, 255, 0.1);
|
||||
outline-color: rgba(255, 255, 255, 0.1);
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
window.root_window {
|
||||
background: transparent;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue