diff options
| author | Jabiertxof <jabier.arraiza@marker.es> | 2018-11-07 18:50:58 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-12-01 16:15:28 +0000 |
| commit | 6483ea5c1a27864af917598be8bef70d6e8cf082 (patch) | |
| tree | 52ea1a84c6704cdf37d854285c4f797450a8653c /src/desktop.cpp | |
| parent | desktopwidget: C++ify zoom_status (diff) | |
| download | inkscape-6483ea5c1a27864af917598be8bef70d6e8cf082.tar.gz inkscape-6483ea5c1a27864af917598be8bef70d6e8cf082.zip | |
Initial commit of split canvas
Diffstat (limited to 'src/desktop.cpp')
| -rw-r--r-- | src/desktop.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp index 27d5582f1..027e6ff45 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -121,6 +121,7 @@ SPDesktop::SPDesktop() : _reconstruction_old_layer_id(), // an id attribute is not allowed to be the empty string _display_mode(Inkscape::RENDERMODE_NORMAL), _display_color_mode(Inkscape::COLORMODE_NORMAL), + _split_canvas(false), _widget( nullptr ), _guides_message_context( nullptr ), _active( false ), @@ -1545,6 +1546,19 @@ void SPDesktop::toggleGrids() } } +void SPDesktop::toggleSplitMode() +{ + Gtk::Window *parent = getToplevel(); + if (parent) { + _split_canvas = !_split_canvas; + SPDesktopWidget *dtw = static_cast<SPDesktopWidget *>(parent->get_data("desktopwidget")); + dtw->splitCanvas(_split_canvas); + GtkAllocation allocation; + gtk_widget_get_allocation(GTK_WIDGET(dtw->canvas), &allocation); + getCanvas()->requestRedraw(getCanvas()->_x0, getCanvas()->_y0, allocation.width, allocation.height); + } +} + void SPDesktop::showGrids(bool show, bool dirty_document) { grids_visible = show; |
