summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-10-02 17:33:41 +0200
committerDave Davenport <qball@gmpclient.org>2017-10-02 17:33:41 +0200
commit2a1460c038d3c6b3f5a8f898d9a44f1a28fcc3be (patch)
tree95294d3b3abd8fa9256a1aea8993ba325e9c52eb
parent8da55024c55de3c4444a32c98e3af41819bc4074 (diff)
Move ':' inside theme.
-rw-r--r--doc/default_theme.rasi12
-rw-r--r--doc/old-theme-convert-output.rasi12
-rw-r--r--include/default-theme.h8
-rw-r--r--source/view.c19
-rw-r--r--themes/arthur.rasi7
-rw-r--r--themes/dmenu.rasi2
6 files changed, 42 insertions, 18 deletions
diff --git a/doc/default_theme.rasi b/doc/default_theme.rasi
index 67a606cb..ec741e97 100644
--- a/doc/default_theme.rasi
+++ b/doc/default_theme.rasi
@@ -113,9 +113,11 @@
text-color: @selected-normal-foreground;
}
#inputbar {
- spacing: 0;
- text-color: @normal-foreground;
- padding: 1px ;
+ spacing: 4;
+ padding: 1px ;
+}
+#prompt-box {
+ spacing: 0;
}
#case-indicator {
spacing: 0;
@@ -129,3 +131,7 @@
spacing: 0;
text-color: @normal-foreground;
}
+#prompt-colon {
+ spacing: 0;
+ text-color: @normal-foreground;
+}
diff --git a/doc/old-theme-convert-output.rasi b/doc/old-theme-convert-output.rasi
index 266c7767..fac6dfed 100644
--- a/doc/old-theme-convert-output.rasi
+++ b/doc/old-theme-convert-output.rasi
@@ -113,9 +113,11 @@
text-color: @selected-normal-foreground;
}
#inputbar {
- spacing: 0;
- text-color: @normal-foreground;
- padding: 1px ;
+ spacing: 4;
+ padding: 1px ;
+}
+#prompt-box {
+ spacing: 0;
}
#case-indicator {
spacing: 0;
@@ -129,3 +131,7 @@
spacing: 0;
text-color: @normal-foreground;
}
+#prompt-colon {
+ spacing: 0;
+ text-color: @normal-foreground;
+}
diff --git a/include/default-theme.h b/include/default-theme.h
index f866d49f..32bd0358 100644
--- a/include/default-theme.h
+++ b/include/default-theme.h
@@ -137,7 +137,13 @@ const char *default_theme =
" background-color: @selected-normal-background;"
" text-color: @selected-normal-foreground;"
"}"
- "#inputbar, case-indicator, entry, prompt, button {"
+ "#inputbar {"
+ " spacing: 4;"
+ "}"
+ "#prompt-box {"
+ " spacing: 0;"
+ "}"
+ "#case-indicator, entry, prompt,prompt-colon,button {"
" spacing: 0;"
" text-color: @normal-foreground;"
"}";
diff --git a/source/view.c b/source/view.c
index 0e3f8ffe..780ca472 100644
--- a/source/view.c
+++ b/source/view.c
@@ -245,9 +245,7 @@ static void rofi_view_update_prompt ( RofiViewState *state )
if ( state->prompt ) {
const char *str = mode_get_display_name ( state->sw );
if ( ( state->menu_flags & MENU_PROMPT_COLON ) != 0 ) {
- char *pr = g_strconcat ( str, ":", NULL );
- textbox_text ( state->prompt, pr );
- g_free ( pr );
+ textbox_text ( state->prompt, str );
}
else {
textbox_text ( state->prompt, str );
@@ -1535,9 +1533,22 @@ static void rofi_view_add_widget ( RofiViewState *state, widget *parent_widget,
*/
else if ( strcmp ( name, "inputbar" ) == 0 ) {
wid = (widget *) box_create ( parent_widget, name, ROFI_ORIENTATION_HORIZONTAL );
- defaults = "prompt,entry,case-indicator";
+ defaults = "prompt-box,entry,case-indicator";
+ box_add ( (box *) parent_widget, WIDGET ( wid ), FALSE );
+ }
+ /**
+ * Prompt box
+ */
+ else if ( strcmp ( name, "prompt-box" ) == 0 ) {
+ wid = (widget *) box_create ( parent_widget, name, ROFI_ORIENTATION_HORIZONTAL );
+ defaults = "prompt,prompt-colon";
box_add ( (box *) parent_widget, WIDGET ( wid ), FALSE );
}
+ else if ( strcmp ( name, "prompt-colon" ) == 0 ) {
+ widget *pc = (widget *) textbox_create ( parent_widget, WIDGET_TYPE_TEXTBOX_TEXT, name, TB_AUTOWIDTH | TB_AUTOHEIGHT, NORMAL, ":", 0, 0 );
+ box_add ( (box *) parent_widget, WIDGET ( pc ), FALSE );
+ defaults = NULL;
+ }
/**
* PROMPT
*/
diff --git a/themes/arthur.rasi b/themes/arthur.rasi
index 061b33ec..eddeca61 100644
--- a/themes/arthur.rasi
+++ b/themes/arthur.rasi
@@ -18,11 +18,6 @@ configuration {
show-icons: true;
}
-
-/**
- * User: Qball
- * Copyright: Dave Davenport
- */
* {
foreground: #ffeedd;
backlight: #ccffeedd;
@@ -108,7 +103,7 @@ configuration {
border-color: @foreground;
font: "Sauce Code Pro 18";
}
-#entry,prompt,case-indicator {
+#entry,prompt,prompt-colon,prompt-box,case-indicator {
text-font: inherit;
text-color:inherit;
}
diff --git a/themes/dmenu.rasi b/themes/dmenu.rasi
index 40f3bdac..f202c765 100644
--- a/themes/dmenu.rasi
+++ b/themes/dmenu.rasi
@@ -23,7 +23,7 @@ configuration {
#horibox {
orientation: horizontal;
- children: [ prompt, entry, listview ];
+ children: [ prompt-box, entry, listview ];
}
#listview {