mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-11 13:50:48 -05:00
Check user data dir when looking for theme.
- set default textbox color to black.
This commit is contained in:
parent
8f8c43e50d
commit
e28b038d62
2 changed files with 16 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue