summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lexer/theme-lexer.l3
-rw-r--r--source/view.c6
-rw-r--r--source/widgets/textbox.c4
3 files changed, 9 insertions, 4 deletions
diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l
index 4f572436..4bb1c60a 100644
--- a/lexer/theme-lexer.l
+++ b/lexer/theme-lexer.l
@@ -394,7 +394,8 @@ if ( queue == NULL ){
<PROPERTIES>(true|false) { yylval->bval= g_strcmp0(yytext, "true") == 0; return T_BOOLEAN;}
<PROPERTIES>{PNNUMBER}\.{NUMBER}+ { yylval->fval = g_ascii_strtod(yytext, NULL); return T_DOUBLE;}
<PROPERTIES>{PNNUMBER} { yylval->ival = (int)g_ascii_strtoll(yytext, NULL, 10); return T_INT;}
-<PROPERTIES>\"{STRING}\" { yytext[yyleng-1] = '\0'; yylval->sval = g_strdup(&yytext[1]); return T_STRING;}
+<PROPERTIES>\"{STRING}\" { yytext[yyleng-1] = '\0'; yylval->sval = g_strcompress(&yytext[1]); return T_STRING;}
+
<PROPERTIES>@{WORD} {
yylval->sval = g_strdup(yytext);
return T_LINK;
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