diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-05-28 18:05:02 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-05-28 18:05:02 +0200 |
commit | 28f116b4a20ae36791bc767bba17b76ba9f52ee0 (patch) | |
tree | 2e62d9af0ee418ff534f249149cf49ba7224db11 /source | |
parent | fff06fc88046be27394b131c252c95658e43a1c7 (diff) |
Allow textbox to be added in theme
Diffstat (limited to 'source')
-rw-r--r-- | source/view.c | 6 | ||||
-rw-r--r-- | source/widgets/textbox.c | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/source/view.c b/source/view.c index 269b2592..b8cd6424 100644 --- a/source/view.c +++ b/source/view.c @@ -1678,8 +1678,10 @@ static void rofi_view_add_widget ( RofiViewState *state, widget *parent_widget, } g_free(strbutton); } - } - else { + } else if ( g_ascii_strncasecmp ( name, "textbox", 7) == 0 ){ + textbox *t = textbox_create ( str, TB_WRAP, NORMAL, ""); + box_add ( (box *)parent_widget, WIDGET(t), TRUE, 0); + } else { wid = box_create ( strbox, BOX_VERTICAL ); box_add ( (box *)parent_widget, WIDGET ( wid ), TRUE, 0 ); //g_error("The widget %s does not exists. Invalid layout.", name); diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c index a581c529..624549ed 100644 --- a/source/widgets/textbox.c +++ b/source/widgets/textbox.c @@ -154,7 +154,9 @@ textbox* textbox_create ( const char *name, TextboxFlags flags, TextBoxFontType if ( ( flags & TB_WRAP ) == TB_WRAP ) { pango_layout_set_wrap ( tb->layout, PANGO_WRAP_WORD_CHAR ); } - textbox_text ( tb, text ? text : "" ); + + const char *txt = rofi_theme_get_string ( WIDGET ( tb ), "str", text); + textbox_text ( tb, txt? txt: "" ); textbox_cursor_end ( tb ); // auto height/width modes get handled here |