mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-25 13:55:34 -05:00
[Textbox] Set pango align based on horizontal-align
This commit is contained in:
parent
4f3adefeda
commit
69387d6336
1 changed files with 8 additions and 0 deletions
|
@ -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 = rofi_theme_get_double(WIDGET(tb), "horizontal-align", xalign);
|
||||||
tb->xalign = MAX(0, MIN(1.0, tb->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;
|
return tb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue