Merge pull request #2887 from dann-merlin/master
Add justify config option for Labelspull/2372/head^2
commit
4c46d7d245
|
@ -30,7 +30,11 @@ The *backlight* module displays the current backlight level.
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
|
|
@ -61,7 +61,11 @@ The *battery* module displays the current capacity and state (eg. charging) of y
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer++
|
typeof: integer++
|
||||||
|
|
|
@ -66,7 +66,11 @@ Addressed by *bluetooth*
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -35,7 +35,11 @@ The *cpu* module displays the current CPU utilization.
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*rotate*: ++
|
*rotate*: ++
|
||||||
typeof: integer ++
|
typeof: integer ++
|
||||||
|
|
|
@ -72,7 +72,11 @@ Addressed by *custom/<name>*
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -45,7 +45,11 @@ Addressed by *disk*
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -31,7 +31,11 @@ Addressed by *hyprland/submap*
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -33,7 +33,11 @@ screensaver, also known as "presentation mode".
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -37,7 +37,11 @@ See *systemd-inhibit*(1) for more information.
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -63,7 +63,11 @@ Addressed by *jack*
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -45,7 +45,11 @@ Addressed by *memory*
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -103,7 +103,11 @@ Addressed by *mpd*
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -119,8 +119,11 @@ The *mpris* module displays currently playing media via libplayerctl.
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. ++
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
If the module is rotated, it will follow the flow of the text.
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -70,7 +70,11 @@ Addressed by *network*
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -56,7 +56,11 @@ Additionally, you can control the volume by scrolling *up* or *down* while the c
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*scroll-step*: ++
|
*scroll-step*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
|
|
|
@ -33,7 +33,11 @@ Addressed by *river/layout*
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -31,7 +31,11 @@ Addressed by *river/mode*
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -31,7 +31,11 @@ Addressed by *river/window*
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -32,7 +32,11 @@ cursor is over the module, and clicking on the module toggles mute.
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*scroll-step*: ++
|
*scroll-step*: ++
|
||||||
typeof: int ++
|
typeof: int ++
|
||||||
|
|
|
@ -31,7 +31,11 @@ Addressed by *sway/mode*
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -31,7 +31,11 @@ Addressed by *sway/window*
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -71,7 +71,11 @@ Addressed by *temperature*
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*on-click*: ++
|
*on-click*: ++
|
||||||
typeof: string ++
|
typeof: string ++
|
||||||
|
|
|
@ -47,7 +47,11 @@ The *wireplumber* module displays the current volume reported by WirePlumber.
|
||||||
|
|
||||||
*align*: ++
|
*align*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
The alignment of the label within the module, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text.
|
||||||
|
|
||||||
|
*justify*: ++
|
||||||
|
typeof: string ++
|
||||||
|
The alignment of the text within the module's label, allowing options 'left', 'right', or 'center' to define the positioning.
|
||||||
|
|
||||||
*scroll-step*: ++
|
*scroll-step*: ++
|
||||||
typeof: float ++
|
typeof: float ++
|
||||||
|
|
|
@ -50,6 +50,17 @@ ALabel::ALabel(const Json::Value& config, const std::string& name, const std::st
|
||||||
label_.set_xalign(align);
|
label_.set_xalign(align);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config_["justify"].isString()) {
|
||||||
|
auto justify_str = config_["justify"].asString();
|
||||||
|
if (justify_str == "left") {
|
||||||
|
label_.set_justify(Gtk::Justification::JUSTIFY_LEFT);
|
||||||
|
} else if (justify_str == "right") {
|
||||||
|
label_.set_justify(Gtk::Justification::JUSTIFY_RIGHT);
|
||||||
|
} else if (justify_str == "center") {
|
||||||
|
label_.set_justify(Gtk::Justification::JUSTIFY_CENTER);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ALabel::update() -> void { AModule::update(); }
|
auto ALabel::update() -> void { AModule::update(); }
|
||||||
|
|
Loading…
Reference in New Issue