]> Pileus Git - ~andy/gtk/commitdiff
Fix resize grip drawing
authorMatthias Clasen <mclasen@redhat.com>
Tue, 23 Nov 2010 03:37:19 +0000 (22:37 -0500)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:39:34 +0000 (15:39 +0100)
There was some confusion about junctions...

gtk/gtkstyle.c
gtk/gtkthemingengine.c
gtk/gtkwindow.c

index 63769a5e19819adaa90853cf2fee241dd6ed3b23..1d07ddf52026c5a08677134f152a7b96b4599494 100644 (file)
@@ -3367,13 +3367,13 @@ gtk_default_draw_resize_grip (GtkStyle       *style,
   switch (edge)
     {
     case GDK_WINDOW_EDGE_NORTH_WEST:
-      sides = GTK_JUNCTION_TOP | GTK_JUNCTION_LEFT;
+      sides = GTK_JUNCTION_CORNER_TOPLEFT;
       break;
     case GDK_WINDOW_EDGE_NORTH:
       sides = GTK_JUNCTION_TOP;
       break;
     case GDK_WINDOW_EDGE_NORTH_EAST:
-      sides = GTK_JUNCTION_TOP | GTK_JUNCTION_RIGHT;
+      sides = GTK_JUNCTION_CORNER_TOPRIGHT;
       break;
     case GDK_WINDOW_EDGE_WEST:
       sides = GTK_JUNCTION_LEFT;
@@ -3382,13 +3382,13 @@ gtk_default_draw_resize_grip (GtkStyle       *style,
       sides = GTK_JUNCTION_RIGHT;
       break;
     case GDK_WINDOW_EDGE_SOUTH_WEST:
-      sides = GTK_JUNCTION_BOTTOM | GTK_JUNCTION_LEFT;
+      sides = GTK_JUNCTION_CORNER_BOTTOMLEFT;
       break;
     case GDK_WINDOW_EDGE_SOUTH:
       sides = GTK_JUNCTION_BOTTOM;
       break;
     case GDK_WINDOW_EDGE_SOUTH_EAST:
-      sides = GTK_JUNCTION_BOTTOM | GTK_JUNCTION_RIGHT;
+      sides = GTK_JUNCTION_CORNER_BOTTOMRIGHT;
       break;
     }
 
index f7961bc1a4be112bc0524ebb10d96440b5943a84..d1f955050a8a6b9016ba3999e926f698573af2aa 100644 (file)
@@ -2302,14 +2302,14 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
       sides = gtk_theming_engine_get_junction_sides (engine);
 
       /* reduce confusing values to a meaningful state */
-      if ((sides & (GTK_JUNCTION_LEFT | GTK_JUNCTION_RIGHT)) == (GTK_JUNCTION_LEFT | GTK_JUNCTION_RIGHT))
-        sides &= ~GTK_JUNCTION_LEFT;
+      if ((sides & (GTK_JUNCTION_CORNER_TOPLEFT | GTK_JUNCTION_CORNER_BOTTOMRIGHT)) == (GTK_JUNCTION_CORNER_TOPLEFT | GTK_JUNCTION_CORNER_BOTTOMRIGHT))
+        sides &= ~GTK_JUNCTION_CORNER_TOPLEFT;
 
-      if ((sides & (GTK_JUNCTION_TOP | GTK_JUNCTION_BOTTOM)) == (GTK_JUNCTION_TOP | GTK_JUNCTION_BOTTOM))
-        sides &= ~GTK_JUNCTION_TOP;
+      if ((sides & (GTK_JUNCTION_CORNER_TOPRIGHT | GTK_JUNCTION_CORNER_BOTTOMLEFT)) == (GTK_JUNCTION_CORNER_TOPRIGHT | GTK_JUNCTION_CORNER_BOTTOMLEFT))
+        sides &= ~GTK_JUNCTION_CORNER_TOPRIGHT;
 
       if (sides == 0)
-        sides = (GTK_JUNCTION_BOTTOM | GTK_JUNCTION_RIGHT);
+        sides = GTK_JUNCTION_CORNER_BOTTOMRIGHT;
 
       /* align drawing area to the connected side */
       if (sides == GTK_JUNCTION_LEFT)
@@ -2317,7 +2317,7 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
           if (height < width)
             width = height;
         }
-      else if (sides == (GTK_JUNCTION_LEFT | GTK_JUNCTION_TOP))
+      else if (sides == GTK_JUNCTION_CORNER_TOPLEFT)
         {
           if (width < height)
             height = width;
@@ -2326,7 +2326,7 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
 
           skip = 2;
         }
-      else if (sides == (GTK_JUNCTION_LEFT | GTK_JUNCTION_BOTTOM))
+      else if (sides == GTK_JUNCTION_CORNER_BOTTOMLEFT)
         {
           /* make it square, aligning to bottom left */
           if (width < height)
@@ -2348,7 +2348,7 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
               width = height;
             }
         }
