summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 927588f)
raw | patch | inline | side by side (parent: 927588f)
author | mental <mental@users.sourceforge.net> | |
Mon, 31 Mar 2008 03:23:39 +0000 (03:23 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Mon, 31 Mar 2008 03:23:39 +0000 (03:23 +0000) |
diff --git a/src/desktop.cpp b/src/desktop.cpp
index 657d423048bd2f692c39853650c1d0d7ca76e453..a899e76c9904c4441c5fedc54e6c57ae49e94c5c 100644 (file)
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
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);
+ }
}
/**
diff --git a/src/desktop.h b/src/desktop.h
index 672cd2b5c6a80ea89649ad7fd95c4ca54478eb46..4e2a12180a1a24701fa4fc42b1141a84847ab372 100644 (file)
--- a/src/desktop.h
+++ b/src/desktop.h
Inkscape::Display::TemporaryItem * add_temporary_canvasitem (SPCanvasItem *item, guint lifetime);
void remove_temporary_canvasitem (Inkscape::Display::TemporaryItem * tempitem);
- void setDisplayModeNormal();
- void setDisplayModeOutline();
+ void _setDisplayMode(Inkscape::RenderMode mode);
+ void setDisplayModeNormal() {
+ _setDisplayMode(Inkscape::RENDERMODE_NORMAL);
+ }
+ void setDisplayModeNoFilters() {
+ _setDisplayMode(Inkscape::RENDERMODE_NO_FILTERS);
+ }
+ void setDisplayModeOutline() {
+ _setDisplayMode(Inkscape::RENDERMODE_OUTLINE);
+ }
void displayModeToggle();
- Inkscape::RenderMode displayMode;
- Inkscape::RenderMode getMode() const { return displayMode; }
+ Inkscape::RenderMode _display_mode;
+ Inkscape::RenderMode _saved_display_mode;
+ Inkscape::RenderMode getMode() const { return _display_mode; }
Inkscape::UI::Widget::Dock* getDock() { return _widget->getDock(); }
index 3153a979c184aa3d512f45a4e3b65e497a8cd217..1b59ae9bbdf92e4cef3976ae6ad978230b5f6c12 100644 (file)
--- a/src/display/rendermode.h
+++ b/src/display/rendermode.h
enum RenderMode {
RENDERMODE_NORMAL,
+ RENDERMODE_NO_FILTERS,
RENDERMODE_OUTLINE
};
diff --git a/src/menus-skeleton.h b/src/menus-skeleton.h
index 70c7f4ca2a7ca92eb8120c89e6de11169098adcf..e77b9e9be8b605dff74fd2c0e0c3ad96c2396742 100644 (file)
--- a/src/menus-skeleton.h
+++ b/src/menus-skeleton.h
" <submenu name=\"" N_("_Display mode") "\">\n"
" <verb verb-id=\"ViewModeToggle\"/>\n"
" <verb verb-id=\"ViewModeNormal\" radio=\"yes\" default=\"yes\"/>\n"
+" <verb verb-id=\"ViewModeNoFilters\" radio=\"yes\"/>\n"
" <verb verb-id=\"ViewModeOutline\" radio=\"yes\"/>\n"
" </submenu>\n"
" <separator/>\n"
diff --git a/src/verbs.cpp b/src/verbs.cpp
index b32d0041b0760be8e341b865726dc7f1ca4421f8..9258aa5474f775186413f71ab74824e0aca5cd21 100644 (file)
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
case SP_VERB_VIEW_MODE_NORMAL:
dt->setDisplayModeNormal();
break;
+ case SP_VERB_VIEW_MODE_NO_FILTERS:
+ dt->setDisplayModeNoFilters();
+ break;
case SP_VERB_VIEW_MODE_OUTLINE:
dt->setDisplayModeOutline();
break;
new ZoomVerb(SP_VERB_VIEW_MODE_NORMAL, "ViewModeNormal", N_("_Normal"),
N_("Switch to normal display mode"), NULL),
+ new ZoomVerb(SP_VERB_VIEW_MODE_NO_FILTERS, "ViewModeNoFilters", N_("No _Filters"),
+ N_("Switch to normal display without filters"), NULL),
new ZoomVerb(SP_VERB_VIEW_MODE_OUTLINE, "ViewModeOutline", N_("_Outline"),
N_("Switch to outline (wireframe) display mode"), NULL),
new ZoomVerb(SP_VERB_VIEW_MODE_TOGGLE, "ViewModeToggle", N_("_Toggle"),
diff --git a/src/verbs.h b/src/verbs.h
index 89e677ead7149a248c50df55cfc45b14f6aceda2..0a1826580c30b48774f6436bfbfebc10760cd7be 100644 (file)
--- a/src/verbs.h
+++ b/src/verbs.h
SP_VERB_VIEW_NEW,
SP_VERB_VIEW_NEW_PREVIEW,
SP_VERB_VIEW_MODE_NORMAL,
+ SP_VERB_VIEW_MODE_NO_FILTERS,
SP_VERB_VIEW_MODE_OUTLINE,
SP_VERB_VIEW_MODE_TOGGLE,
SP_VERB_VIEW_CMS_TOGGLE,