summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 06a7e8d)
raw | patch | inline | side by side (parent: 06a7e8d)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 22 Mar 2009 20:15:37 +0000 (20:15 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 22 Mar 2009 20:15:37 +0000 (20:15 +0000) |
src/widgets/ruler.cpp | patch | blob | history |
diff --git a/src/widgets/ruler.cpp b/src/widgets/ruler.cpp
index 7e347acade59c04a990a77db49e9e2fa47017685..c90b55e734e79c917cb057df7da84994e26ce2ae 100644 (file)
--- a/src/widgets/ruler.cpp
+++ b/src/widgets/ruler.cpp
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;
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;
}
}
+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.
*/
// 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);