Render insensitive icons in a way that more closely matches Windows.
2005-06-04 Tor Lillqvist <tml@novell.com> * modules/engines/ms-windows/msw_style.c: Render insensitive icons in a way that more closely matches Windows. (#305986, Tim Evans). * modules/engines/ms-windows/Makefile.am (LDADDS): Link with gdk-pixbuf.
This commit is contained in:
committed by
Tor Lillqvist
parent
d751518bd7
commit
3dde363831
@ -1,3 +1,11 @@
|
||||
2005-06-04 Tor Lillqvist <tml@novell.com>
|
||||
|
||||
* modules/engines/ms-windows/msw_style.c: Render insensitive icons
|
||||
in a way that more closely matches Windows. (#305986, Tim Evans).
|
||||
|
||||
* modules/engines/ms-windows/Makefile.am (LDADDS): Link with
|
||||
gdk-pixbuf.
|
||||
|
||||
2005-06-03 Dom Lachowicz <cinamod@hotmail.com>
|
||||
|
||||
* modules/engines/ms-windows/msw_style.c: Re-sync with gtk-wimp
|
||||
|
||||
@ -1,3 +1,11 @@
|
||||
2005-06-04 Tor Lillqvist <tml@novell.com>
|
||||
|
||||
* modules/engines/ms-windows/msw_style.c: Render insensitive icons
|
||||
in a way that more closely matches Windows. (#305986, Tim Evans).
|
||||
|
||||
* modules/engines/ms-windows/Makefile.am (LDADDS): Link with
|
||||
gdk-pixbuf.
|
||||
|
||||
2005-06-03 Dom Lachowicz <cinamod@hotmail.com>
|
||||
|
||||
* modules/engines/ms-windows/msw_style.c: Re-sync with gtk-wimp
|
||||
|
||||
@ -1,3 +1,11 @@
|
||||
2005-06-04 Tor Lillqvist <tml@novell.com>
|
||||
|
||||
* modules/engines/ms-windows/msw_style.c: Render insensitive icons
|
||||
in a way that more closely matches Windows. (#305986, Tim Evans).
|
||||
|
||||
* modules/engines/ms-windows/Makefile.am (LDADDS): Link with
|
||||
gdk-pixbuf.
|
||||
|
||||
2005-06-03 Dom Lachowicz <cinamod@hotmail.com>
|
||||
|
||||
* modules/engines/ms-windows/msw_style.c: Re-sync with gtk-wimp
|
||||
|
||||
@ -13,6 +13,7 @@ INCLUDES = \
|
||||
|
||||
|
||||
LDADDS = \
|
||||
$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-2.0.la \
|
||||
$(top_builddir)/gdk/$(gdktargetlib) \
|
||||
$(top_builddir)/gtk/$(gtktargetlib) \
|
||||
$(GTK_DEP_LIBS)
|
||||
|
||||
@ -1602,7 +1602,6 @@ draw_box (GtkStyle *style,
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1903,6 +1902,52 @@ draw_handle (GtkStyle *style,
|
||||
}
|
||||
}
|
||||
|
||||
static GdkPixbuf *
|
||||
render_icon (GtkStyle *style,
|
||||
const GtkIconSource *source,
|
||||
GtkTextDirection direction,
|
||||
GtkStateType state,
|
||||
GtkIconSize size,
|
||||
GtkWidget *widget,
|
||||
const gchar *detail)
|
||||
{
|
||||
if (gtk_icon_source_get_state_wildcarded (source) && state == GTK_STATE_INSENSITIVE)
|
||||
{
|
||||
GdkPixbuf *normal, *insensitive;
|
||||
int i, j, w, h, rs;
|
||||
guchar *pixels, *row;
|
||||
|
||||
normal = parent_class->render_icon (style, source, direction,
|
||||
GTK_STATE_NORMAL, size,
|
||||
widget, detail);
|
||||
/* copy and add alpha channel at the same time */
|
||||
insensitive = gdk_pixbuf_add_alpha (normal, FALSE, 0, 0, 0);
|
||||
g_object_unref (normal);
|
||||
/* remove all colour */
|
||||
gdk_pixbuf_saturate_and_pixelate (insensitive, insensitive, 0.0, FALSE);
|
||||
/* make partially transparent */
|
||||
w = gdk_pixbuf_get_width (insensitive);
|
||||
h = gdk_pixbuf_get_height (insensitive);
|
||||
rs = gdk_pixbuf_get_rowstride (insensitive);
|
||||
pixels = gdk_pixbuf_get_pixels (insensitive);
|
||||
for (j=0; j<h; j++)
|
||||
{
|
||||
row = pixels + j * rs;
|
||||
for (i=0; i<w; i++)
|
||||
{
|
||||
row[i*4 + 3] = (guchar)(row[i*4 + 3] * 0.6);
|
||||
}
|
||||
}
|
||||
return insensitive;
|
||||
}
|
||||
else
|
||||
{
|
||||
return parent_class->render_icon (style, source, direction,
|
||||
state, size,
|
||||
widget, detail);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
msw_style_init_from_rc (GtkStyle * style, GtkRcStyle * rc_style)
|
||||
{
|
||||
@ -1934,6 +1979,7 @@ msw_style_class_init (MswStyleClass *klass)
|
||||
style_class->draw_vline = draw_vline;
|
||||
style_class->draw_handle = draw_handle;
|
||||
style_class->draw_resize_grip = draw_resize_grip;
|
||||
style_class->render_icon = render_icon;
|
||||
}
|
||||
|
||||
GType msw_type_style = 0;
|
||||
|
||||
Reference in New Issue
Block a user