From 9313d7a8a0bc2bd2577afa7839987439062df93a Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Mon, 28 Dec 2020 22:45:58 +0100 Subject: [PATCH] [Textbox] Allow theme to force markup enabled on textbox. rofi -theme-str 'prompt { markup: true; }' -show drun -display-drun 'drun' fixes: #1220 --- source/widgets/textbox.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c index 5134e6aa..f595238c 100644 --- a/source/widgets/textbox.c +++ b/source/widgets/textbox.c @@ -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 ); }