summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bd84843)
raw | patch | inline | side by side (parent: bd84843)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 3 Nov 2006 01:51:51 +0000 (01:51 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 3 Nov 2006 01:51:51 +0000 (01:51 +0000) |
src/desktop.cpp | patch | blob | history | |
src/desktop.h | patch | blob | history | |
src/preferences-skeleton.h | patch | blob | history | |
src/verbs.cpp | patch | blob | history | |
src/verbs.h | patch | blob | history |
diff --git a/src/desktop.cpp b/src/desktop.cpp
index df13bed37361adcf4ad94adb223ac9494ff82da2..7b0c1f6fcb8f2f6d6e3d29f6aee27a86aab29df8 100644 (file)
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
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);
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
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.
*/
diff --git a/src/desktop.h b/src/desktop.h
index 948fd53bc304a4310a04402eb751001917045f42..708ca8fd5a3ae34caadad4226c1ef7a6a66721b4 100644 (file)
--- a/src/desktop.h
+++ b/src/desktop.h
void setDisplayModeNormal();
void setDisplayModeOutline();
+ void displayModeToggle();
void set_active (bool new_active);
SPObject *currentRoot() const;
index ec8ca44289d7e8d81844e303f698612431489c95..32614fc7b864a2e208d9022a888669fe30b4f102 100644 (file)
" <group id=\"compassangledisplay\" value=\"0\"/>\n"
" <group id=\"maskobject\" topmost=\"1\" remove=\"1\"/>\n"
" <group id=\"blurquality\" value=\"0\"/>\n"
+" <group id=\"startmode\" outline=\"0\"/>\n"
+" <group id=\"outlinemode\" value=\"0\"/>\n"
" <group id=\"wireframecolors\" "
" onlight=\"255\"" // 000000ff
" ondark=\"4294967295\"" //ffffffff
diff --git a/src/verbs.cpp b/src/verbs.cpp
index d741d5a8fca5b36eb93db8aa3cf3a446dd717803..58003bbdb21f12bdf60e5def174f238eb904c524 100644 (file)
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
case SP_VERB_VIEW_MODE_OUTLINE:
dt->setDisplayModeOutline();
break;
+ case SP_VERB_VIEW_MODE_TOGGLE:
+ dt->displayModeToggle();
+ break;
case SP_VERB_VIEW_ICON_PREVIEW:
show_panel( Inkscape::UI::Dialogs::IconPreviewPanel::getInstance(), "dialogs.iconpreview", SP_VERB_VIEW_ICON_PREVIEW );
break;
N_("Switch to normal display mode"), 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 Display Mode"),
+ N_("Toggle between normal and outline display modes"), NULL),
new ZoomVerb(SP_VERB_VIEW_ICON_PREVIEW, "ViewIconPreview", N_("Ico_n Preview..."),
N_("Open a window to preview objects at different icon resolutions"), "view_icon_preview"),
diff --git a/src/verbs.h b/src/verbs.h
index 2055ac2eee82ae84e0b4fefbf7f302621c599d28..f20806c02364229ae1595f9f5ce315eedf82fd24 100644 (file)
--- a/src/verbs.h
+++ b/src/verbs.h
SP_VERB_VIEW_NEW_PREVIEW,
SP_VERB_VIEW_MODE_NORMAL,
SP_VERB_VIEW_MODE_OUTLINE,
+ SP_VERB_VIEW_MODE_TOGGLE,
SP_VERB_VIEW_ICON_PREVIEW,
SP_VERB_ZOOM_PAGE,
SP_VERB_ZOOM_PAGE_WIDTH,