-      else if (sides == (GTK_JUNCTION_RIGHT | GTK_JUNCTION_TOP))
+      else if (sides == GTK_JUNCTION_CORNER_TOPRIGHT)
         {
           if (width < height)
             height = width;
@@ -2360,7 +2360,7 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
 
           skip = 3;
         }
-      else if (sides == (GTK_JUNCTION_RIGHT | GTK_JUNCTION_BOTTOM))
+      else if (sides == GTK_JUNCTION_CORNER_BOTTOMRIGHT)
         {
           /* make it square, aligning to bottom right */
           if (width < height)
@@ -2433,7 +2433,7 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
               yi+= 2;
             }
         }
-      else if (sides == (GTK_JUNCTION_TOP | GTK_JUNCTION_LEFT))
+      else if (sides == GTK_JUNCTION_CORNER_TOPLEFT)
         {
           gint xi, yi;
 
@@ -2463,7 +2463,7 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
               yi -= 3;
             }
         }
-      else if (sides == (GTK_JUNCTION_TOP | GTK_JUNCTION_RIGHT))
+      else if (sides == GTK_JUNCTION_CORNER_TOPRIGHT)
         {
           gint xi, yi;
 
@@ -2493,7 +2493,7 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
               yi -= 3;
             }
         }
-      else if (sides == (GTK_JUNCTION_BOTTOM | GTK_JUNCTION_LEFT))
+      else if (sides == GTK_JUNCTION_CORNER_BOTTOMLEFT)
         {
           gint xi, yi;
 
@@ -2523,7 +2523,7 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
               yi += 3;
             }
         }
-      else if (sides == (GTK_JUNCTION_BOTTOM | GTK_JUNCTION_RIGHT))
+      else if (sides == GTK_JUNCTION_CORNER_BOTTOMRIGHT)
         {
           gint xi, yi;
 
index b2b789ad588383501b5356a79af6385a6449f8b4..31f46a56cdd77aa5b79988f999767e15ae33e653 100644 (file)
@@ -5117,9 +5117,9 @@ static GtkJunctionSides
 get_grip_junction (GtkWidget *widget)
 {
   if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
-    return GTK_JUNCTION_BOTTOM | GTK_JUNCTION_RIGHT;
+    return GTK_JUNCTION_CORNER_BOTTOMRIGHT;
   else
-    return GTK_JUNCTION_BOTTOM | GTK_JUNCTION_LEFT;
+    return GTK_JUNCTION_CORNER_BOTTOMLEFT;
 }
 
 static gboolean
@@ -5232,7 +5232,7 @@ set_grip_shape (GtkWindow *window)
   cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 0.0);
   cairo_paint (cr);
   cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
-  if (get_grip_junction (GTK_WIDGET (window)) & GTK_JUNCTION_RIGHT)
+  if (get_grip_junction (GTK_WIDGET (window)) & GTK_JUNCTION_CORNER_BOTTOMRIGHT)
     {
       cairo_move_to (cr, width, 0.0);
       cairo_line_to (cr, width, height);