mirror of
https://github.com/brl/mutter.git
synced 2025-08-04 15:45:54 +00:00
use the inline image data for default icon
2001-09-17 Havoc Pennington <hp@pobox.com> * src/ui.c: use the inline image data for default icon * src/common.h (META_MINI_ICON_HEIGHT): move icon size defines here * src/Makefile.am: Create an inlinepixbufs.h header with inline images
This commit is contained in:

committed by
Havoc Pennington

parent
ecf75915c7
commit
4c104e1cb7
54
src/ui.c
54
src/ui.c
@@ -25,6 +25,8 @@
|
||||
#include "menu.h"
|
||||
#include "core.h"
|
||||
|
||||
#include "inlinepixbufs.h"
|
||||
|
||||
struct _MetaUI
|
||||
{
|
||||
Display *xdisplay;
|
||||
@@ -422,21 +424,53 @@ meta_ui_pop_delay_exposes (MetaUI *ui)
|
||||
GdkPixbuf*
|
||||
meta_ui_get_default_window_icon (MetaUI *ui)
|
||||
{
|
||||
/* FIXME */
|
||||
return gtk_widget_render_icon (GTK_WIDGET (ui->frames),
|
||||
GTK_STOCK_NEW,
|
||||
GTK_ICON_SIZE_LARGE_TOOLBAR,
|
||||
NULL);
|
||||
static GdkPixbuf *default_icon = NULL;
|
||||
|
||||
if (default_icon == NULL)
|
||||
{
|
||||
GdkPixbuf *base;
|
||||
|
||||
base = gdk_pixbuf_new_from_stream (-1, default_icon_data,
|
||||
FALSE,
|
||||
NULL);
|
||||
|
||||
g_assert (base);
|
||||
|
||||
default_icon = gdk_pixbuf_scale_simple (base,
|
||||
META_ICON_WIDTH,
|
||||
META_ICON_HEIGHT,
|
||||
GDK_INTERP_BILINEAR);
|
||||
|
||||
g_object_unref (G_OBJECT (base));
|
||||
}
|
||||
|
||||
return default_icon;
|
||||
}
|
||||
|
||||
GdkPixbuf*
|
||||
meta_ui_get_default_mini_icon (MetaUI *ui)
|
||||
{
|
||||
/* FIXME */
|
||||
return gtk_widget_render_icon (GTK_WIDGET (ui->frames),
|
||||
GTK_STOCK_NEW,
|
||||
GTK_ICON_SIZE_MENU,
|
||||
NULL);
|
||||
static GdkPixbuf *default_icon = NULL;
|
||||
|
||||
if (default_icon == NULL)
|
||||
{
|
||||
GdkPixbuf *base;
|
||||
|
||||
base = gdk_pixbuf_new_from_stream (-1, default_icon_data,
|
||||
FALSE,
|
||||
NULL);
|
||||
|
||||
g_assert (base);
|
||||
|
||||
default_icon = gdk_pixbuf_scale_simple (base,
|
||||
META_MINI_ICON_WIDTH,
|
||||
META_MINI_ICON_HEIGHT,
|
||||
GDK_INTERP_BILINEAR);
|
||||
|
||||
g_object_unref (G_OBJECT (base));
|
||||
}
|
||||
|
||||
return default_icon;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
Reference in New Issue
Block a user