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:
parent
393800aaa2
commit
3cf9be89fd
12 changed files with 75 additions and 40 deletions
10
src/image.rs
10
src/image.rs
|
@ -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(':')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue