Iced graphics applet (#26)

* feat: builds deb

* feat: working iced graphics applet

* fix: update deps to get fixes for iced-sctk

* fix: better popup size

* fix: better styling of button & popup

* fix: better popup container

* feat: sticky graphics mode after selection

* fix: refactor & handle close requests
This commit is contained in:
Ashley Wulber 2022-11-17 16:38:48 +01:00 committed by GitHub
parent e3be1c1809
commit eab7ddea1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 3836 additions and 360 deletions

View file

@ -2,7 +2,7 @@
use crate::dbus::PowerDaemonProxy;
use zbus::Result;
#[derive(PartialEq, Eq)]
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
pub enum Graphics {
Integrated,
Hybrid,
@ -10,7 +10,7 @@ pub enum Graphics {
Compute,
}
pub async fn get_current_graphics(daemon: &PowerDaemonProxy<'_>) -> Result<Graphics> {
pub async fn get_current_graphics(daemon: PowerDaemonProxy<'_>) -> Result<Graphics> {
let graphics = daemon.get_graphics().await?;
match graphics.as_str() {
"integrated" => Ok(Graphics::Integrated),
@ -21,7 +21,7 @@ pub async fn get_current_graphics(daemon: &PowerDaemonProxy<'_>) -> Result<Graph
}
}
pub async fn set_graphics(daemon: &PowerDaemonProxy<'_>, graphics: Graphics) -> Result<()> {
pub async fn set_graphics(daemon: PowerDaemonProxy<'_>, graphics: Graphics) -> Result<()> {
let graphics_str = match graphics {
Graphics::Integrated => "integrated",
Graphics::Hybrid => "hybrid",