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

feat: ability to configure image icon sizes

Adds `icon_size` option to following widgets:

- `clipboard`
- `launcher`
- `music`
- `workspaces`

Also adds `cover_image_size` option to `music`.
This commit is contained in:
Jake Stanger 2023-04-22 22:18:36 +01:00
parent 618e97f1e8
commit 2da28b9bf5
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
10 changed files with 83 additions and 25 deletions

View file

@ -21,6 +21,9 @@ pub struct ClipboardModule {
#[serde(default = "default_icon")]
icon: String,
#[serde(default = "default_icon_size")]
icon_size: i32,
#[serde(default = "default_max_items")]
max_items: usize,
@ -35,6 +38,10 @@ fn default_icon() -> String {
String::from("󰨸")
}
const fn default_icon_size() -> i32 {
32
}
const fn default_max_items() -> usize {
10
}
@ -120,7 +127,7 @@ impl Module<Button> for ClipboardModule {
) -> color_eyre::Result<ModuleWidget<Button>> {
let position = info.bar_position;
let button = new_icon_button(&self.icon, info.icon_theme, 32);
let button = new_icon_button(&self.icon, info.icon_theme, self.icon_size);
button.style_context().add_class("btn");
button.connect_clicked(move |button| {