summaryrefslogtreecommitdiff
path: root/gtk/gtktoolbar.c
diff options
context:
space:
mode:
authorJonh Wendell <jonh.wendell@intel.com>2013-12-02 16:32:54 -0200
committerJonh Wendell <jonh.wendell@intel.com>2013-12-03 09:55:58 -0200
commit9d8a32b07d91be371cb021ad55f44742776ec753 (patch)
tree9451f610596d681dc5fe00d061f6f48937e40483 /gtk/gtktoolbar.c
parent9a0064c684f8b91963eb152d7708cd12d355b5c2 (diff)
downloadgtk+-9d8a32b07d91be371cb021ad55f44742776ec753.tar.gz
toolbar: draw a full box for separators
This allows themes do whatever they want as separators, with paddings, borders and backgrounds. If "wide-separators" property is true, then, instead of just draw a frame, also render its background, and take into account the padding property for its limits. https://bugzilla.gnome.org/show_bug.cgi?id=719713
Diffstat (limited to 'gtk/gtktoolbar.c')
-rw-r--r--gtk/gtktoolbar.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index c6b8dd37a4..46c4ca1a9f 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -3608,11 +3608,18 @@ _gtk_toolbar_paint_space_line (GtkWidget *widget,
NULL);
if (wide_separators)
- gtk_render_frame (context, cr,
- (width - separator_width) / 2,
- height * start_fraction,
- separator_width,
- height * (end_fraction - start_fraction));
+ {
+ gtk_render_background (context, cr,
+ (width - separator_width) / 2,
+ padding.top,
+ separator_width,
+ height - padding.bottom);
+ gtk_render_frame (context, cr,
+ (width - separator_width) / 2,
+ padding.top,
+ separator_width,
+ height - padding.bottom);
+ }
else
gtk_render_line (context, cr,
(width - padding.left) / 2,
@@ -3631,11 +3638,18 @@ _gtk_toolbar_paint_space_line (GtkWidget *widget,
NULL);
if (wide_separators)
- gtk_render_frame (context, cr,
- width * start_fraction,
- (height - separator_height) / 2,
- width * (end_fraction - start_fraction),
- separator_height);
+ {
+ gtk_render_background (context, cr,
+ padding.left,
+ (height - separator_height) / 2,
+ width - padding.right,
+ separator_height);
+ gtk_render_frame (context, cr,
+ padding.left,
+ (height - separator_height) / 2,
+ width - padding.right,
+ separator_height);
+ }
else
gtk_render_line (context, cr,
width * start_fraction,