summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2019-02-25 01:57:29 +0000
committerMartin Owens <doctormo@gmail.com>2019-02-25 01:57:29 +0000
commiteccaee3d16d72776f9d25cdfd469e2bfc07a9eb3 (patch)
tree20b5203dca58ddfc8f29ab112cf6d07af65c078f /src
parentMerge in bazaar branch for alignment handles (diff)
downloadinkscape-eccaee3d16d72776f9d25cdfd469e2bfc07a9eb3.tar.gz
inkscape-eccaee3d16d72776f9d25cdfd469e2bfc07a9eb3.zip
Add option for on canvas align handles and move group selection checkbox
Diffstat (limited to 'src')
-rw-r--r--src/seltrans.cpp5
-rw-r--r--src/ui/dialog/align-and-distribute.cpp32
-rw-r--r--src/ui/dialog/align-and-distribute.h5
3 files changed, 31 insertions, 11 deletions
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index f43ce3f76..235c29c65 100644
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
@@ -223,9 +223,12 @@ void Inkscape::SelTrans::resetState()
void Inkscape::SelTrans::increaseState()
{
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ bool show_align = prefs->getBool("/dialogs/align/oncanvas", false);
+
if (_state == STATE_SCALE) {
_state = STATE_ROTATE;
- } else if (_state == STATE_ROTATE) {
+ } else if (_state == STATE_ROTATE && show_align) {
_state = STATE_ALIGN;
} else {
_state = STATE_SCALE;
diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp
index d62ca3ea7..c112f965d 100644
--- a/src/ui/dialog/align-and-distribute.cpp
+++ b/src/ui/dialog/align-and-distribute.cpp
@@ -938,8 +938,7 @@ AlignAndDistribute::AlignAndDistribute()
_removeOverlapTable(),
_nodesTable(),
_anchorLabel(_("Relative to: ")),
- _anchorLabelNode(_("Relative to: ")),
- _selgrpLabel(_("_Treat selection as group: "), true)
+ _anchorLabelNode(_("Relative to: "))
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
@@ -1085,17 +1084,30 @@ AlignAndDistribute::AlignAndDistribute()
_comboNode.set_active(prefs->getInt("/dialogs/align/align-nodes-to", 2));
_comboNode.signal_changed().connect(sigc::mem_fun(*this, &AlignAndDistribute::on_node_ref_change));
+ Gtk::Image* selgrp_icon = Gtk::manage(new Gtk::Image());
+ selgrp_icon = sp_get_icon_image("align-sel-as-group", Gtk::ICON_SIZE_LARGE_TOOLBAR);
+ _selgrp.add(*selgrp_icon);
+
+ _selgrp.set_active(prefs->getBool("/dialogs/align/sel-as-groups"));
+ _selgrp.set_relief(Gtk::RELIEF_NONE);
+ _selgrp.set_tooltip_text(_("Treat selection as group"));
+ _selgrp.signal_toggled().connect(sigc::mem_fun(*this, &AlignAndDistribute::on_selgrp_toggled));
+ _anchorBox.pack_end(_selgrp, false, false);
_anchorBox.pack_end(_combo, false, false);
_anchorBox.pack_end(_anchorLabel, false, false);
_anchorBoxNode.pack_end(_comboNode, false, false);
_anchorBoxNode.pack_end(_anchorLabelNode, false, false);
- _selgrpLabel.set_mnemonic_widget(_selgrp);
- _selgrpBox.pack_end(_selgrp, false, false);
- _selgrpBox.pack_end(_selgrpLabel, false, false);
- _selgrp.set_active(prefs->getBool("/dialogs/align/sel-as-groups"));
- _selgrp.signal_toggled().connect(sigc::mem_fun(*this, &AlignAndDistribute::on_selgrp_toggled));
+ Gtk::Image* oncanvas_icon = Gtk::manage(new Gtk::Image());
+ oncanvas_icon = sp_get_icon_image("align-on-canvas", Gtk::ICON_SIZE_LARGE_TOOLBAR);
+ _oncanvas.add(*oncanvas_icon);
+
+ _oncanvas.set_relief(Gtk::RELIEF_NONE);
+ _oncanvas.set_tooltip_text(_("Enable on-canvas alignment handles."));
+ _anchorBox.pack_start(_oncanvas, false, false);
+ _oncanvas.set_active(prefs->getBool("/dialogs/align/oncanvas"));
+ _oncanvas.signal_toggled().connect(sigc::mem_fun(*this, &AlignAndDistribute::on_oncanvas_toggled));
// Right align the buttons
_alignTableBox.pack_end(_alignTable, false, false);
@@ -1186,8 +1198,12 @@ void AlignAndDistribute::on_selgrp_toggled(){
//Make blink the master
}
+void AlignAndDistribute::on_oncanvas_toggled(){
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ prefs->setInt("/dialogs/align/oncanvas", _oncanvas.get_active());
-
+ //Make blink the master
+}
void AlignAndDistribute::setMode(bool nodeEdit)
{
diff --git a/src/ui/dialog/align-and-distribute.h b/src/ui/dialog/align-and-distribute.h
index ad23530ec..175ebdc21 100644
--- a/src/ui/dialog/align-and-distribute.h
+++ b/src/ui/dialog/align-and-distribute.h
@@ -63,6 +63,7 @@ protected:
void on_ref_change();
void on_node_ref_change();
void on_selgrp_toggled();
+ void on_oncanvas_toggled();
void addDistributeButton(const Glib::ustring &id, const Glib::ustring tiptext,
guint row, guint col, bool onInterSpace,
Geom::Dim2 orientation, float kBegin, float kEnd);
@@ -107,8 +108,8 @@ protected:
Gtk::HBox _nodesTableBox;
Gtk::Label _anchorLabel;
Gtk::Label _anchorLabelNode;
- Gtk::Label _selgrpLabel;
- Gtk::CheckButton _selgrp;
+ Gtk::ToggleButton _selgrp;
+ Gtk::ToggleButton _oncanvas;
Gtk::ComboBoxText _combo;
Gtk::HBox _anchorBoxNode;
Gtk::ComboBoxText _comboNode;