mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
feat: hide module if empty
This commit is contained in:
parent
3043d42a89
commit
e235f48245
@ -161,6 +161,7 @@ At the time of writing, the experimental features of BlueZ need to be turned on,
|
||||
"bluetooth": {
|
||||
// "controller": "controller1", // specify the alias of the controller if there are more than 1 on the system
|
||||
"format": " {status}",
|
||||
"format-disabled": "", // an empty format will hide the module
|
||||
"format-connected": " {num_connections} connected",
|
||||
"tooltip-format": "{controller_alias}\\t{controller_address}",
|
||||
"tooltip-format-connected": "{controller_alias}\\t{controller_address}\\n\\n{device_enumerate}",
|
||||
|
@ -171,6 +171,8 @@ auto waybar::modules::Bluetooth::update() -> void {
|
||||
tooltip_format = config_["tooltip-format"].asString();
|
||||
}
|
||||
|
||||
format_.empty() ? event_box_.hide() : event_box_.show();
|
||||
|
||||
auto update_style_context = [this](const std::string& style_class, bool in_next_state) {
|
||||
if (in_next_state && !label_.get_style_context()->has_class(style_class)) {
|
||||
label_.get_style_context()->add_class(style_class);
|
||||
|
Loading…
Reference in New Issue
Block a user