summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2018-09-15 10:09:11 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2018-09-15 10:09:11 +0000
commitd7ebcb3d030eeb458020b7d2d3da470ce003b9d0 (patch)
tree305ad434a85a0917b129a9429a3ac8defa64ab97 /src
parentUpdate measure segments helper info and align to messages LPE parameter (diff)
downloadinkscape-d7ebcb3d030eeb458020b7d2d3da470ce003b9d0.tar.gz
inkscape-d7ebcb3d030eeb458020b7d2d3da470ce003b9d0.zip
Improve message parameter and remove unecesary widgets from meassure segments LPE
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-measure-segments.cpp36
-rw-r--r--src/live_effects/lpe-measure-segments.h5
-rw-r--r--src/live_effects/parameter/message.cpp10
-rw-r--r--src/live_effects/parameter/message.h4
4 files changed, 26 insertions, 29 deletions
diff --git a/src/live_effects/lpe-measure-segments.cpp b/src/live_effects/lpe-measure-segments.cpp
index 489c89107..d163158bf 100644
--- a/src/live_effects/lpe-measure-segments.cpp
+++ b/src/live_effects/lpe-measure-segments.cpp
@@ -97,10 +97,7 @@ 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, "", 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)
+ helpdata(_("Help"), _("Measure segments help"), "helpdata", &wr, this, "", "")
{
//set to true the parameters you want to be changed his default values
registerParameter(&unit);
@@ -136,10 +133,7 @@ LPEMeasureSegments::LPEMeasureSegments(LivePathEffectObject *lpeobject) :
registerParameter(&bboxonly);
registerParameter(&centers);
registerParameter(&maxmin);
- registerParameter(&general);
- registerParameter(&projection);
- registerParameter(&options);
- registerParameter(&tips);
+ registerParameter(&helpdata);
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
Glib::ustring format_value = prefs->getString("/live_effects/measure-line/format");
@@ -185,14 +179,18 @@ LPEMeasureSegments::LPEMeasureSegments(LivePathEffectObject *lpeobject) :
locale_base = strdup(setlocale(LC_NUMERIC, nullptr));
previous_size = 0;
pagenumber = 0;
- 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\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"
- ));
+ helpdata.param_update_default(_("<b><big>General</big></b>\n"
+ "Measure display and positioning\n"
+ "<b><big>Projection</big></b>\n"
+ "Show a line with measurements based on the selected items\n"
+ "<b><big>Options</big></b>\n"
+ "That usually don't change much\n"
+ "<b><big>Help</big></b>\n"
+ "<b><i>Style Dialog</i></b> Styling using XML editor to find appropriate classes or ID's\n"
+ "<b><i>Blacklists</i></b> This allow to hide some segments or projection steps to measure\n"
+ "<b><i>Multiple Measures</i></b> In the same object, in conjunction of blacklists, "
+ "allow measures with diferent orientations or a extra projection \n"
+ "<b><i>Set Defaults</i></b> Remember all LPE has it in the bottom"));
}
LPEMeasureSegments::~LPEMeasureSegments() {
@@ -243,7 +241,6 @@ LPEMeasureSegments::newWidget()
{
vbox1->pack_start(*widg, false, true, 2);
} else if (param->param_key == "precision" ||
- param->param_key == "fix_overlaps" ||
param->param_key == "coloropacity" ||
param->param_key == "font" ||
param->param_key == "format" ||
@@ -255,10 +252,7 @@ LPEMeasureSegments::newWidget()
param->param_key == "hide_arrows" )
{
vbox2->pack_start(*widg, false, true, 2);
- } else if (param->param_key == "general" ||
- param->param_key == "projection" ||
- param->param_key == "options" ||
- param->param_key == "tips" )
+ } else if (param->param_key == "helpdata")
{
vbox3->pack_start(*widg, false, true, 2);
} else {
diff --git a/src/live_effects/lpe-measure-segments.h b/src/live_effects/lpe-measure-segments.h
index 92bb51b91..6d6afae30 100644
--- a/src/live_effects/lpe-measure-segments.h
+++ b/src/live_effects/lpe-measure-segments.h
@@ -80,10 +80,7 @@ private:
ScalarParam distance_projection;
ScalarParam angle_projection;
BoolParam avoid_overlapping;
- MessageParam general;
- MessageParam projection;
- MessageParam options;
- MessageParam tips;
+ MessageParam helpdata;
Glib::ustring display_unit;
bool locked_pagenumber;
double doc_scale;
diff --git a/src/live_effects/parameter/message.cpp b/src/live_effects/parameter/message.cpp
index da781a803..afb5f339f 100644
--- a/src/live_effects/parameter/message.cpp
+++ b/src/live_effects/parameter/message.cpp
@@ -15,16 +15,20 @@ 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, Gtk::Align halign,
- Gtk::Align valign, double marginstart, double marginend)
+ Effect* effect, const gchar * default_message, const Glib::ustring& legend,
+ Gtk::Align halign, Gtk::Align valign, double marginstart, double marginend)
: Parameter(label, tip, key, wr, effect),
message(default_message),
defmessage(default_message),
+ _legend(legend),
_halign(halign),
_valign(valign),
_marginstart(marginstart),
_marginend(marginend)
{
+ if (_legend == Glib::ustring("Use Label")) {
+ _legend = label;
+ }
_label = nullptr;
_min_height = -1;
}
@@ -73,7 +77,7 @@ MessageParam::param_set_min_height(int height)
Gtk::Widget *
MessageParam::param_newWidget()
{
- Gtk::Frame * frame = new Gtk::Frame (param_label);
+ Gtk::Frame * frame = new Gtk::Frame (_legend);
Gtk::Widget * widg_frame = frame->get_label_widget();
#if GTKMM_CHECK_VERSION(3,12,0)
diff --git a/src/live_effects/parameter/message.h b/src/live_effects/parameter/message.h
index fad60533f..28cd9642b 100644
--- a/src/live_effects/parameter/message.h
+++ b/src/live_effects/parameter/message.h
@@ -22,7 +22,8 @@ public:
Inkscape::UI::Widget::Registry* wr,
Effect* effect,
const gchar * default_message = "Default message",
- Gtk::Align halign = Gtk::ALIGN_END,
+ const Glib::ustring& legend = "Use Label",
+ Gtk::Align halign = Gtk::ALIGN_START,
Gtk::Align valign = Gtk::ALIGN_CENTER,
double marginstart = 6,
double marginend = 6);
@@ -47,6 +48,7 @@ private:
MessageParam& operator=(const MessageParam&) = delete;
const gchar * message;
const gchar * defmessage;
+ Glib::ustring _legend;
Gtk::Align _halign;
Gtk::Align _valign;
double _marginstart;