summaryrefslogtreecommitdiffstats
path: root/source/widgets/textbox.c
diff options
context:
space:
mode:
authorDave Davenport <qball@blame.services>2022-05-27 11:10:13 +0200
committerDave Davenport <qball@blame.services>2022-05-27 11:10:13 +0200
commit69387d63368f297025d6159a485a0340b8c566ef (patch)
tree1d44f9ab487e3660976b6a5cb6741cf96c722510 /source/widgets/textbox.c
parent4f3adefedaf8b6faf1866333f707fe09ed764d40 (diff)
[Textbox] Set pango align based on horizontal-align
Diffstat (limited to 'source/widgets/textbox.c')
-rw-r--r--source/widgets/textbox.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c
index 93d4c4d7..2282eafd 100644
--- a/source/widgets/textbox.c
+++ b/source/widgets/textbox.c
@@ -255,6 +255,14 @@ textbox *textbox_create(widget *parent, WidgetType type, const char *name,
tb->xalign = rofi_theme_get_double(WIDGET(tb), "horizontal-align", xalign);
tb->xalign = MAX(0, MIN(1.0, tb->xalign));
+ if (tb->xalign < 0.2) {
+ pango_layout_set_alignment(tb->layout, PANGO_ALIGN_LEFT);
+ } else if (tb->xalign < 0.8) {
+ pango_layout_set_alignment(tb->layout, PANGO_ALIGN_CENTER);
+ } else {
+ pango_layout_set_alignment(tb->layout, PANGO_ALIGN_RIGHT);
+ }
+
return tb;
}