1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-11 13:50:48 -05:00

[Textbox] Set pango align based on horizontal-align

This commit is contained in:
Dave Davenport 2022-05-27 11:10:13 +02:00
parent 4f3adefeda
commit 69387d6336

View file

@ -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;
}