Skip to content

Commit

Permalink
Issue Alexays#3375: use tooltipMarkupEnabled() in mpris
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertMueller2 committed Jul 20, 2024
1 parent 93ac12f commit 3f7b164
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions man/waybar-mpris.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ The *mpris* module displays currently playing media via libplayerctl.
typeof: string ++
The status-specific tooltip format.

*tooltip-with-markup*: ++
typeof: bool ++
default: true ++
Whether to accept pango markup in the tooltip.

*artist-len*: ++
typeof: integer ++
Maximum length of the Artist tag (Wide/Fullwidth Unicode characters count as two). Set to zero to hide the artist in `{dynamic}` tag.
Expand Down
7 changes: 6 additions & 1 deletion src/modules/mpris/mpris.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,12 @@ auto Mpris::update() -> void {
fmt::arg("player_icon", getIconFromJson(config_["player-icons"], info.name)),
fmt::arg("status_icon", getIconFromJson(config_["status-icons"], info.status_string)));

label_.set_tooltip_text(tooltip_text);
if (tooltipMarkupEnabled()) {
label_.set_tooltip_markup(tooltip_text);
}
else {
label_.set_tooltip_text(tooltip_text);
}
} catch (fmt::format_error const& e) {
spdlog::warn("mpris: format error (tooltip): {}", e.what());
}
Expand Down

0 comments on commit 3f7b164

Please sign in to comment.