Hello community, here is the log from the commit of package qtcurve-gtk2 checked in at Mon Apr 21 02:28:47 CEST 2008. -------- --- KDE/qtcurve-gtk2/qtcurve-gtk2.changes 2008-04-14 10:20:33.000000000 +0200 +++ qtcurve-gtk2/qtcurve-gtk2.changes 2008-04-17 15:22:32.000000000 +0200 @@ -1,0 +2,6 @@ +Thu Apr 17 15:22:14 CEST 2008 - dmueller@suse.de + +- add patch from Raymond Plannthold to fix disabled + icon rendering (bnc#379515) + +------------------------------------------------------------------- New: ---- qtcurve-gtk2-iconeffects.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qtcurve-gtk2.spec ++++++ --- /var/tmp/diff_new_pack.Rhe333/_old 2008-04-21 02:27:59.000000000 +0200 +++ /var/tmp/diff_new_pack.Rhe333/_new 2008-04-21 02:27:59.000000000 +0200 @@ -18,10 +18,11 @@ Group: System/GUI/GNOME Summary: QtCurve style for Gtk2 Version: 0.58.0 -Release: 1 +Release: 3 BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: QtCurve-Gtk2-%{version}.tar.bz2 Patch2: fixme.diff +Patch3: qtcurve-gtk2-iconeffects.diff %if %suse_version > 1010 Recommends: qtcurve-kde %endif @@ -43,6 +44,7 @@ %prep %setup -q -n QtCurve-Gtk2-%{version} %patch2 +%patch3 %build export CFLAGS="$RPM_OPT_FLAGS" @@ -70,6 +72,9 @@ %pref/share/themes/QtCurve %changelog +* Thu Apr 17 2008 dmueller@suse.de +- add patch from Raymond Plannthold to fix disabled + icon rendering (bnc#379515) * Mon Apr 14 2008 stbinner@suse.de - update to 0.58: * style drawing fixes for Pidgin, OOo and Firefox 3 ++++++ qtcurve-gtk2-iconeffects.diff ++++++ --- style/qtcurve.c +++ style/qtcurve.c @@ -5275,6 +5275,140 @@ //QTC_CAIRO_END } +// copypasta +static GdkPixbuf * set_transparency (const GdkPixbuf *pixbuf, gdouble alpha_percent) +{ + GdkPixbuf *target; + guchar *data, *current; + guint x, y, rowstride, height, width; + + g_return_val_if_fail (pixbuf != NULL, NULL); + g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL); + + /* Returns a copy of pixbuf with it's non-completely-transparent pixels to + have an alpha level "alpha_percent" of their original value. */ + + target = gdk_pixbuf_add_alpha (pixbuf, FALSE, 0, 0, 0); + + if (alpha_percent == 1.0) + return target; + width = gdk_pixbuf_get_width (target); + height = gdk_pixbuf_get_height (target); + rowstride = gdk_pixbuf_get_rowstride (target); + data = gdk_pixbuf_get_pixels (target); + + for (y = 0; y < height; y++) + { + for (x = 0; x < width; x++) + { + /* The "4" is the number of chars per pixel, in this case, RGBA, + the 3 means "skip to the alpha" */ + current = data + (y * rowstride) + (x * 4) + 3; + *(current) = (guchar) (*(current) * alpha_percent); + } + } + + return target; +} + +// copypasta +static GdkPixbuf* scale_or_ref (GdkPixbuf *src, int width, int height) +{ + if (width == gdk_pixbuf_get_width (src) && + height == gdk_pixbuf_get_height (src)) + { + return g_object_ref (src); + } + else + { + return gdk_pixbuf_scale_simple (src, + width, height, + GDK_INTERP_BILINEAR); + } +} + +// copypasta +static GdkPixbuf * gtkRenderIcon (GtkStyle *style, const GtkIconSource *source, + GtkTextDirection direction, GtkStateType state, + GtkIconSize size, GtkWidget *widget, const char *detail) +{ + int width = 1; + int height = 1; + GdkPixbuf *scaled; + GdkPixbuf *stated; + GdkPixbuf *base_pixbuf; + GdkScreen *screen; + GtkSettings *settings; + + /* Oddly, style can be NULL in this function, because + * GtkIconSet can be used without a style and if so + * it uses this function. + */ + + base_pixbuf = gtk_icon_source_get_pixbuf (source); + + g_return_val_if_fail (base_pixbuf != NULL, NULL); + + if (widget && gtk_widget_has_screen (widget)) + { + screen = gtk_widget_get_screen (widget); + settings = gtk_settings_get_for_screen (screen); + } + else if (style->colormap) + { + screen = gdk_colormap_get_screen (style->colormap); + settings = gtk_settings_get_for_screen (screen); + } + else + { + settings = gtk_settings_get_default (); + GTK_NOTE (MULTIHEAD, + g_warning ("Using the default screen for gtk_default_render_icon()")); + } + + if (size != (GtkIconSize) -1 && !gtk_icon_size_lookup_for_settings (settings, size, &width, &height)) + { + g_warning (G_STRLOC ": invalid icon size '%d'", size); + return NULL; + } + + /* If the size was wildcarded, and we're allowed to scale, then scale; otherwise, + * leave it alone. + */ + if (size != (GtkIconSize)-1 && gtk_icon_source_get_size_wildcarded (source)) + scaled = scale_or_ref (base_pixbuf, width, height); + else + scaled = g_object_ref (base_pixbuf); + + /* If the state was wildcarded, then generate a state. */ + if (gtk_icon_source_get_state_wildcarded (source)) + { + if (state == GTK_STATE_INSENSITIVE) + { + stated = set_transparency (scaled, 0.3); + gdk_pixbuf_saturate_and_pixelate (stated, stated, 0.1, FALSE); + + g_object_unref (scaled); + } + else if (state == GTK_STATE_PRELIGHT) + { + stated = gdk_pixbuf_copy (scaled); + + gdk_pixbuf_saturate_and_pixelate (scaled, stated, 1.2, FALSE); + + g_object_unref (scaled); + } + else + { + stated = scaled; + } + } + else + stated = scaled; + + return stated; +} + static void styleRealize(GtkStyle *style) { QtCurveStyle *qtcurveStyle = (QtCurveStyle *)style; @@ -5434,6 +5568,7 @@ style_class->draw_vline = gtkDrawVLine; style_class->draw_focus = gtkDrawFocus; style_class->draw_layout = gtkDrawLayout; + style_class->render_icon = gtkRenderIcon; // copypasta } static GtkRcStyleClass *parent_rc_class; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org