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:
parent
e3be1c1809
commit
eab7ddea1d
15 changed files with 3836 additions and 360 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue