summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Holder <thomas@thomas-holder.de>2018-09-18 14:29:23 +0000
committerThomas Holder <thomas@thomas-holder.de>2018-09-20 13:17:31 +0000
commitc37ae911dde4dffe81173c39d6da7d9163b143f7 (patch)
treeff7a6dd9ba890a207d9ba51b3547dfaaa083f7e8 /src
parentFix build (diff)
downloadinkscape-c37ae911dde4dffe81173c39d6da7d9163b143f7.tar.gz
inkscape-c37ae911dde4dffe81173c39d6da7d9163b143f7.zip
fix transform dialog icons with inverted y-axis
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/transformation.cpp13
-rw-r--r--src/ui/widget/labelled.cpp5
-rw-r--r--src/ui/widget/labelled.h5
3 files changed, 20 insertions, 3 deletions
diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp
index 14ddc9044..2bf13608f 100644
--- a/src/ui/dialog/transformation.cpp
+++ b/src/ui/dialog/transformation.cpp
@@ -125,6 +125,13 @@ Transformation::Transformation()
_check_apply_separately.set_active(prefs->getBool("/dialogs/transformation/applyseparately"));
_check_apply_separately.signal_toggled().connect(sigc::mem_fun(*this, &Transformation::onApplySeparatelyToggled));
+ // make icons match desktop rotation direction
+ if (getDesktop()->is_yaxisdown()) {
+ _scalar_move_vertical.flipIconVertically();
+ _scalar_rotate.flipIconVertically();
+ _scalar_skew_vertical.flipIconVertically();
+ }
+
// make sure all spinbuttons activate Apply on pressing Enter
((Gtk::Entry *) (_scalar_move_horizontal.getWidget()))->set_activates_default(true);
((Gtk::Entry *) (_scalar_move_vertical.getWidget()))->set_activates_default(true);
@@ -304,7 +311,7 @@ void Transformation::layoutPageRotate()
_page_rotate.table().attach(_clockwise_rotate, 4, 0, 1, 1);
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- if (prefs->getBool("/dialogs/transformation/rotateCounterClockwise", TRUE)) {
+ if (prefs->getBool("/dialogs/transformation/rotateCounterClockwise", TRUE) != getDesktop()->is_yaxisdown()) {
_counterclockwise_rotate.set_active();
onRotateCounterclockwiseClicked();
} else {
@@ -1003,14 +1010,14 @@ void Transformation::onRotateCounterclockwiseClicked()
{
_scalar_rotate.setTooltipText(_("Rotation angle (positive = counterclockwise)"));
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- prefs->setBool("/dialogs/transformation/rotateCounterClockwise", TRUE);
+ prefs->setBool("/dialogs/transformation/rotateCounterClockwise", !getDesktop()->is_yaxisdown());
}
void Transformation::onRotateClockwiseClicked()
{
_scalar_rotate.setTooltipText(_("Rotation angle (positive = clockwise)"));
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- prefs->setBool("/dialogs/transformation/rotateCounterClockwise", FALSE);
+ prefs->setBool("/dialogs/transformation/rotateCounterClockwise", getDesktop()->is_yaxisdown());
}
void Transformation::onSkewValueChanged()
diff --git a/src/ui/widget/labelled.cpp b/src/ui/widget/labelled.cpp
index 6ee2b752f..3480a2b6a 100644
--- a/src/ui/widget/labelled.cpp
+++ b/src/ui/widget/labelled.cpp
@@ -77,6 +77,11 @@ Labelled::setTooltipText(const Glib::ustring &tooltip)
_widget->set_tooltip_text(tooltip);
}
+void Labelled::flipIconVertically()
+{
+ _icon->set(_icon->get_pixbuf()->flip(false));
+}
+
bool Labelled::on_mnemonic_activate ( bool group_cycling )
{
return _widget->mnemonic_activate ( group_cycling );
diff --git a/src/ui/widget/labelled.h b/src/ui/widget/labelled.h
index 79dd271a0..0f59a4d68 100644
--- a/src/ui/widget/labelled.h
+++ b/src/ui/widget/labelled.h
@@ -57,6 +57,11 @@ public:
void setLabelText(const Glib::ustring &str);
void setTooltipText(const Glib::ustring &tooltip);
+ /**
+ * For matching flipped desktop y-direction
+ */
+ void flipIconVertically();
+
private:
bool on_mnemonic_activate( bool group_cycling ) override;