[monet/monet-xml: 5/10] gtk-style: Get the width and height from the window if request



commit 7fe29717d22ed9abbc285ef3bd73f52632b5b9bb
Author: Thomas Wood <thos gnome org>
Date:   Mon Apr 5 15:43:44 2010 +0100

    gtk-style: Get the width and height from the window if request
    
    A width and height of -1 means the engine must get the width and height
    from the drawable.

 monet-gtk/style.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/monet-gtk/style.c b/monet-gtk/style.c
index 9cedd34..86d49c1 100644
--- a/monet-gtk/style.c
+++ b/monet-gtk/style.c
@@ -255,10 +255,18 @@ monet_gtk_draw_box (GtkStyle      *style,
   MnState mn_state;
   MnFlags mn_flags;
   MnStyle *mn_style;
+  gint int_w, int_h;
 
   monet_params_init (style, window, state_type,
                      &mn_style, &cr, &mn_state, &mn_flags, &mn_palette);
 
+  if (width == -1 && height == -1)
+    {
+      gdk_drawable_get_size (GDK_DRAWABLE (window), &int_w, &int_h);
+      width = int_w;
+      height = int_h;
+    }
+
   if (DETAIL ("button"))
     {
       mn_style_paint_button (mn_style, cr, x, y, width, height, mn_palette,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]