diff options
-rw-r--r-- | doc/default_theme.rasi | 9 | ||||
-rw-r--r-- | doc/old-theme-convert-output.rasi | 9 | ||||
-rw-r--r-- | lexer/theme-lexer.l | 1 | ||||
-rw-r--r-- | source/theme.c | 12 |
4 files changed, 26 insertions, 5 deletions
diff --git a/doc/default_theme.rasi b/doc/default_theme.rasi index ebf9bbbb..0838d7e2 100644 --- a/doc/default_theme.rasi +++ b/doc/default_theme.rasi @@ -116,9 +116,10 @@ button selected { text-color: @selected-normal-foreground; } inputbar { - spacing: 3px ; + spacing: 0px ; text-color: @normal-foreground; padding: 1px ; + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; } case-indicator { spacing: 0; @@ -132,3 +133,9 @@ prompt { spacing: 0; text-color: @normal-foreground; } +textbox-prompt-colon { + expand: false; + str: ":"; + margin: 0px 0.3000em 0.0000em 0.0000em ; + text-color: inherit; +} diff --git a/doc/old-theme-convert-output.rasi b/doc/old-theme-convert-output.rasi index fb2c578d..77c00ebf 100644 --- a/doc/old-theme-convert-output.rasi +++ b/doc/old-theme-convert-output.rasi @@ -116,9 +116,10 @@ button selected { text-color: @selected-normal-foreground; } inputbar { - spacing: 3px ; + spacing: 0px ; text-color: @normal-foreground; padding: 1px ; + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; } case-indicator { spacing: 0; @@ -132,3 +133,9 @@ prompt { spacing: 0; text-color: @normal-foreground; } +textbox-prompt-colon { + expand: false; + str: ":"; + margin: 0px 0.3000em 0.0000em 0.0000em ; + text-color: inherit; +} diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l index e7430355..de53f546 100644 --- a/lexer/theme-lexer.l +++ b/lexer/theme-lexer.l @@ -167,7 +167,6 @@ STRING \"{UANYN}*\" HEX [[:xdigit:]] NUMBER [[:digit:]] PNNUMBER [-+]?[[:digit:]]+ -REAL [-+]?[[:digit:]]+(\.[[:digit:]]+)? PX (px) EM (em) CH (ch) diff --git a/source/theme.c b/source/theme.c index e0a5dfbb..fa7203c3 100644 --- a/source/theme.c +++ b/source/theme.c @@ -139,16 +139,24 @@ void rofi_theme_free ( ThemeWidget *widget ) /** * print */ +inline static void printf_double ( double d ) +{ + char buf[G_ASCII_DTOSTR_BUF_SIZE]; + g_ascii_formatd ( buf, G_ASCII_DTOSTR_BUF_SIZE,"%.4lf", d ); + fputs ( buf, stdout ); +} static void rofi_theme_print_distance ( RofiDistance d ) { if ( d.type == ROFI_PU_PX ) { printf ( "%upx ", (unsigned int) d.distance ); } else if ( d.type == ROFI_PU_PERCENT ) { - printf ( "%f%% ", d.distance ); + printf_double ( d.distance ); + fputs ( "%% ", stdout ); } else { - printf ( "%fem ", d.distance ); + printf_double ( d.distance ); + fputs ( "em ", stdout ); } if ( d.style == ROFI_HL_DASH ) { printf ( "dash " ); |