1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-01 02:31:04 +02:00

feat: global icon theme setting

BREAKING CHANGE: This removes the `icon_theme` option from `launcher` and `focused`. You will need to set this at the top of your config instead.
This commit is contained in:
Jake Stanger 2023-01-29 18:38:57 +00:00
parent 393800aaa2
commit 3cf9be89fd
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
12 changed files with 75 additions and 40 deletions

View file

@ -8,7 +8,7 @@ use crate::{await_sync, read_lock, send, write_lock, Config};
use color_eyre::Result;
use gtk::gdk::{EventMask, Monitor, ScrollDirection};
use gtk::prelude::*;
use gtk::{Application, ApplicationWindow, EventBox, Orientation, Widget};
use gtk::{Application, ApplicationWindow, EventBox, IconTheme, Orientation, Widget};
use std::sync::{Arc, RwLock};
use tokio::spawn;
use tokio::sync::mpsc;
@ -140,6 +140,11 @@ fn load_modules(
monitor: &Monitor,
output_name: &str,
) -> Result<()> {
let icon_theme = IconTheme::new();
if let Some(ref theme) = config.icon_theme {
icon_theme.set_custom_theme(Some(theme));
}
macro_rules! info {
($location:expr) => {
ModuleInfo {
@ -148,6 +153,7 @@ fn load_modules(
monitor,
output_name,
location: $location,
icon_theme: &icon_theme,
}
};
}