[gtk+] scale: Allocate marks widget along the trough
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] scale: Allocate marks widget along the trough
- Date: Wed, 10 Jan 2018 08:27:41 +0000 (UTC)
commit b9531e3a7c2a899a9f0e5b9c829eec815b2f5e2c
Author: Timm Bäder <mail baedert org>
Date: Wed Jan 10 09:29:05 2018 +0100
scale: Allocate marks widget along the trough
gtk/gtkscale.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 536ffde..9416515 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -561,8 +561,9 @@ gtk_scale_size_allocate (GtkWidget *widget,
GTK_ORIENTATION_VERTICAL, -1,
&marks_height, NULL,
NULL, NULL);
- marks_rect = range_rect;
+ marks_rect.x = 0;
marks_rect.y = 0;
+ marks_rect.width = range_rect.width;
marks_rect.height = marks_height;
gtk_widget_size_allocate (priv->top_marks_widget, &marks_rect, -1, &marks_clip);
gdk_rectangle_union (out_clip, &marks_clip, out_clip);
@@ -574,8 +575,9 @@ gtk_scale_size_allocate (GtkWidget *widget,
GTK_ORIENTATION_VERTICAL, -1,
&marks_height, NULL,
NULL, NULL);
- marks_rect = range_rect;
- marks_rect.y += range_rect.height;
+ marks_rect.x = 0;
+ marks_rect.y = range_rect.y + range_rect.height;
+ marks_rect.width = range_rect.width;
marks_rect.height = marks_height;
gtk_widget_size_allocate (priv->bottom_marks_widget, &marks_rect, -1, &marks_clip);
gdk_rectangle_union (out_clip, &marks_clip, out_clip);
@@ -591,8 +593,8 @@ gtk_scale_size_allocate (GtkWidget *widget,
GTK_ORIENTATION_HORIZONTAL, -1,
&marks_width, NULL,
NULL, NULL);
- marks_rect = range_rect;
- marks_rect.x -= marks_width;
+ marks_rect.x = 0;
+ marks_rect.y = 0;
marks_rect.width = marks_width;
gtk_widget_size_allocate (priv->top_marks_widget, &marks_rect, -1, &marks_clip);
gdk_rectangle_union (out_clip, &marks_clip, out_clip);
@@ -605,8 +607,10 @@ gtk_scale_size_allocate (GtkWidget *widget,
&marks_width, NULL,
NULL, NULL);
marks_rect = range_rect;
- marks_rect.x += range_rect.width;
+ marks_rect.x = range_rect.x + range_rect.width;
+ marks_rect.y = 0;
marks_rect.width = marks_width;
+ marks_rect.height = range_rect.height;
gtk_widget_size_allocate (priv->bottom_marks_widget, &marks_rect, -1, &marks_clip);
gdk_rectangle_union (out_clip, &marks_clip, out_clip);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]