diff options
| author | bulia byak <buliabyak@gmail.com> | 2006-11-03 01:51:51 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2006-11-03 01:51:51 +0000 |
| commit | 874250752d22276a5cf71cc07495a876d1565474 (patch) | |
| tree | 2d562b9a68535b1ee2be3bd757142bcbf741112b /src/desktop.cpp | |
| parent | add view mode toggle (diff) | |
| download | inkscape-874250752d22276a5cf71cc07495a876d1565474.tar.gz inkscape-874250752d22276a5cf71cc07495a876d1565474.zip | |
add view mode toggle, store current mode for the session in prefs
(bzr r1888)
Diffstat (limited to 'src/desktop.cpp')
| -rw-r--r-- | src/desktop.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp index df13bed37..7b0c1f6fc 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -190,12 +190,10 @@ SPDesktop::init (SPNamedView *nv, SPCanvas *aCanvas) if (prefs_get_int_attribute("options.startmode", "outline", 0)) { // Start in outline mode - SP_CANVAS_ARENA (drawing)->arena->rendermode = RENDERMODE_OUTLINE; - canvas->rendermode = RENDERMODE_OUTLINE; // canvas needs that for choosing the best buffer size + setDisplayModeOutline(); } else { // Start in normal mode, default - SP_CANVAS_ARENA (drawing)->arena->rendermode = RENDERMODE_NORMAL; - canvas->rendermode = RENDERMODE_NORMAL; // canvas needs that for choosing the best buffer size + setDisplayModeNormal(); } grid = (SPCanvasGroup *) sp_canvas_item_new (main, SP_TYPE_CANVAS_GROUP, NULL); @@ -347,6 +345,7 @@ SPDesktop::~SPDesktop() {} void SPDesktop::setDisplayModeNormal() { + prefs_set_int_attribute("options.outlinemode", "value", 0); SP_CANVAS_ARENA (drawing)->arena->rendermode = RENDERMODE_NORMAL; canvas->rendermode = RENDERMODE_NORMAL; // canvas needs that for choosing the best buffer size sp_canvas_item_affine_absolute (SP_CANVAS_ITEM (main), _d2w); // redraw @@ -354,11 +353,20 @@ void SPDesktop::setDisplayModeNormal() void SPDesktop::setDisplayModeOutline() { + prefs_set_int_attribute("options.outlinemode", "value", 1); SP_CANVAS_ARENA (drawing)->arena->rendermode = RENDERMODE_OUTLINE; canvas->rendermode = RENDERMODE_OUTLINE; // canvas needs that for choosing the best buffer size sp_canvas_item_affine_absolute (SP_CANVAS_ITEM (main), _d2w); // redraw } +void SPDesktop::displayModeToggle() +{ + if (prefs_get_int_attribute("options.outlinemode", "value", prefs_get_int_attribute("options.startmode", "outline", 0))) + setDisplayModeNormal(); + else + setDisplayModeOutline(); +} + /** * Returns current root (=bottom) layer. */ |
