diff options
| author | bulia byak <buliabyak@gmail.com> | 2009-03-22 20:15:37 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2009-03-22 20:15:37 +0000 |
| commit | 8a52f81bd1c6d73cb692be4067583b1115d3a3c8 (patch) | |
| tree | d2c877f1a08a3f3cf30261826a21a84b1bd80afc /src/widgets/ruler.cpp | |
| parent | fix crash when tweak-deleting objects in groups: you cannot get SP_OBJECT_NEX... (diff) | |
| download | inkscape-8a52f81bd1c6d73cb692be4067583b1115d3a3c8.tar.gz inkscape-8a52f81bd1c6d73cb692be4067583b1115d3a3c8.zip | |
fix squashed vruler: add requisition methon
(bzr r7543)
Diffstat (limited to 'src/widgets/ruler.cpp')
| -rw-r--r-- | src/widgets/ruler.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/widgets/ruler.cpp b/src/widgets/ruler.cpp index 7e347acad..c90b55e73 100644 --- a/src/widgets/ruler.cpp +++ b/src/widgets/ruler.cpp @@ -375,6 +375,7 @@ static gint sp_vruler_motion_notify (GtkWidget *widget, GdkEventMotion *event); static void sp_vruler_draw_ticks (GtkRuler *ruler); static void sp_vruler_draw_pos (GtkRuler *ruler); +static void sp_vruler_size_request (GtkWidget *widget, GtkRequisition *requisition); static void sp_vruler_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static GtkWidgetClass *vruler_parent_class; @@ -421,6 +422,7 @@ sp_vruler_class_init (SPVRulerClass *klass) widget_class->motion_notify_event = sp_vruler_motion_notify; widget_class->size_allocate = sp_vruler_size_allocate; + widget_class->size_request = sp_vruler_size_request; ruler_class->draw_ticks = sp_vruler_draw_ticks; ruler_class->draw_pos = sp_vruler_draw_pos; @@ -682,6 +684,13 @@ sp_vruler_draw_pos (GtkRuler *ruler) } } +static void +sp_vruler_size_request (GtkWidget *widget, GtkRequisition *requisition) +{ + requisition->width = widget->style->xthickness * 2 + RULER_WIDTH; +} + + /** * The vruler widget's size_allocate callback. */ @@ -694,7 +703,7 @@ sp_vruler_size_allocate (GtkWidget *widget, GtkAllocation *allocation) // First call the default gtk_widget_size_allocate() method (which is being overridden here) if (GTK_WIDGET_CLASS (vruler_parent_class)->size_allocate) (* GTK_WIDGET_CLASS (vruler_parent_class)->size_allocate) (widget, allocation); - + // Now the size of the ruler has changed, the ruler bounds (upper & lower) need to be updated // For this we first need to obtain a pointer to the desktop, by walking up the tree of ancestors GtkWidget *parent = gtk_widget_get_parent(widget); |
