summaryrefslogtreecommitdiffstats
path: root/src/desktop.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2011-02-21 22:28:50 +0000
committerJohan Engelen <goejendaagh@zonnet.nl>2011-02-21 22:28:50 +0000
commit4a4047fdd90aede6d16c020ddcd70c57ea4aa218 (patch)
treee43b214f3025b953644385c301a03a4d2f3b1dbf /src/desktop.cpp
parentFinished cleanup of outdated SP_OBJECT_PARENT C macro. (diff)
downloadinkscape-4a4047fdd90aede6d16c020ddcd70c57ea4aa218.tar.gz
inkscape-4a4047fdd90aede6d16c020ddcd70c57ea4aa218.zip
NEW: Grayscale color display mode. (toggle assigned keybinding: Shift+keypad5)
(bzr r10065)
Diffstat (limited to 'src/desktop.cpp')
-rw-r--r--src/desktop.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp
index b5e7cdd33..f132ec897 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -154,6 +154,7 @@ SPDesktop::SPDesktop() :
_layer_hierarchy( 0 ),
_reconstruction_old_layer_id( 0 ),
_display_mode(Inkscape::RENDERMODE_NORMAL),
+ _display_color_mode(Inkscape::COLORRENDERMODE_NORMAL),
_widget( 0 ),
_inkscape( 0 ),
_guides_message_context( 0 ),
@@ -454,6 +455,13 @@ void SPDesktop::_setDisplayMode(Inkscape::RenderMode mode) {
sp_canvas_item_affine_absolute (SP_CANVAS_ITEM (main), _d2w); // redraw
_widget->setTitle( sp_desktop_document(this)->getName() );
}
+void SPDesktop::_setDisplayColorMode(Inkscape::ColorRenderMode mode) {
+ SP_CANVAS_ARENA (drawing)->arena->colorrendermode = mode;
+ canvas->colorrendermode = mode;
+ _display_color_mode = mode;
+ sp_canvas_item_affine_absolute (SP_CANVAS_ITEM (main), _d2w); // redraw
+ _widget->setTitle( sp_desktop_document(this)->getName() );
+}
void SPDesktop::displayModeToggle() {
switch (_display_mode) {
@@ -466,11 +474,23 @@ void SPDesktop::displayModeToggle() {
case Inkscape::RENDERMODE_OUTLINE:
_setDisplayMode(Inkscape::RENDERMODE_NORMAL);
break;
-// case Inkscape::RENDERMODE_PRINT_COLORS_PREVIEW:
default:
_setDisplayMode(Inkscape::RENDERMODE_NORMAL);
}
}
+void SPDesktop::displayColorModeToggle() {
+ switch (_display_color_mode) {
+ case Inkscape::COLORRENDERMODE_NORMAL:
+ _setDisplayColorMode(Inkscape::COLORRENDERMODE_GRAYSCALE);
+ break;
+ case Inkscape::COLORRENDERMODE_GRAYSCALE:
+ _setDisplayColorMode(Inkscape::COLORRENDERMODE_NORMAL);
+ break;
+// case Inkscape::COLORRENDERMODE_PRINT_COLORS_PREVIEW:
+ default:
+ _setDisplayColorMode(Inkscape::COLORRENDERMODE_NORMAL);
+ }
+}
/**
* Returns current root (=bottom) layer.