mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
feat(idle-inhibitor): add tooltip format
This commit is contained in:
parent
4deb6d812d
commit
55e83f90d1
@ -72,6 +72,14 @@ screensaving, also known as "presentation mode".
|
|||||||
default: true ++
|
default: true ++
|
||||||
Option to disable tooltip on hover.
|
Option to disable tooltip on hover.
|
||||||
|
|
||||||
|
*tooltip-format-activated*: ++
|
||||||
|
typeof: string ++
|
||||||
|
This format is used when the inhibit is activated.
|
||||||
|
|
||||||
|
*tooltip-format-deactivated*: ++
|
||||||
|
typeof: string ++
|
||||||
|
This format is used when the inhibit is deactivated.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{status}*: status (*activated* or *deactivated*)
|
*{status}*: status (*activated* or *deactivated*)
|
||||||
|
@ -62,7 +62,17 @@ auto waybar::modules::IdleInhibitor::update() -> void {
|
|||||||
fmt::arg("icon", getIcon(0, status_text))));
|
fmt::arg("icon", getIcon(0, status_text))));
|
||||||
label_.get_style_context()->add_class(status_text);
|
label_.get_style_context()->add_class(status_text);
|
||||||
if (tooltipEnabled()) {
|
if (tooltipEnabled()) {
|
||||||
label_.set_tooltip_text(status_text);
|
label_.set_tooltip_markup(
|
||||||
|
status ? fmt::format(config_["tooltip-format-activated"].isString()
|
||||||
|
? config_["tooltip-format-activated"].asString()
|
||||||
|
: "{status}",
|
||||||
|
fmt::arg("status", status_text),
|
||||||
|
fmt::arg("icon", getIcon(0, status_text)))
|
||||||
|
: fmt::format(config_["tooltip-format-deactivated"].isString()
|
||||||
|
? config_["tooltip-format-deactivated"].asString()
|
||||||
|
: "{status}",
|
||||||
|
fmt::arg("status", status_text),
|
||||||
|
fmt::arg("icon", getIcon(0, status_text))));
|
||||||
}
|
}
|
||||||
// Call parent update
|
// Call parent update
|
||||||
ALabel::update();
|
ALabel::update();
|
||||||
|
Loading…
Reference in New Issue
Block a user