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

[Textbox] Allow theme to force markup enabled on textbox.

rofi -theme-str 'prompt { markup: true; }' -show drun -display-drun '<i>d</i>ru<b>n</b>'

fixes: #1220
This commit is contained in:
Dave Davenport 2020-12-28 22:45:58 +01:00
parent af6752c35d
commit 9313d7a8a0

View file

@ -183,10 +183,15 @@ textbox* textbox_create ( widget *parent, WidgetType type, const char *name, Tex
textbox_initialize_font ( tb );
if ( ( flags & TB_WRAP ) == TB_WRAP ) {
if ( ( tb->flags & TB_WRAP ) == TB_WRAP ) {
pango_layout_set_wrap ( tb->layout, PANGO_WRAP_WORD_CHAR );
}
// Allow overriding of markup.
if ( rofi_theme_get_boolean ( WIDGET ( tb ), "markup", FALSE) ) {
tb->flags |= TB_MARKUP;
}
const char *txt = rofi_theme_get_string ( WIDGET ( tb ), "str", text );
if ( txt == NULL || ( *txt ) == '\0' ) {
txt = rofi_theme_get_string ( WIDGET ( tb ), "content", text );
@ -203,7 +208,7 @@ textbox* textbox_create ( widget *parent, WidgetType type, const char *name, Tex
tb->blink_timeout = 0;
tb->blink = 1;
if ( ( flags & TB_EDITABLE ) == TB_EDITABLE ) {
if ( ( tb->flags & TB_EDITABLE ) == TB_EDITABLE ) {
if ( rofi_theme_get_boolean ( WIDGET ( tb ), "blink", TRUE ) ) {
tb->blink_timeout = g_timeout_add ( 1200, textbox_blink, tb );
}