forked from AuroraMiddleware/gtk
Fix resize grip drawing
There was some confusion about junctions...
This commit is contained in:
parent
be0ed14cce
commit
d9b0da5b83
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user