mirror of
https://github.com/JakeStanger/ironbar.git
synced 2025-01-05 23:36:07 +03:00
feat(launcher): option to reverse order
* Add reverse order for launcher items/favorites * Add lanucher reverse order to docs * Add example configs for json,toml,yaml,corn --------- Co-authored-by: SerraPi <serrapm2@gmail.com>
This commit is contained in:
parent
782b9554a2
commit
d03c752f9a
@ -18,7 +18,7 @@ Optionally displays a launchable set of favourites.
|
||||
| `show_names` | `boolean` | `false` | Whether to show app names on the button label. Names will still show on tooltips when set to false. |
|
||||
| `show_icons` | `boolean` | `true` | Whether to show app icons on the button. |
|
||||
| `icon_size` | `integer` | `32` | Size to render icon at (image icons only). |
|
||||
|
||||
| `reversed` | `boolean` | `false` | Whether to reverse the order of favorites/items |
|
||||
<details>
|
||||
<summary>JSON</summary>
|
||||
|
||||
@ -32,7 +32,8 @@ Optionally displays a launchable set of favourites.
|
||||
"discord"
|
||||
],
|
||||
"show_names": false,
|
||||
"show_icons": true
|
||||
"show_icons": true,
|
||||
"reversed": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -51,6 +52,7 @@ type = "launcher"
|
||||
favorites = ["firefox", "discord"]
|
||||
show_names = false
|
||||
show_icons = true
|
||||
reversed = false
|
||||
```
|
||||
|
||||
</details>
|
||||
@ -66,6 +68,7 @@ start:
|
||||
- discord
|
||||
show_names: false
|
||||
show_icons: true
|
||||
reversed: false
|
||||
```
|
||||
|
||||
</details>
|
||||
@ -81,7 +84,7 @@ start:
|
||||
favorites = [ "firefox" "discord" ]
|
||||
show_names = false
|
||||
show_icons = true
|
||||
|
||||
reversed = false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -33,6 +33,9 @@ pub struct LauncherModule {
|
||||
#[serde(default = "default_icon_size")]
|
||||
icon_size: i32,
|
||||
|
||||
#[serde(default = "crate::config::default_false")]
|
||||
reversed: bool,
|
||||
|
||||
#[serde(flatten)]
|
||||
pub common: Option<CommonConfig>,
|
||||
}
|
||||
@ -338,7 +341,12 @@ impl Module<gtk::Box> for LauncherModule {
|
||||
&controller_tx,
|
||||
);
|
||||
|
||||
container.add(&button.button);
|
||||
if self.reversed {
|
||||
container.pack_end(&button.button, false, false, 0);
|
||||
} else {
|
||||
container.add(&button.button);
|
||||
}
|
||||
|
||||
buttons.insert(item.app_id, button);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user