Separate CosmicAppletWindow and CosmicAppletButton
This commit is contained in:
parent
74f6c2eca6
commit
aac43de65d
16 changed files with 421 additions and 343 deletions
|
|
@ -10,6 +10,7 @@ pub mod graphics;
|
|||
pub mod mode_box;
|
||||
|
||||
use self::{dbus::PowerDaemonProxy, graphics::Graphics, mode_box::ModeSelection};
|
||||
use cosmic_panel_config::config::CosmicPanelConfig;
|
||||
use gtk4::{
|
||||
gdk::Display,
|
||||
gio::ApplicationFlags,
|
||||
|
|
@ -20,7 +21,6 @@ use gtk4::{
|
|||
};
|
||||
use once_cell::sync::Lazy;
|
||||
use tokio::runtime::Runtime;
|
||||
use cosmic_panel_config::config::CosmicPanelConfig;
|
||||
|
||||
static RT: Lazy<Runtime> = Lazy::new(|| Runtime::new().expect("failed to build tokio runtime"));
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ fn build_ui(application: >k4::Application) {
|
|||
image.add_css_class("panel_icon");
|
||||
image.set_pixel_size(config.get_applet_icon_size().try_into().unwrap());
|
||||
button.set_child(Some(&image));
|
||||
let current_graphics = RT
|
||||
let current_graphics = RT
|
||||
.block_on(get_current_graphics())
|
||||
.expect("failed to connect to system76-power");
|
||||
view! {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue