mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-11-01 00:12:42 +01:00 
			
		
		
		
	feat(idle-inhibitor): add tooltip format
This commit is contained in:
		| @@ -72,6 +72,14 @@ screensaving, also known as "presentation mode". | ||||
| 	default: true ++ | ||||
| 	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 | ||||
|  | ||||
| *{status}*: status (*activated* or *deactivated*) | ||||
|   | ||||
| @@ -62,7 +62,17 @@ auto waybar::modules::IdleInhibitor::update() -> void { | ||||
|                                 fmt::arg("icon", getIcon(0, status_text)))); | ||||
|   label_.get_style_context()->add_class(status_text); | ||||
|   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 | ||||
|   ALabel::update(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 asas1asas200
					asas1asas200