[Goodies-commits] r3943 - ristretto/trunk/src
Stephan Arts
stephan at xfce.org
Mon Feb 11 13:27:56 CET 2008
Author: stephan
Date: 2008-02-11 12:27:56 +0000 (Mon, 11 Feb 2008)
New Revision: 3943
Modified:
ristretto/trunk/src/thumbnail.c
ristretto/trunk/src/thumbnail_bar.c
Log:
Improve theme-ability a bit more
Modified: ristretto/trunk/src/thumbnail.c
===================================================================
--- ristretto/trunk/src/thumbnail.c 2008-02-11 12:12:46 UTC (rev 3942)
+++ ristretto/trunk/src/thumbnail.c 2008-02-11 12:27:56 UTC (rev 3943)
@@ -168,7 +168,6 @@
static void
rstto_thumbnail_paint(RsttoThumbnail *thumb)
{
- GdkPixmap *pixmap = NULL;
GtkWidget *widget = GTK_WIDGET(thumb);
gint border_width = 0;
@@ -181,62 +180,28 @@
GdkPixbuf *pixbuf = rstto_navigator_entry_get_thumb(
thumb->priv->entry,
widget->allocation.height - 4);
+ gtk_paint_box(widget->style,
+ widget->window,
+ state,
+ GTK_SHADOW_ETCHED_IN,
+ NULL,
+ widget,
+ NULL,
+ widget->allocation.x, widget->allocation.y,
+ widget->allocation.width, widget->allocation.height);
- pixmap = gdk_pixmap_new(widget->window, widget->allocation.width, widget->allocation.height, -1);
-
- if (widget->style->bg_pixmap[state] == NULL)
- {
- gdk_draw_rectangle(GDK_DRAWABLE(pixmap),
- widget->style->bg_gc[state],
- TRUE,
- 0, 0,
- widget->allocation.width,
- widget->allocation.height);
- }
- else
- {
- gdk_draw_drawable(GDK_DRAWABLE(pixmap),
- widget->style->bg_gc[state],
- widget->style->bg_pixmap[state],
- 0, 0,
- widget->allocation.x, widget->allocation.y,
- widget->allocation.width,
- widget->allocation.height);
-
- }
-
-
if(pixbuf)
{
- gdk_draw_pixbuf(GDK_DRAWABLE(pixmap),
+ gdk_draw_pixbuf(GDK_DRAWABLE(widget->window),
widget->style->fg_gc[state],
pixbuf,
0, 0,
- (0.5 * (widget->allocation.width - gdk_pixbuf_get_width(pixbuf))),
- (0.5 * (widget->allocation.height - gdk_pixbuf_get_height(pixbuf))),
+ (0.5 * (widget->allocation.width - gdk_pixbuf_get_width(pixbuf))) + widget->allocation.x,
+ (0.5 * (widget->allocation.height - gdk_pixbuf_get_height(pixbuf))) + widget->allocation.y,
-1, -1,
GDK_RGB_DITHER_NORMAL,
0, 0);
}
-
- gdk_draw_drawable(GDK_DRAWABLE(widget->window),
- gc,
- pixmap,
- 0, 0,
- widget->allocation.x + border_width, widget->allocation.y + border_width,
- widget->allocation.width - (2 * border_width),
- widget->allocation.height - (2 * border_width));
-
- gtk_paint_shadow(widget->style,
- widget->window,
- state,
- GTK_SHADOW_ETCHED_IN,
- NULL,
- widget,
- NULL,
- widget->allocation.x, widget->allocation.y,
- widget->allocation.width,
- widget->allocation.height);
}
}
Modified: ristretto/trunk/src/thumbnail_bar.c
===================================================================
--- ristretto/trunk/src/thumbnail_bar.c 2008-02-11 12:12:46 UTC (rev 3942)
+++ ristretto/trunk/src/thumbnail_bar.c 2008-02-11 12:27:56 UTC (rev 3943)
@@ -217,10 +217,10 @@
GtkAllocation child_allocation;
GtkRequisition child_requisition;
- child_allocation.x = 0;
- child_allocation.y = 0;
- child_allocation.height = 0;
- child_allocation.width = 0;
+ child_allocation.x = border_width;
+ child_allocation.y = border_width;
+ child_allocation.height = border_width * 2;
+ child_allocation.width = border_width * 2;
GSList *iter = bar->priv->thumbs;
More information about the Goodies-commits
mailing list