summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b8d7efa)
raw | patch | inline | side by side (parent: b8d7efa)
author | Eric Wertz <ericdwertz@gmail.com> | |
Tue, 26 Dec 2017 13:53:57 +0000 (08:53 -0500) | ||
committer | Eric Wertz <ericdwertz@gmail.com> | |
Tue, 26 Dec 2017 13:53:57 +0000 (08:53 -0500) |
main.c | patch | blob | history |
index b88a9015be6783575a031e26c1d233ad2aa760a4..e0ee7fdbea286e6286f6a70614e6cac8167f6862 100755 (executable)
--- a/main.c
+++ b/main.c
GdkPixbuf* get_app_icon(const char* name,int size)
{
GdkPixbuf* out;
+ int width, height;
GtkIconTheme* theme=gtk_icon_theme_get_default();
out = gtk_icon_theme_load_icon(theme,name,size,0,NULL);
out = gtk_icon_theme_load_icon( theme, "application-x-executable", size, 0, NULL );
}
+ //Check/fix size
+ width = gdk_pixbuf_get_width( out );
+ height = gdk_pixbuf_get_height( out );
+
+ if (width != size || height != size)
+ {
+ GdkPixbuf* temp = out;
+ out = gdk_pixbuf_scale_simple(temp,
+ size,
+ size,
+ GDK_INTERP_HYPER);
+ g_object_unref(temp);
+ }
+
return out;
}
return;
}
+ if( g_key_file_get_string( key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY, NULL ) )
+ {
+ return;
+ }
+
gchar* app_name = g_key_file_get_string( key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_NAME, NULL );
gchar* icon_name = g_key_file_get_string( key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_ICON, NULL );
gchar* exec = g_key_file_get_string( key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_EXEC, NULL );