summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-06-22 08:54:29 +0200
committerDave Davenport <qball@gmpclient.org>2017-06-22 08:54:29 +0200
commite28b038d6254a5c4e1444454730ee6e2d32fbd58 (patch)
tree1f4f329d36c66d09dd7898876f3f6141bc41e296
parent8f8c43e50d15c614d1c42a5d515c15ff48d65a1b (diff)
Check user data dir when looking for theme.
- set default textbox color to black.
-rw-r--r--source/helper.c15
-rw-r--r--source/widgets/textbox.c2
2 files changed, 16 insertions, 1 deletions
diff --git a/source/helper.c b/source/helper.c
index fbae3ef6..6cd8ccd4 100644
--- a/source/helper.c
+++ b/source/helper.c
@@ -1025,6 +1025,7 @@ gboolean helper_execute_command ( const char *wd, const char *cmd, gboolean run_
char *helper_get_theme_path ( const char *file )
{
char *filename = rofi_expand_path ( file );
+ g_debug ( "Opening theme, testing: %s\n", filename );
if ( g_file_test ( filename, G_FILE_TEST_EXISTS ) ) {
return filename;
}
@@ -1040,15 +1041,29 @@ char *helper_get_theme_path ( const char *file )
const char *cpath = g_get_user_config_dir ();
if ( cpath ) {
char *themep = g_build_filename ( cpath, "rofi", filename, NULL );
+ g_debug ( "Opening theme, testing: %s\n", themep );
if ( g_file_test ( themep, G_FILE_TEST_EXISTS ) ) {
g_free ( filename );
return themep;
}
g_free ( themep );
}
+ const char * datadir = g_get_user_data_dir();
+ if ( datadir ) {
+ char *theme_path = g_build_filename ( datadir, "rofi", "themes", filename, NULL );
+ g_debug ( "Opening theme, testing: %s\n", theme_path );
+ if ( theme_path ) {
+ if ( g_file_test ( theme_path, G_FILE_TEST_EXISTS ) ) {
+ g_free ( filename );
+ return theme_path;
+ }
+ g_free ( theme_path );
+ }
+ }
char *theme_path = g_build_filename ( THEME_DIR, filename, NULL );
if ( theme_path ) {
+ g_debug ( "Opening theme, testing: %s\n", theme_path );
if ( g_file_test ( theme_path, G_FILE_TEST_EXISTS ) ) {
g_free ( filename );
return theme_path;
diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c
index 9a084499..6b83c57d 100644
--- a/source/widgets/textbox.c
+++ b/source/widgets/textbox.c
@@ -449,7 +449,7 @@ static void textbox_draw ( widget *wid, cairo_t *draw )
}
// TODO check if this is still needed after flatning.
cairo_set_operator ( draw, CAIRO_OPERATOR_OVER );
-
+ cairo_set_source_rgb ( draw, 0.0, 0.0, 0.0 );
rofi_theme_get_color ( WIDGET ( tb ), "foreground", draw );
// Text
rofi_theme_get_color ( WIDGET ( tb ), "text", draw );