summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJabiertxof <jabier.arraiza@marker.es>2018-09-14 19:18:15 +0000
committerJabiertxof <jabier.arraiza@marker.es>2018-09-14 19:18:15 +0000
commitc2d9a5f2a548f8c37bfd1aa24230a8654fadba9b (patch)
treeadecbb6c99958d2a1992bd1020e3fecdeb967547
parentUpdate info widget inmeasure segments (diff)
downloadinkscape-c2d9a5f2a548f8c37bfd1aa24230a8654fadba9b.tar.gz
inkscape-c2d9a5f2a548f8c37bfd1aa24230a8654fadba9b.zip
Update measure segments helper info and align to messages LPE parameter
-rw-r--r--src/live_effects/lpe-measure-segments.cpp17
-rw-r--r--src/live_effects/parameter/message.cpp30
-rw-r--r--src/live_effects/parameter/message.h14
3 files changed, 39 insertions, 22 deletions
diff --git a/src/live_effects/lpe-measure-segments.cpp b/src/live_effects/lpe-measure-segments.cpp
index 67c360294..489c89107 100644
--- a/src/live_effects/lpe-measure-segments.cpp
+++ b/src/live_effects/lpe-measure-segments.cpp
@@ -97,10 +97,10 @@ LPEMeasureSegments::LPEMeasureSegments(LivePathEffectObject *lpeobject) :
bboxonly(_("Only bounding box"), _("Measure only bbox and hide nodes"), "bboxonly", &wr, this, false),
centers(_("Project center"), _("Use centers as measurement"), "centers", &wr, this, false),
maxmin(_("Only max and min"), _("Compute only max/min projection values"), "maxmin", &wr, this, false),
- general(_("General"), _("General"), "general", &wr, this, ""),
- projection(_("Projection"), _("Projection"), "projection", &wr, this, ""),
- options(_("Options"), _("Options"), "options", &wr, this, ""),
- tips(_("Tips"), _("Tips"), "tips", &wr, this, "")
+ general(_("General"), _("General"), "general", &wr, this, "", Gtk::ALIGN_START, Gtk::ALIGN_CENTER),
+ projection(_("Projection"), _("Projection"), "projection", &wr, this, "", Gtk::ALIGN_START, Gtk::ALIGN_CENTER),
+ options(_("Options"), _("Options"), "options", &wr, this, "", Gtk::ALIGN_START, Gtk::ALIGN_CENTER),
+ tips(_("Tips"), _("Tips"), "tips", &wr, this, "", Gtk::ALIGN_START, Gtk::ALIGN_CENTER)
{
//set to true the parameters you want to be changed his default values
registerParameter(&unit);
@@ -185,12 +185,13 @@ LPEMeasureSegments::LPEMeasureSegments(LivePathEffectObject *lpeobject) :
locale_base = strdup(setlocale(LC_NUMERIC, nullptr));
previous_size = 0;
pagenumber = 0;
- general.param_update_default(_("Measure display and positioning, remembe "));
+ general.param_update_default(_("Measure display and positioning"));
projection.param_update_default(_("To activate pulse the icon down \"Active\" to set the elements on clipboard, showing a line with measurements based on the selected items"));
options.param_update_default(_("Here we show measurement settings, that usually don't change much"));
- tips.param_update_default(_("<b>Style Dialog</b> styling using XML editor to find appropriate classes or ID's\n"
- "<b>Blacklists</b> This allow to hide some segments or projection steps to measure"
- "<b>Apply mutiple times</b> in conjunction of blacklists to allow measures with diferent orientations or a extra projection \n"
+ tips.param_update_default(_("<b>Style Dialog</b> Styling using XML editor to find appropriate classes or ID's\n"
+ "<b>Blacklists</b> This allow to hide some segments or projection steps to measure\n"
+ "<b>Mutiple Measures</b> In the same object, in conjunction of blacklists, allow measures with diferent orientations or a extra projection \n"
+ "<b>Set Defaults</b> Remember all LPE has it in the bottom \n"
));
}
diff --git a/src/live_effects/parameter/message.cpp b/src/live_effects/parameter/message.cpp
index a6e919558..da781a803 100644
--- a/src/live_effects/parameter/message.cpp
+++ b/src/live_effects/parameter/message.cpp
@@ -15,10 +15,15 @@ namespace LivePathEffect {
MessageParam::MessageParam( const Glib::ustring& label, const Glib::ustring& tip,
const Glib::ustring& key, Inkscape::UI::Widget::Registry* wr,
- Effect* effect, const gchar * default_message )
+ Effect* effect, const gchar * default_message, Gtk::Align halign,
+ Gtk::Align valign, double marginstart, double marginend)
: Parameter(label, tip, key, wr, effect),
message(default_message),
- defmessage(default_message)
+ defmessage(default_message),
+ _halign(halign),
+ _valign(valign),
+ _marginstart(marginstart),
+ _marginend(marginend)
{
_label = nullptr;
_min_height = -1;
@@ -72,28 +77,27 @@ MessageParam::param_newWidget()
Gtk::Widget * widg_frame = frame->get_label_widget();
#if GTKMM_CHECK_VERSION(3,12,0)
- widg_frame->set_margin_end(5);
- widg_frame->set_margin_start(5);
+ widg_frame->set_margin_end(_marginend);
+ widg_frame->set_margin_start(_marginstart);
#else
- widg_frame->set_margin_right(5);
- widg_frame->set_margin_left(5);
+ widg_frame->set_margin_right(_marginend);
+ widg_frame->set_margin_left(_marginstart);
#endif
-
_label = new Gtk::Label (message, Gtk::ALIGN_END);
_label->set_use_underline (true);
_label->set_use_markup();
_label->set_line_wrap(true);
_label->set_size_request(-1, _min_height);
Gtk::Widget* widg_label = dynamic_cast<Gtk::Widget *> (_label);
- widg_label->set_margin_top(8);
- widg_label->set_margin_bottom(10);
+ widg_label->set_halign(_halign);
+ widg_label->set_valign(_valign);
#if GTKMM_CHECK_VERSION(3,12,0)
- widg_label->set_margin_end(6);
- widg_label->set_margin_start(6);
+ widg_label->set_margin_end(_marginend);
+ widg_label->set_margin_start(_marginstart);
#else
- widg_label->set_margin_right(6);
- widg_label->set_margin_left(6);
+ widg_label->set_margin_right(_marginstart);
+ widg_label->set_margin_left(_marginstart);
#endif
frame->add(*widg_label);
diff --git a/src/live_effects/parameter/message.h b/src/live_effects/parameter/message.h
index 3d9ddf62b..fad60533f 100644
--- a/src/live_effects/parameter/message.h
+++ b/src/live_effects/parameter/message.h
@@ -21,7 +21,11 @@ public:
const Glib::ustring& key,
Inkscape::UI::Widget::Registry* wr,
Effect* effect,
- const gchar * default_message = "Default message");
+ const gchar * default_message = "Default message",
+ Gtk::Align halign = Gtk::ALIGN_END,
+ Gtk::Align valign = Gtk::ALIGN_CENTER,
+ double marginstart = 6,
+ double marginend = 6);
~MessageParam() override = default;
Gtk::Widget * param_newWidget() override;
@@ -43,6 +47,14 @@ private:
MessageParam& operator=(const MessageParam&) = delete;
const gchar * message;
const gchar * defmessage;
+ Gtk::Align _halign;
+ Gtk::Align _valign;
+ double _marginstart;
+ double _marginend;
+ double _marginleft;
+ double _marginright;
+
+
};
} //namespace LivePathEffect