refactor(custon): hide on empty text

pull/364/head
Alex 2019-05-27 00:05:21 +02:00
parent 5fdb122829
commit be2fa743eb
2 changed files with 6 additions and 3 deletions

View File

@ -39,7 +39,7 @@ def on_metadata(player, metadata, manager):
track_info = '{artist} - {title}'.format(artist=player.get_artist(),
title=player.get_title())
if player.props.status != 'Playing':
if player.props.status != 'Playing' and track_info:
track_info = '' + track_info
write_output(track_info, player)

View File

@ -123,10 +123,13 @@ auto waybar::modules::Custom::update() -> void {
for (auto const& c : class_) {
label_.get_style_context()->add_class(c);
}
if (text_.empty()) {
event_box_.hide();
} else {
event_box_.show();
}
}
}
void waybar::modules::Custom::parseOutputRaw() {
std::istringstream output(output_.out);