Skip to content

Commit

Permalink
feat(tray): option to prefer theme-provided icons
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeStanger committed Mar 29, 2024
1 parent 004ea76 commit ba00445
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/modules/Tray.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Displays a fully interactive icon tray using the KDE `libappindicator` protocol.
Displays a fully interactive icon tray using the KDE `libappindicator` protocol.

![Screenshot showing icon tray widget](https://user-images.githubusercontent.com/5057870/184540135-78ffd79d-f802-4c79-b09a-05a733dadc55.png)

## Configuration

> Type: `tray`

| Name | Type | Default | Description |
|-------------|-----------|-----------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|
| `direction` | `string` | `left_to_right` if bar is horizontal, `top_to_bottom` otherwise | Direction to display the tray items. Possible values: `top_to_bottom`, `bottom_to_top`, `left_to_right`, `right_to_left` |
| `icon_size` | `integer` | `16` | Size in pixels to display tray icons as |
| Name | Type | Default | Description |
|----------------------|-----------|-----------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `direction` | `string` | `left_to_right` if bar is horizontal, `top_to_bottom` otherwise | Direction to display the tray items. Possible values: `top_to_bottom`, `bottom_to_top`, `left_to_right`, `right_to_left` |
| `icon_size` | `integer` | `16` | Size in pixels to display tray icons as. |
| `prefer_theme_icons` | `bool` | `true` | Requests that icons from the theme be used over the item-provided item. Most items only provide one or the other so this will have no effect in most circumstances. |

<details>
<summary>JSON</summary>
Expand Down Expand Up @@ -55,12 +55,12 @@ end:
```corn
{
end = [
end = [
{
type = "tray"
direction = "top_to_bottom"
type = "tray"
direction = "top_to_bottom"
}
]
]
}
```

Expand Down
3 changes: 3 additions & 0 deletions src/modules/tray/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ use tracing::{debug, error, warn};

#[derive(Debug, Deserialize, Clone)]
pub struct TrayModule {
#[serde(default = "crate::config::default_true")]
prefer_theme_icons: bool,

#[serde(default = "default_icon_size")]
icon_size: u32,

Expand Down

0 comments on commit ba00445

Please sign in to comment.