mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Merge pull request #1678 from asas1asas200/zeng-feat-idle_inhibitor_tooltip
feat(idle-inhibitor): add tooltip format
This commit is contained in:
commit
38d2815425
@ -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