mirror of
https://github.com/davatorium/rofi.git
synced 2025-07-31 21:59:25 -04:00
Fix icon_size and allow setting icon theme (for testing).
This commit is contained in:
parent
a43e4e5b12
commit
1be9438711
1 changed files with 5 additions and 1 deletions
|
@ -95,6 +95,8 @@ typedef struct
|
||||||
|
|
||||||
unsigned int expected_line_height;
|
unsigned int expected_line_height;
|
||||||
DRunModeEntry quit_entry;
|
DRunModeEntry quit_entry;
|
||||||
|
// Theme
|
||||||
|
const gchar *icon_theme;
|
||||||
} DRunModePrivateData;
|
} DRunModePrivateData;
|
||||||
|
|
||||||
struct RegexEvalArg
|
struct RegexEvalArg
|
||||||
|
@ -277,6 +279,7 @@ static gboolean read_desktop_file ( DRunModePrivateData *pd, const char *root, c
|
||||||
pd->cmd_list_length_actual += 256;
|
pd->cmd_list_length_actual += 256;
|
||||||
pd->entry_list = g_realloc ( pd->entry_list, pd->cmd_list_length_actual * sizeof ( *( pd->entry_list ) ) );
|
pd->entry_list = g_realloc ( pd->entry_list, pd->cmd_list_length_actual * sizeof ( *( pd->entry_list ) ) );
|
||||||
}
|
}
|
||||||
|
pd->entry_list[pd->cmd_list_length].icon_size = 0;
|
||||||
pd->entry_list[pd->cmd_list_length].root = g_strdup ( root );
|
pd->entry_list[pd->cmd_list_length].root = g_strdup ( root );
|
||||||
pd->entry_list[pd->cmd_list_length].path = g_strdup ( path );
|
pd->entry_list[pd->cmd_list_length].path = g_strdup ( path );
|
||||||
gchar *n = g_key_file_get_locale_string ( kf, "Desktop Entry", "Name", NULL, NULL );
|
gchar *n = g_key_file_get_locale_string ( kf, "Desktop Entry", "Name", NULL, NULL );
|
||||||
|
@ -441,7 +444,7 @@ static gpointer drun_icon_fetch ( gpointer data )
|
||||||
if ( dr->icon_name == NULL ) {
|
if ( dr->icon_name == NULL ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
gchar *icon_path = nk_xdg_theme_get_icon ( pd->xdg_context, NULL, "Applications", dr->icon_name, dr->icon_size, 1, TRUE );
|
gchar *icon_path = nk_xdg_theme_get_icon ( pd->xdg_context, pd->icon_theme, "Applications", dr->icon_name, dr->icon_size, 1, TRUE );
|
||||||
if ( icon_path == NULL ) {
|
if ( icon_path == NULL ) {
|
||||||
g_log ( G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Failed to get Icon %s(%d): n/a", dr->icon_name, dr->icon_size );
|
g_log ( G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Failed to get Icon %s(%d): n/a", dr->icon_name, dr->icon_size );
|
||||||
g_free ( dr->icon_name );
|
g_free ( dr->icon_name );
|
||||||
|
@ -478,6 +481,7 @@ static int drun_mode_init ( Mode *sw )
|
||||||
mode_set_private_data ( sw, (void *) pd );
|
mode_set_private_data ( sw, (void *) pd );
|
||||||
pd->xdg_context = nk_xdg_theme_context_new ();
|
pd->xdg_context = nk_xdg_theme_context_new ();
|
||||||
get_apps ( pd );
|
get_apps ( pd );
|
||||||
|
pd->icon_theme =g_getenv("ROFI_ICON_THEME");
|
||||||
pd->icon_fetch_queue = g_async_queue_new ( );
|
pd->icon_fetch_queue = g_async_queue_new ( );
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue