mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
refactor(custon): hide on empty text
This commit is contained in:
parent
5fdb122829
commit
be2fa743eb
@ -39,7 +39,7 @@ def on_metadata(player, metadata, manager):
|
|||||||
track_info = '{artist} - {title}'.format(artist=player.get_artist(),
|
track_info = '{artist} - {title}'.format(artist=player.get_artist(),
|
||||||
title=player.get_title())
|
title=player.get_title())
|
||||||
|
|
||||||
if player.props.status != 'Playing':
|
if player.props.status != 'Playing' and track_info:
|
||||||
track_info = ' ' + track_info
|
track_info = ' ' + track_info
|
||||||
write_output(track_info, player)
|
write_output(track_info, player)
|
||||||
|
|
||||||
|
@ -123,9 +123,12 @@ auto waybar::modules::Custom::update() -> void {
|
|||||||
for (auto const& c : class_) {
|
for (auto const& c : class_) {
|
||||||
label_.get_style_context()->add_class(c);
|
label_.get_style_context()->add_class(c);
|
||||||
}
|
}
|
||||||
|
if (text_.empty()) {
|
||||||
|
event_box_.hide();
|
||||||
|
} else {
|
||||||
event_box_.show();
|
event_box_.show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void waybar::modules::Custom::parseOutputRaw() {
|
void waybar::modules::Custom::parseOutputRaw() {
|
||||||
|
Loading…
Reference in New Issue
Block a user