summaryrefslogtreecommitdiffstats
path: root/src/desktop.cpp
diff options
context:
space:
mode:
authorMenTaLguY <mental@rydia.net>2008-03-31 03:23:39 +0000
committermental <mental@users.sourceforge.net>2008-03-31 03:23:39 +0000
commit6029364021b09601b1d18b796d8139223ed52ce2 (patch)
tree0e4b5d90c01941a93b2647f3191f1423fd611ead /src/desktop.cpp
parentlay groundwork for non-filter view mode (diff)
downloadinkscape-6029364021b09601b1d18b796d8139223ed52ce2.tar.gz
inkscape-6029364021b09601b1d18b796d8139223ed52ce2.zip
implement filter toggle
(bzr r5266)
Diffstat (limited to 'src/desktop.cpp')
-rw-r--r--src/desktop.cpp36
1 files changed, 15 insertions, 21 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp
index 657d42304..a899e76c9 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -145,9 +145,10 @@ SPDesktop::SPDesktop() :
gr_point_type( 0 ),
gr_point_i( 0 ),
gr_fill_or_stroke( true ),
- displayMode(Inkscape::RENDERMODE_NORMAL),
_layer_hierarchy( 0 ),
_reconstruction_old_layer_id( 0 ),
+ _display_mode(Inkscape::RENDERMODE_NORMAL),
+ _saved_display_mode(Inkscape::RENDERMODE_NORMAL),
_widget( 0 ),
_inkscape( 0 ),
_guides_message_context( 0 ),
@@ -414,30 +415,23 @@ SPDesktop::remove_temporary_canvasitem (Inkscape::Display::TemporaryItem * tempi
}
}
-void SPDesktop::setDisplayModeNormal()
-{
- SP_CANVAS_ARENA (drawing)->arena->rendermode = Inkscape::RENDERMODE_NORMAL;
- canvas->rendermode = Inkscape::RENDERMODE_NORMAL; // canvas needs that for choosing the best buffer size
- displayMode = Inkscape::RENDERMODE_NORMAL;
- sp_canvas_item_affine_absolute (SP_CANVAS_ITEM (main), _d2w); // redraw
- _widget->setTitle(SP_DOCUMENT_NAME(sp_desktop_document(this)));
-}
-
-void SPDesktop::setDisplayModeOutline()
-{
- SP_CANVAS_ARENA (drawing)->arena->rendermode = Inkscape::RENDERMODE_OUTLINE;
- canvas->rendermode = Inkscape::RENDERMODE_OUTLINE; // canvas needs that for choosing the best buffer size
- displayMode = Inkscape::RENDERMODE_OUTLINE;
+void SPDesktop::_setDisplayMode(Inkscape::RenderMode mode) {
+ SP_CANVAS_ARENA (drawing)->arena->rendermode = mode;
+ canvas->rendermode = mode;
+ _display_mode = mode;
+ if (mode != Inkscape::RENDERMODE_OUTLINE) {
+ _saved_display_mode = _display_mode;
+ }
sp_canvas_item_affine_absolute (SP_CANVAS_ITEM (main), _d2w); // redraw
_widget->setTitle(SP_DOCUMENT_NAME(sp_desktop_document(this)));
}
-void SPDesktop::displayModeToggle()
-{
- if (displayMode == Inkscape::RENDERMODE_OUTLINE)
- setDisplayModeNormal();
- else
- setDisplayModeOutline();
+void SPDesktop::displayModeToggle() {
+ if (_display_mode == Inkscape::RENDERMODE_OUTLINE) {
+ _setDisplayMode(_saved_display_mode);
+ } else {
+ _setDisplayMode(Inkscape::RENDERMODE_OUTLINE);
+ }
}
/**