Add CSS to status area applet
Doesn't match other applets. Though toggle button behavior is probably what we want?
This commit is contained in:
parent
d22bcabd91
commit
853caa5b84
3 changed files with 43 additions and 0 deletions
|
|
@ -14,6 +14,14 @@ fn main() {
|
||||||
// XXX Implement DBus service somewhere other than applet?
|
// XXX Implement DBus service somewhere other than applet?
|
||||||
glib::MainContext::default().spawn_local(status_notifier_watcher::start());
|
glib::MainContext::default().spawn_local(status_notifier_watcher::start());
|
||||||
|
|
||||||
|
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 status_area = StatusArea::new();
|
let status_area = StatusArea::new();
|
||||||
gtk4::Window::builder()
|
gtk4::Window::builder()
|
||||||
.decorated(false)
|
.decorated(false)
|
||||||
|
|
@ -21,6 +29,7 @@ fn main() {
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.width_request(1)
|
.width_request(1)
|
||||||
.height_request(1)
|
.height_request(1)
|
||||||
|
.css_classes(vec!["root_window".to_string()])
|
||||||
.build()
|
.build()
|
||||||
.show();
|
.show();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ impl ObjectImpl for StatusMenuInner {
|
||||||
|
|
||||||
let menu_button = cascade! {
|
let menu_button = cascade! {
|
||||||
gtk4::MenuButton::new();
|
gtk4::MenuButton::new();
|
||||||
|
..add_css_class("panel_icon");
|
||||||
..set_has_frame(false);
|
..set_has_frame(false);
|
||||||
..set_parent(obj);
|
..set_parent(obj);
|
||||||
..set_popover(Some(&popover));
|
..set_popover(Some(&popover));
|
||||||
|
|
|
||||||
33
applets/cosmic-applet-status-area/src/style.css
Normal file
33
applets/cosmic-applet-status-area/src/style.css
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
.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