summaryrefslogtreecommitdiffstats
path: root/src/desktop.cpp
diff options
context:
space:
mode:
authorJabiertxof <jabier.arraiza@marker.es>2018-11-07 18:50:58 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2018-12-01 16:15:28 +0000
commit6483ea5c1a27864af917598be8bef70d6e8cf082 (patch)
tree52ea1a84c6704cdf37d854285c4f797450a8653c /src/desktop.cpp
parentdesktopwidget: C++ify zoom_status (diff)
downloadinkscape-6483ea5c1a27864af917598be8bef70d6e8cf082.tar.gz
inkscape-6483ea5c1a27864af917598be8bef70d6e8cf082.zip
Initial commit of split canvas
Diffstat (limited to 'src/desktop.cpp')
-rw-r--r--src/desktop.cpp14
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;