summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-23 14:07:14 +0100
committerinfirit <[email protected]>2014-11-23 14:07:14 +0100
commit6f8e92ebb87b15aa5afb02953964743e599ef619 (patch)
treeca39dead7ba8d7d7a2bde7245a585a3525f7c1df
parenta3869cb7d3f16fe765249a54ddd61691de700768 (diff)
downloadmate-panel-6f8e92ebb87b15aa5afb02953964743e599ef619.tar.bz2
mate-panel-6f8e92ebb87b15aa5afb02953964743e599ef619.tar.xz
Gtk3: panel: Draw the separator line where it should
The calculation wasn't done right. At least, I think so :-) Also cleanup a bit some code in the file. Based on gnome-panel commit: be822666a99680e5cd34c02ad2e35bea81f4a7d8 From: Vincent Untz <[email protected]>
-rw-r--r--mate-panel/panel-separator.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/mate-panel/panel-separator.c b/mate-panel/panel-separator.c
index 308501ac..7f9c53fe 100644
--- a/mate-panel/panel-separator.c
+++ b/mate-panel/panel-separator.c
@@ -78,13 +78,23 @@ panel_separator_paint (GtkWidget *widget,
cairo_save (cr);
if (separator->priv->orientation == GTK_ORIENTATION_HORIZONTAL) {
+ int x;
+
+ x = (width - padding.left - padding.right) / 2 + padding.left;
+ x = MIN (x, width - padding.right);
+
gtk_render_line (context, cr,
- (width - padding.left) / 2, 0,
- (width - padding.left) / 2, height - 1);
+ x, padding.top,
+ x, height - padding.bottom);
} else {
+ int y;
+
+ y = (height - padding.top - padding.bottom) / 2 + padding.top;
+ y = MIN (y, height - padding.bottom);
+
gtk_render_line (context, cr,
- 0, (height - padding.top) / 2,
- width - 1, (height - padding.top) / 2);
+ padding.left, y,
+ width - padding.right, y);
}
cairo_restore (cr);