mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Add new icons
svn path=/trunk/; revision=347
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
Mon Jan 22 16:37:12 2007 Søren Sandmann <sandmann@redhat.com>
|
||||||
|
|
||||||
|
* sysprof-icon-16/24/48.png:
|
||||||
|
* sysprof.c: Add new icons from Diana.
|
||||||
|
|
||||||
2007-01-05 Behdad Esfahbod <behdad@gnome.org>
|
2007-01-05 Behdad Esfahbod <behdad@gnome.org>
|
||||||
|
|
||||||
* module/Makefile: Correct $PWD usage, so make install works from
|
* module/Makefile: Correct $PWD usage, so make install works from
|
||||||
|
|||||||
@ -63,7 +63,7 @@ dist_udev_DATA = 60-sysprof.rules
|
|||||||
pixmapsdir = $(datadir)/pixmaps
|
pixmapsdir = $(datadir)/pixmaps
|
||||||
|
|
||||||
dist_pkgdata_DATA = sysprof.glade
|
dist_pkgdata_DATA = sysprof.glade
|
||||||
dist_pixmaps_DATA = sysprof-icon.png
|
dist_pixmaps_DATA = sysprof-icon-16.png sysprof-icon-24.png sysprof-icon-48.png
|
||||||
|
|
||||||
#
|
#
|
||||||
# Command line version
|
# Command line version
|
||||||
|
|||||||
BIN
sysprof-icon-16.png
Normal file
BIN
sysprof-icon-16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 847 B |
BIN
sysprof-icon-24.png
Normal file
BIN
sysprof-icon-24.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
sysprof-icon-48.png
Normal file
BIN
sysprof-icon-48.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
BIN
sysprof-icon.png
BIN
sysprof-icon.png
Binary file not shown.
|
Before Width: | Height: | Size: 3.7 KiB |
41
sysprof.c
41
sysprof.c
@ -50,9 +50,9 @@ struct Application
|
|||||||
Collector * collector;
|
Collector * collector;
|
||||||
|
|
||||||
State state;
|
State state;
|
||||||
|
GdkPixbuf * icon;
|
||||||
|
|
||||||
GtkWidget * main_window;
|
GtkWidget * main_window;
|
||||||
GdkPixbuf * icon;
|
|
||||||
|
|
||||||
GtkTreeView * object_view;
|
GtkTreeView * object_view;
|
||||||
GtkTreeView * callers_view;
|
GtkTreeView * callers_view;
|
||||||
@ -1336,7 +1336,37 @@ set_shadows (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define GLADE_FILE DATADIR "/sysprof.glade"
|
#define GLADE_FILE DATADIR "/sysprof.glade"
|
||||||
#define ICON_FILE PIXMAPDIR "/sysprof-icon.png"
|
|
||||||
|
static void
|
||||||
|
set_icons (Application *app)
|
||||||
|
{
|
||||||
|
const char *icon_files [] = {
|
||||||
|
PIXMAPDIR "/sysprof-icon-16.png",
|
||||||
|
PIXMAPDIR "/sysprof-icon-24.png",
|
||||||
|
PIXMAPDIR "/sysprof-icon-48.png",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
GList *pixbufs = NULL;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; icon_files[i] != NULL; ++i)
|
||||||
|
{
|
||||||
|
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (icon_files[i], NULL);
|
||||||
|
|
||||||
|
if (pixbuf)
|
||||||
|
{
|
||||||
|
pixbufs = g_list_prepend (pixbufs, pixbuf);
|
||||||
|
|
||||||
|
if (i == 2) /* 48 x 48 */
|
||||||
|
app->icon = g_object_ref (pixbuf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gtk_window_set_icon_list (GTK_WINDOW (app->main_window), pixbufs);
|
||||||
|
|
||||||
|
g_list_foreach (pixbufs, (GFunc)g_object_unref, NULL);
|
||||||
|
g_list_free (pixbufs);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
build_gui (Application *app)
|
build_gui (Application *app)
|
||||||
@ -1347,8 +1377,7 @@ build_gui (Application *app)
|
|||||||
|
|
||||||
set_shadows ();
|
set_shadows ();
|
||||||
|
|
||||||
if (!g_file_test (GLADE_FILE, G_FILE_TEST_EXISTS) ||
|
if (!g_file_test (GLADE_FILE, G_FILE_TEST_EXISTS))
|
||||||
!g_file_test (ICON_FILE, G_FILE_TEST_EXISTS))
|
|
||||||
{
|
{
|
||||||
sorry (NULL,
|
sorry (NULL,
|
||||||
"Sysprof was not compiled or installed correctly.\n"
|
"Sysprof was not compiled or installed correctly.\n"
|
||||||
@ -1363,9 +1392,7 @@ build_gui (Application *app)
|
|||||||
|
|
||||||
/* Main Window */
|
/* Main Window */
|
||||||
app->main_window = glade_xml_get_widget (xml, "main_window");
|
app->main_window = glade_xml_get_widget (xml, "main_window");
|
||||||
app->icon = gdk_pixbuf_new_from_file (ICON_FILE, NULL);
|
set_icons (app);
|
||||||
|
|
||||||
gtk_window_set_icon (GTK_WINDOW (app->main_window), app->icon);
|
|
||||||
|
|
||||||
g_signal_connect (G_OBJECT (app->main_window), "delete_event",
|
g_signal_connect (G_OBJECT (app->main_window), "delete_event",
|
||||||
G_CALLBACK (on_delete), NULL);
|
G_CALLBACK (on_delete), NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user