From c2d9a5f2a548f8c37bfd1aa24230a8654fadba9b Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Fri, 14 Sep 2018 21:18:15 +0200 Subject: Update measure segments helper info and align to messages LPE parameter --- src/live_effects/lpe-measure-segments.cpp | 17 +++++++++-------- src/live_effects/parameter/message.cpp | 30 +++++++++++++++++------------- src/live_effects/parameter/message.h | 14 +++++++++++++- 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(_("Style Dialog styling using XML editor to find appropriate classes or ID's\n" - "Blacklists This allow to hide some segments or projection steps to measure" - "Apply mutiple times in conjunction of blacklists to allow measures with diferent orientations or a extra projection \n" + tips.param_update_default(_("Style Dialog Styling using XML editor to find appropriate classes or ID's\n" + "Blacklists This allow to hide some segments or projection steps to measure\n" + "Mutiple Measures In the same object, in conjunction of blacklists, allow measures with diferent orientations or a extra projection \n" + "Set Defaults 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 (_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 -- cgit v1.2.3