[gtk+/popovers: 6/17] bubblewindow: check the border-radius when rendering the bubble tail.



commit 1f9a1f17dcd56fa2be1dd87b3142696628b0254a
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Nov 12 12:41:24 2013 +0100

    bubblewindow: check the border-radius when rendering the bubble tail.

 gtk/gtkbubblewindow.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkbubblewindow.c b/gtk/gtkbubblewindow.c
index b8f25d8..b00b4fa 100644
--- a/gtk/gtkbubblewindow.c
+++ b/gtk/gtkbubblewindow.c
@@ -256,10 +256,16 @@ gtk_bubble_window_get_gap_coords (GtkBubbleWindow *window,
   gint final_x, final_y;
   GtkPositionType gap_side;
   GtkAllocation allocation;
+  gint border_radius;
 
   gtk_bubble_window_get_pointed_to_coords (window, &x, &y, NULL);
   gtk_widget_get_allocation (GTK_WIDGET (window), &allocation);
 
+  gtk_style_context_get (gtk_widget_get_style_context (GTK_WIDGET (window)),
+                         gtk_widget_get_state_flags (GTK_WIDGET (window)),
+                         GTK_STYLE_PROPERTY_BORDER_RADIUS, &border_radius,
+                         NULL);
+
   base = tip = 0;
   gap_side = GTK_POS_LEFT;
 
@@ -287,28 +293,28 @@ gtk_bubble_window_get_gap_coords (GtkBubbleWindow *window,
   if (POS_IS_VERTICAL (priv->final_position))
     {
       initial_x = CLAMP (x - priv->win_x - TAIL_GAP_WIDTH / 2,
-                         0, allocation.width - TAIL_GAP_WIDTH);
+                         border_radius, allocation.width - TAIL_GAP_WIDTH);
       initial_y = base;
 
       tip_x = CLAMP (x - priv->win_x, 0, allocation.width);
       tip_y = tip;
 
       final_x = CLAMP (x - priv->win_x + TAIL_GAP_WIDTH / 2,
-                       TAIL_GAP_WIDTH, allocation.width);
+                       TAIL_GAP_WIDTH, allocation.width - border_radius);
       final_y = base;
     }
   else
     {
       initial_x = base;
       initial_y = CLAMP (y - priv->win_y - TAIL_GAP_WIDTH / 2,
-                         0, allocation.height - TAIL_GAP_WIDTH);
+                         border_radius, allocation.height - TAIL_GAP_WIDTH);
 
       tip_x = tip;
       tip_y = CLAMP (y - priv->win_y, 0, allocation.height);
 
       final_x = base;
       final_y = CLAMP (y - priv->win_y + TAIL_GAP_WIDTH / 2,
-                       TAIL_GAP_WIDTH, allocation.height);
+                       TAIL_GAP_WIDTH, allocation.height - border_radius);
     }
 
   if (initial_x_out)


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