Merge pull request #3580 from hramrach/rotate-doc
Clarify documentation of 'rotate' option.
This commit is contained in:
		
						commit
						59b7715309
					
				|  | @ -38,7 +38,7 @@ The *backlight* module displays the current backlight level. | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *states*: ++ | ||||
| 	typeof: object ++ | ||||
|  |  | |||
|  | @ -69,7 +69,7 @@ The *battery* module displays the current capacity and state (eg. charging) of y | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *on-click*: ++ | ||||
| 	typeof: string ++ | ||||
|  |  | |||
|  | @ -54,7 +54,7 @@ Addressed by *bluetooth* | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -51,7 +51,7 @@ $XDG_CONFIG_HOME/waybar/config ++ | |||
| |[ *rotate* | ||||
| :[ integer | ||||
| :[ | ||||
| :[ Positive value to rotate the text label | ||||
| :[ Positive value to rotate the text label (in 90 degree increments) | ||||
| |[ *on-click* | ||||
| :[ string | ||||
| :[ | ||||
|  |  | |||
|  | @ -43,7 +43,7 @@ The *cpu* module displays the current CPU utilization. | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *states*: ++ | ||||
| 	typeof: object ++ | ||||
|  |  | |||
|  | @ -64,7 +64,7 @@ Addressed by *custom/<name>* | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -29,7 +29,7 @@ Addressed by *disk* | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *states*: ++ | ||||
| 	typeof: object ++ | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ Addressed by *dwl/window* | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ Addressed by *hyprland/submap* | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -21,7 +21,7 @@ screensaver, also known as "presentation mode". | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -25,7 +25,7 @@ See *systemd-inhibit*(1) for more information. | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -51,7 +51,7 @@ Addressed by *jack* | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -29,7 +29,7 @@ Addressed by *memory* | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *states*: ++ | ||||
| 	typeof: object ++ | ||||
|  |  | |||
|  | @ -91,7 +91,7 @@ Addressed by *mpd* | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -107,7 +107,7 @@ The *mpris* module displays currently playing media via libplayerctl. | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -58,7 +58,7 @@ Addressed by *network* | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -40,7 +40,7 @@ Additionally, you can control the volume by scrolling *up* or *down* while the c | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *states*: ++ | ||||
| 	typeof: object ++ | ||||
|  |  | |||
|  | @ -21,7 +21,7 @@ Addressed by *river/layout* | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ Addressed by *river/mode* | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ Addressed by *river/window* | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -20,7 +20,7 @@ cursor is over the module, and clicking on the module toggles mute. | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ Addressed by *sway/mode* | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ Addressed by *sway/window* | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -60,7 +60,7 @@ Addressed by *temperature* | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *max-length*: ++ | ||||
| 	typeof: integer ++ | ||||
|  |  | |||
|  | @ -31,7 +31,7 @@ The *wireplumber* module displays the current volume reported by WirePlumber. | |||
| 
 | ||||
| *rotate*: ++ | ||||
| 	typeof: integer ++ | ||||
| 	Positive value to rotate the text label. | ||||
| 	Positive value to rotate the text label (in 90 degree increments). | ||||
| 
 | ||||
| *states*: ++ | ||||
| 	typeof: object ++ | ||||
|  |  | |||
|  | @ -45,6 +45,8 @@ ALabel::ALabel(const Json::Value& config, const std::string& name, const std::st | |||
| 
 | ||||
|   if (config_["rotate"].isUInt()) { | ||||
|     rotate = config["rotate"].asUInt(); | ||||
|     if (not (rotate == 0 || rotate == 90 || rotate == 180 || rotate == 270)) | ||||
|       spdlog::warn("'rotate' is only supported in 90 degree increments {} is not valid.", rotate); | ||||
|     label_.set_angle(rotate); | ||||
|   } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue