summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2016-12-01 13:05:02 +0000
committertavmjong-free <tavmjong@free.fr>2016-12-01 13:05:02 +0000
commitd87cfa4971963dfb8118ce31e169854fce85bccd (patch)
tree498675c4078133897637abd22fc3354a985a907f /src/ui
parentFix bug with mesh handle update when corner moved via keys. (diff)
downloadinkscape-d87cfa4971963dfb8118ce31e169854fce85bccd.tar.gz
inkscape-d87cfa4971963dfb8118ce31e169854fce85bccd.zip
Add toggles for handle visibility, editing fill, and editing stroke.
(bzr r15289)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/tools/mesh-tool.cpp21
-rw-r--r--src/ui/tools/mesh-tool.h27
2 files changed, 37 insertions, 11 deletions
diff --git a/src/ui/tools/mesh-tool.cpp b/src/ui/tools/mesh-tool.cpp
index 61232fb2c..b05caf43a 100644
--- a/src/ui/tools/mesh-tool.cpp
+++ b/src/ui/tools/mesh-tool.cpp
@@ -75,6 +75,9 @@ MeshTool::MeshTool()
: ToolBase(cursor_gradient_xpm, 4, 4)
, cursor_addnode(false)
, node_added(false)
+ , show_handles(true)
+ , edit_fill(true)
+ , edit_stroke(true)
// TODO: Why are these connections stored as pointers?
, selcon(NULL)
, subselcon(NULL)
@@ -253,7 +256,25 @@ void MeshTool::setup() {
)
));
+ sp_event_context_read(this, "show_handles");
+ sp_event_context_read(this, "edit_fill");
+ sp_event_context_read(this, "edit_stroke");
+
this->selection_changed(selection);
+
+}
+
+void MeshTool::set(const Inkscape::Preferences::Entry& value) {
+ Glib::ustring entry_name = value.getEntryName();
+ if (entry_name == "show_handles") {
+ this->show_handles = value.getBool(true);
+ } else if (entry_name == "edit_fill") {
+ this->edit_fill = value.getBool(true);
+ } else if (entry_name == "edit_stroke") {
+ this->edit_stroke = value.getBool(true);
+ } else {
+ ToolBase::set(value);
+ }
}
void
diff --git a/src/ui/tools/mesh-tool.h b/src/ui/tools/mesh-tool.h
index f142bfd9c..1f012dc53 100644
--- a/src/ui/tools/mesh-tool.h
+++ b/src/ui/tools/mesh-tool.h
@@ -31,29 +31,34 @@ namespace Tools {
class MeshTool : public ToolBase {
public:
- MeshTool();
- virtual ~MeshTool();
+ MeshTool();
+ virtual ~MeshTool();
Geom::Point origin;
- bool cursor_addnode;
-
- bool node_added;
-
Geom::Point mousepoint_doc; // stores mousepoint when over_line in doc coords
sigc::connection *selcon;
sigc::connection *subselcon;
- static const std::string prefsPath;
+ static const std::string prefsPath;
- virtual void setup();
- virtual bool root_handler(GdkEvent* event);
+ virtual void setup();
+ virtual void set(const Inkscape::Preferences::Entry& val);
+ virtual bool root_handler(GdkEvent* event);
- virtual const std::string& getPrefsPath();
+ virtual const std::string& getPrefsPath();
private:
- void selection_changed(Inkscape::Selection* sel);
+ void selection_changed(Inkscape::Selection* sel);
+
+ bool cursor_addnode;
+ bool node_added;
+ bool show_handles;
+ bool edit_fill;
+ bool edit_stroke;
+
+
};
void sp_mesh_context_select_next(ToolBase *event_context);