Check user data dir when looking for theme.

- set default textbox color to black.
This commit is contained in:
Dave Davenport 2017-06-22 08:54:29 +02:00
parent 8f8c43e50d
commit e28b038d62
2 changed files with 16 additions and 1 deletions

View File

@ -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;

View File

@ -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 );