diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2013-01-27 15:28:36 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2013-01-27 15:28:36 +0000 |
| commit | aca87f3d80cf0f83414918cf013ea4eb20336576 (patch) | |
| tree | a3d3d68ee5bf551b7c61098d3a18eab78ac594da /src | |
| parent | Migrate ruler position tracking to new track_widget API (diff) | |
| download | inkscape-aca87f3d80cf0f83414918cf013ea4eb20336576.tar.gz inkscape-aca87f3d80cf0f83414918cf013ea4eb20336576.zip | |
desktop-widget: Add callback to ensure that ruler ranges are correctly updated when canvas table resizes
Fixed bugs:
- https://launchpad.net/bugs/950552
(bzr r12068)
Diffstat (limited to 'src')
| -rw-r--r-- | src/widgets/desktop-widget.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 8a47b345e..e6fabd50b 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -313,6 +313,22 @@ sp_desktop_widget_class_init (SPDesktopWidgetClass *klass) } /** + * Callback for changes in size of the canvas table (i.e. the container for + * the canvas, the rulers etc). + * + * This adjusts the range of the rulers when the dock container is adjusted + * (fixes lp:950552) + */ +static void +canvas_tbl_size_allocate(GtkWidget *widget, + GdkRectangle *allocation, + gpointer data) +{ + SPDesktopWidget *dtw = SP_DESKTOP_WIDGET(data); + sp_desktop_widget_update_rulers (dtw); +} + +/** * Callback for SPDesktopWidget object initialization. */ void SPDesktopWidget::init( SPDesktopWidget *dtw ) @@ -743,6 +759,13 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) } overallTimer = 0; } + + // Ensure that ruler ranges are updated correctly whenever the canvas table + // is resized + g_signal_connect (G_OBJECT (canvas_tbl), + "size-allocate", + G_CALLBACK (canvas_tbl_size_allocate), + dtw); } /** |
