diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-12-02 22:41:06 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-12-04 20:39:35 +0000 |
| commit | 8bc273fe101cf980af17c9b0e26f7c2a18930cb7 (patch) | |
| tree | 46244cab8faa8dcaa9920fda8019daeca18c1d93 /src/desktop.cpp | |
| parent | Add a few useful lookup functions. (diff) | |
| download | inkscape-8bc273fe101cf980af17c9b0e26f7c2a18930cb7.tar.gz inkscape-8bc273fe101cf980af17c9b0e26f7c2a18930cb7.zip | |
Added XRay
Diffstat (limited to 'src/desktop.cpp')
| -rw-r--r-- | src/desktop.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp index 68eca8cdf..b13f24e67 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -123,6 +123,7 @@ SPDesktop::SPDesktop() _display_mode(Inkscape::RENDERMODE_NORMAL) , _display_color_mode(Inkscape::COLORMODE_NORMAL) , _split_canvas(false) + , _xray(false) , _widget(nullptr) , _guides_message_context(nullptr) , _active(false) @@ -1618,6 +1619,23 @@ void SPDesktop::toggleSplitMode() } } +void SPDesktop::toggleXRay() +{ + Gtk::Window *parent = getToplevel(); + if (parent) { + _xray = !_xray; + if (_split_canvas && _xray) { + return toggleSplitMode(); + } + SPDesktopWidget *dtw = static_cast<SPDesktopWidget *>(parent->get_data("desktopwidget")); + GtkAllocation allocation; + gtk_widget_get_allocation(GTK_WIDGET(dtw->canvas), &allocation); + SPCanvas *canvas = getCanvas(); + canvas->requestRedraw(canvas->_x0, canvas->_y0, canvas->_x0 + allocation.width, + canvas->_y0 + allocation.height); + } +} + void SPDesktop::showGrids(bool show, bool dirty_document) { grids_visible = show; |
