diff options
author | Dave Davenport <qball@gmpclient.org> | 2020-12-28 22:45:58 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2020-12-28 22:45:58 +0100 |
commit | 9313d7a8a0bc2bd2577afa7839987439062df93a (patch) | |
tree | 0af6ab71d3f4fae692532112f0e7e8fa4b511578 | |
parent | af6752c35dd7d4a4b74c2dd2196be26ab11d5fa4 (diff) |
[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
-rw-r--r-- | source/widgets/textbox.c | 9 |
1 files 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 ); } |