progress_icon: Use adw::StyleManager to retrieve accent color

This commit is contained in:
DaPigGuy 2024-07-18 23:32:20 -07:00
parent d5645fb101
commit 59f8da0957
Failed to generate hash of commit
2 changed files with 2 additions and 5 deletions

View file

@ -14,7 +14,7 @@ opt-level = 1
opt-level = 3
[dependencies]
adw = {package = "libadwaita", version = "0.7", features = ["v1_5"]}
adw = {package = "libadwaita", version = "0.7", features = ["v1_6"]}
aes-gcm = "0.10"
anyhow = "1.0"
aperture = "0.7"

View file

@ -35,10 +35,7 @@ pub(crate) mod imp {
let size = widget.size() as f32;
let radius = size / 2.0;
let progress = 1.0 - widget.progress();
let color = widget
.style_context()
.lookup_color("accent_color")
.unwrap_or_else(|| gdk::RGBA::new(0.47058824, 0.68235296, 0.92941177, 1.0));
let color = adw::StyleManager::default().accent_color_rgba();
let rect = graphene::Rect::new(0.0, 0.0, size, size);
let circle = gsk::RoundedRect::from_rect(rect, radius);