1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-04 20:21:02 +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

@ -35,6 +35,16 @@ impl<'a> ImageProvider<'a> {
Ok(Self { location, size })
}
/// Returns true if the input starts with a prefix
/// that is supported by the parser
/// (ie the parser would not fallback to checking the input).
pub fn is_definitely_image_input(input: &str) -> bool {
input.starts_with("icon:")
|| input.starts_with("file://")
|| input.starts_with("http://")
|| input.starts_with("https://")
}
fn get_location(input: String, theme: &'a IconTheme, size: i32) -> Result<ImageLocation> {
let (input_type, input_name) = input
.split_once(':')