Skip to content

Commit

Permalink
0.4.3: Experimental child widgets inside boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
vars1ty committed Feb 4, 2023
1 parent c1fd5c6 commit 9d428d4
Show file tree
Hide file tree
Showing 14 changed files with 270 additions and 66 deletions.
80 changes: 52 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "hybrid-bar"
authors = [ "varsity <[email protected]>" ]
version = "0.4.2"
version = "0.4.3"
edition = "2021"
description = "A simple status bar made for wlroots compositors."
license = "MIT"
Expand Down
18 changes: 18 additions & 0 deletions EXPERIMENTAL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Experimental Features
> **Warning**: Experimental features are under development. They may break, change or be removed entirely.
1. Widgets inside boxes
- Introduced in version `0.4.3`
- New key inside the `box` widget: `widgets`
```json
{
"left-box_my_box": {
"width": 20,
"widgets": {
"label_experimental": {
"text": "Experimental"
}
}
}
}
```
4 changes: 4 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@
- Can I change the namespace for blurring Hybrid Bar on Hyprland?
- **Available since 0.3.9**
- Yes you can thanks to this PR: https://github.com/vars1ty/HybridBar/pull/27, option: `hybrid` -> `namespace` (`String`)

- How do I activate experimental features?
> **Warning** Experimental features may change, be removed entirely or break at any time.
- Set `hybrid` -> `experimental` (`bool`) to `true`, then restart Hybrid.
8 changes: 7 additions & 1 deletion WIDGETS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Widgets
**NOTE**: In order to use a widget, you'll have to specify how it should be aligned. For example: `left-button`, `centered-button` and `right-button`.
> **Note**
> If you add widgets that aren't attached to a `box` widget, you have to specify how the widget should be placed.
>
> For example: `left-label_UNIQUE_NAME`
>
> For child widgets inside of boxes, you can simply define the widget as `label_UNIQUE_NAME`.
Available widgets:

Expand Down Expand Up @@ -31,6 +36,7 @@ Keys Supported:

Keys Supported:
- width: i32
- widgets: JSON - **EXPERIMENTAL**
***
`cava`:

Expand Down
8 changes: 8 additions & 0 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,11 @@ macro_rules! conf_bool {
}
};
}

#[macro_export]
/// Are experimental features enabled?
macro_rules! experimental {
() => {
conf_bool!($crate::constants::HYBRID_ROOT_JSON, "experimental", false)
};
}
Loading

0 comments on commit 9d428d4

Please sign in to comment.