From 6483ea5c1a27864af917598be8bef70d6e8cf082 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Wed, 7 Nov 2018 19:50:58 +0100 Subject: Initial commit of split canvas --- src/desktop.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/desktop.cpp') 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(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; -- cgit v1.2.3