summaryrefslogtreecommitdiffstats
path: root/src/ui/widget
diff options
context:
space:
mode:
authorJabiertxo Arraiza Cenoz <jtx@jtx-desktop.markerlab.es>2017-11-10 18:57:54 +0000
committerJabiertxo Arraiza Cenoz <jtx@jtx-desktop.markerlab.es>2017-11-10 18:57:54 +0000
commitdc6c4dc337aa2ad766cada2eb06fe4c186a89d14 (patch)
tree3fc8d3fd109b7c89751183b8be880e856be5ff34 /src/ui/widget
parentMerge branch 'master' into powerpencil (diff)
parentRemoving regects (diff)
downloadinkscape-dc6c4dc337aa2ad766cada2eb06fe4c186a89d14.tar.gz
inkscape-dc6c4dc337aa2ad766cada2eb06fe4c186a89d14.zip
Merge branch 'master' into powerpencil
Diffstat (limited to 'src/ui/widget')
-rw-r--r--src/ui/widget/color-notebook.cpp2
-rw-r--r--src/ui/widget/color-picker.cpp1
-rw-r--r--src/ui/widget/font-variants.cpp2
-rw-r--r--src/ui/widget/object-composite-settings.cpp2
-rw-r--r--src/ui/widget/page-sizer.cpp45
-rw-r--r--src/ui/widget/page-sizer.h26
-rw-r--r--src/ui/widget/panel.h2
7 files changed, 59 insertions, 21 deletions
diff --git a/src/ui/widget/color-notebook.cpp b/src/ui/widget/color-notebook.cpp
index ba333d0ed..bd4b21bdb 100644
--- a/src/ui/widget/color-notebook.cpp
+++ b/src/ui/widget/color-notebook.cpp
@@ -289,7 +289,7 @@ void ColorNotebook::_updateICCButtons()
/* Some literature states that when the sum of paint values exceed 320%, it is considered to be a satured
color,
- which means the paper can get too wet due to an excessive ammount of ink. This may lead to several
+ which means the paper can get too wet due to an excessive amount of ink. This may lead to several
issues
such as misalignment and poor quality of printing in general.*/
if (ink_sum > 3.2)
diff --git a/src/ui/widget/color-picker.cpp b/src/ui/widget/color-picker.cpp
index 5a62c3c98..5c6820e83 100644
--- a/src/ui/widget/color-picker.cpp
+++ b/src/ui/widget/color-picker.cpp
@@ -33,7 +33,6 @@ ColorPicker::ColorPicker (const Glib::ustring& title, const Glib::ustring& tip,
_colorSelectorDialog("dialogs.colorpickerwindow")
{
setupDialog(title);
- set_relief (Gtk::RELIEF_NONE);
_preview.show();
add (_preview);
set_tooltip_text (tip);
diff --git a/src/ui/widget/font-variants.cpp b/src/ui/widget/font-variants.cpp
index d1755a6d5..f6c81df3b 100644
--- a/src/ui/widget/font-variants.cpp
+++ b/src/ui/widget/font-variants.cpp
@@ -563,7 +563,7 @@ namespace Widget {
if( (it = table_copy.find("zero")) != table_copy.end() ) table_copy.erase( it );
std::string ott_list = "OpenType tables not included above: ";
for(it = table_copy.begin(); it != table_copy.end(); ++it) {
- // std::cout << "Other: " << it->first << " Occurances: " << it->second << std::endl;
+ // std::cout << "Other: " << it->first << " Occurrences: " << it->second << std::endl;
ott_list += it->first;
ott_list += ", ";
}
diff --git a/src/ui/widget/object-composite-settings.cpp b/src/ui/widget/object-composite-settings.cpp
index ca33a845c..5f5b801d1 100644
--- a/src/ui/widget/object-composite-settings.cpp
+++ b/src/ui/widget/object-composite-settings.cpp
@@ -67,7 +67,7 @@ ObjectCompositeSettings::ObjectCompositeSettings(unsigned int verb_code, char co
show_all_children();
- // These signals dont properly detect change in desktop, rely on owner dialog to call setSubject() from setTargetDesktop()
+ // These signals don't properly detect change in desktop, rely on owner dialog to call setSubject() from setTargetDesktop()
//_desktop_activated = g_signal_connect ( G_OBJECT (INKSCAPE), "activate_desktop", G_CALLBACK (&ObjectCompositeSettings::_on_desktop_activate), this );
//_desktop_activated = g_signal_connect ( G_OBJECT (INKSCAPE), "deactivate_desktop", G_CALLBACK (&ObjectCompositeSettings::_on_desktop_deactivate), this );
}
diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp
index 7427ad4e2..06d54b682 100644
--- a/src/ui/widget/page-sizer.cpp
+++ b/src/ui/widget/page-sizer.cpp
@@ -219,6 +219,7 @@ PageSizer::PageSizer(Registry & _wr)
_dimensionUnits( _("U_nits:"), "units", _wr ),
_dimensionWidth( _("_Width:"), _("Width of paper"), "width", _dimensionUnits, _wr ),
_dimensionHeight( _("_Height:"), _("Height of paper"), "height", _dimensionUnits, _wr ),
+ _marginLock( _("L_ock"), _("Lock margins"), "lock-margins", _wr ),
_marginTop( _("T_op margin:"), _("Top margin"), "fit-margin-top", _wr ),
_marginLeft( _("L_eft:"), _("Left margin"), "fit-margin-left", _wr),
_marginRight( _("Ri_ght:"), _("Right margin"), "fit-margin-right", _wr),
@@ -376,27 +377,33 @@ PageSizer::PageSizer(Registry & _wr)
_marginTop.set_halign(Gtk::ALIGN_CENTER);
_marginTop.set_hexpand();
_marginTop.set_vexpand();
- _marginTable.attach(_marginTop, 0, 0, 2, 1);
+
+ _marginTable.attach(_marginTop, 0, 0, 3, 1);
- _marginLeft.set_halign(Gtk::ALIGN_START);
+ _marginLeft.set_halign(Gtk::ALIGN_CENTER);
_marginLeft.set_hexpand();
_marginLeft.set_vexpand();
_marginTable.attach(_marginLeft, 0, 1, 1, 1);
-
- _marginRight.set_halign(Gtk::ALIGN_END);
+
+ _marginLock.set_halign(Gtk::ALIGN_CENTER);
+ _marginLock.set_hexpand();
+ _marginLock.set_vexpand();
+ _marginTable.attach(_marginLock, 1, 1, 1, 1);
+
+ _marginRight.set_halign(Gtk::ALIGN_CENTER);
_marginRight.set_hexpand();
_marginRight.set_vexpand();
- _marginTable.attach(_marginRight, 1, 1, 1, 1);
-
+ _marginTable.attach(_marginRight, 2, 1, 1, 1);
+
_marginBottom.set_halign(Gtk::ALIGN_CENTER);
_marginBottom.set_hexpand();
_marginBottom.set_vexpand();
- _marginTable.attach(_marginBottom, 0, 2, 2, 1);
+ _marginTable.attach(_marginBottom, 0, 2, 3, 1);
_fitPageButton.set_halign(Gtk::ALIGN_CENTER);
_fitPageButton.set_hexpand();
_fitPageButton.set_vexpand();
- _marginTable.attach(_fitPageButton, 0, 3, 2, 1);
+ _marginTable.attach(_fitPageButton, 0, 3, 3, 1);
_fitPageButton.set_use_underline();
_fitPageButton.set_label(_("_Resize page to drawing or selection (Ctrl+Shift+R)"));
@@ -474,6 +481,10 @@ PageSizer::init ()
_changedvy_connection = _viewboxY.signal_value_changed().connect (sigc::mem_fun (*this, &PageSizer::on_viewbox_changed));
_changedvw_connection = _viewboxW.signal_value_changed().connect (sigc::mem_fun (*this, &PageSizer::on_viewbox_changed));
_changedvh_connection = _viewboxH.signal_value_changed().connect (sigc::mem_fun (*this, &PageSizer::on_viewbox_changed));
+ _changedmt_connection = _marginTop.signal_value_changed().connect (sigc::bind<RegisteredScalar*>(sigc::mem_fun (*this, &PageSizer::on_margin_changed), &_marginTop));
+ _changedmb_connection = _marginBottom.signal_value_changed().connect (sigc::bind<RegisteredScalar*>(sigc::mem_fun (*this, &PageSizer::on_margin_changed), &_marginBottom));
+ _changedml_connection = _marginLeft.signal_value_changed().connect (sigc::bind<RegisteredScalar*>(sigc::mem_fun (*this, &PageSizer::on_margin_changed), &_marginLeft));
+ _changedmr_connection = _marginRight.signal_value_changed().connect (sigc::bind<RegisteredScalar*>(sigc::mem_fun (*this, &PageSizer::on_margin_changed), &_marginRight));
show_all_children();
}
@@ -892,6 +903,24 @@ PageSizer::on_viewbox_changed()
}
}
+/**
+ * Callback for viewbox widgets
+ */
+void
+PageSizer::on_margin_changed(RegisteredScalar* widg)
+{
+ double value = widg->getValue();
+ if (_widgetRegistry->isUpdating()) return;
+ if (_marginLock.get_active() && !_marginLocked) {
+ _marginLocked = true;
+ _marginLeft.setValue(value);
+ _marginRight.setValue(value);
+ _marginTop.setValue(value);
+ _marginBottom.setValue(value);
+ _marginLocked = false;
+ }
+}
+
} // namespace Widget
} // namespace UI
} // namespace Inkscape
diff --git a/src/ui/widget/page-sizer.h b/src/ui/widget/page-sizer.h
index 329ecfc6d..7cf8bacfd 100644
--- a/src/ui/widget/page-sizer.h
+++ b/src/ui/widget/page-sizer.h
@@ -161,7 +161,11 @@ public:
* of the ui widgets to match the xml).
*/
void updateFitMarginsUI(Inkscape::XML::Node *nv_repr);
-
+
+ /**
+ * Updates the margin widgets. If lock widget is active
+ */
+ void on_margin_changed(RegisteredScalar* widg);
/**
* Updates the scale widgets. (Just changes the values of the ui widgets.)
*/
@@ -225,13 +229,15 @@ protected:
//### Fit Page options
Gtk::Expander _fitPageMarginExpander;
- Gtk::Grid _marginTable;
- RegisteredScalar _marginTop;
- RegisteredScalar _marginLeft;
- RegisteredScalar _marginRight;
- RegisteredScalar _marginBottom;
- Gtk::Button _fitPageButton;
- bool _lockMarginUpdate;
+ Gtk::Grid _marginTable;
+ RegisteredCheckButton _marginLock;
+ RegisteredScalar _marginTop;
+ RegisteredScalar _marginLeft;
+ RegisteredScalar _marginRight;
+ RegisteredScalar _marginBottom;
+ Gtk::Button _fitPageButton;
+ bool _lockMarginUpdate;
+ bool _marginLocked;
// Document scale
Gtk::Frame _scaleFrame;
@@ -265,6 +271,10 @@ protected:
sigc::connection _changedvy_connection;
sigc::connection _changedvw_connection;
sigc::connection _changedvh_connection;
+ sigc::connection _changedmt_connection;
+ sigc::connection _changedmb_connection;
+ sigc::connection _changedml_connection;
+ sigc::connection _changedmr_connection;
Registry *_widgetRegistry;
diff --git a/src/ui/widget/panel.h b/src/ui/widget/panel.h
index b5498498d..06b65dfbc 100644
--- a/src/ui/widget/panel.h
+++ b/src/ui/widget/panel.h
@@ -104,7 +104,7 @@ public:
void setDefaultResponse(int response_id);
void setResponseSensitive(int response_id, bool setting);
- /* Return signals. Signals emited by PanelDialog. */
+ /* Return signals. Signals emitted by PanelDialog. */
virtual sigc::signal<void, SPDesktop *, SPDocument *> &signalDocumentReplaced();
virtual sigc::signal<void, SPDesktop *> &signalActivateDesktop();
virtual sigc::signal<void, SPDesktop *> &signalDeactiveDesktop();