[Goodies-commits] r3634 - ristretto/trunk/src

Stephan Arts stephan at xfce.org
Sun Nov 25 11:47:44 CET 2007


Author: stephan
Date: 2007-11-25 10:47:44 +0000 (Sun, 25 Nov 2007)
New Revision: 3634

Modified:
   ristretto/trunk/src/main_window.c
   ristretto/trunk/src/picture_viewer.c
   ristretto/trunk/src/picture_viewer.h
Log:
Make bg prettier



Modified: ristretto/trunk/src/main_window.c
===================================================================
--- ristretto/trunk/src/main_window.c	2007-11-25 10:32:24 UTC (rev 3633)
+++ ristretto/trunk/src/main_window.c	2007-11-25 10:47:44 UTC (rev 3634)
@@ -1083,11 +1083,16 @@
             gtk_widget_hide(window->priv->menus.menu);
             gtk_widget_hide(window->priv->toolbar.bar);
             gtk_widget_hide(window->priv->statusbar);
+            GdkColor *color = g_new0(GdkColor, 1);
+            color->pixel = 0;
+
+            rstto_picture_viewer_set_bg_color(RSTTO_PICTURE_VIEWER(window->priv->picture_viewer), color);
         }
         else
         {
             gtk_widget_show(window->priv->menus.menu);
             gtk_widget_show(window->priv->statusbar);
+            rstto_picture_viewer_set_bg_color(RSTTO_PICTURE_VIEWER(window->priv->picture_viewer), NULL);
 
             if (window->priv->settings.toolbar_visibility == TRUE)
             {

Modified: ristretto/trunk/src/picture_viewer.c
===================================================================
--- ristretto/trunk/src/picture_viewer.c	2007-11-25 10:32:24 UTC (rev 3633)
+++ ristretto/trunk/src/picture_viewer.c	2007-11-25 10:47:44 UTC (rev 3634)
@@ -41,6 +41,7 @@
     GdkPixbuf        *dst_pixbuf; /* The pixbuf which ends up on screen */
     void             (*cb_value_changed)(GtkAdjustment *, RsttoPictureViewer *);
     gboolean          show_border;
+    GdkColor         *bg_color;
     struct
     {
         gdouble x;
@@ -275,7 +276,14 @@
         GdkPixmap *buffer = gdk_pixmap_new(NULL, widget->allocation.width, widget->allocation.height, gdk_drawable_get_depth(widget->window));
         GdkGC *gc = gdk_gc_new(GDK_DRAWABLE(buffer));
 
-        gdk_gc_set_foreground(gc, &(widget->style->bg[GTK_STATE_NORMAL]));
+        if (viewer->priv->bg_color)
+        {
+            gdk_gc_set_foreground(gc, viewer->priv->bg_color);
+        }
+        else
+        {
+            gdk_gc_set_foreground(gc, &(widget->style->bg[GTK_STATE_NORMAL]));
+        }
         gdk_draw_rectangle(GDK_DRAWABLE(buffer), gc, TRUE, 0, 0, widget->allocation.width, widget->allocation.height);
         if(pixbuf)
         {
@@ -1046,3 +1054,17 @@
         gtk_menu_attach_to_widget(viewer->priv->menu, GTK_WIDGET(viewer), NULL);
     }
 }
+
+void
+rstto_picture_viewer_set_bg_color (RsttoPictureViewer *viewer, GdkColor *color)
+{
+    if (viewer->priv->bg_color)
+    {
+        gdk_color_free(viewer->priv->bg_color);
+        viewer->priv->bg_color = NULL;
+    }
+    if (color)
+    {
+        viewer->priv->bg_color = gdk_color_copy(color);
+    }
+}

Modified: ristretto/trunk/src/picture_viewer.h
===================================================================
--- ristretto/trunk/src/picture_viewer.h	2007-11-25 10:32:24 UTC (rev 3633)
+++ ristretto/trunk/src/picture_viewer.h	2007-11-25 10:47:44 UTC (rev 3634)
@@ -72,6 +72,7 @@
 void       rstto_picture_viewer_set_timeout(RsttoPictureViewer *viewer, gboolean timeout);
 
 void       rstto_picture_viewer_set_menu (RsttoPictureViewer *viewer, GtkMenu *menu);
+void       rstto_picture_viewer_set_bg_color (RsttoPictureViewer *viewer, GdkColor *color);
 
 G_END_DECLS
 




More information about the Goodies-commits mailing list