From cebbe5b970cba85a5e21f8347f0a20e78351d394 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Thu, 28 Jul 2016 11:22:07 +0100 Subject: extensions: Drop GTKMM2 fallbacks (bzr r15023.2.5) --- src/extension/param/bool.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/extension/param/bool.cpp') diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp index d64f798ba..e67d3e3f5 100644 --- a/src/extension/param/bool.cpp +++ b/src/extension/param/bool.cpp @@ -129,12 +129,8 @@ Gtk::Widget *ParamBool::get_widget(SPDocument * doc, Inkscape::XML::Node * node, return NULL; } -#if WITH_GTKMM_3_0 - Gtk::Box * hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 4)); + auto hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 4)); hbox->set_homogeneous(false); -#else - Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4)); -#endif Gtk::Label * label = Gtk::manage(new Gtk::Label(_text, Gtk::ALIGN_START)); label->show(); -- cgit v1.2.3 From a65a0a21e5452ced77123a8b846ff10cc1bc74b0 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 12 Feb 2017 15:59:14 +0100 Subject: Extensions: Make "indent" attribute a common attribute for all parameters that behaves more consistent and predictable than before. - Every "Parameter" now has an "_indent" member variable (specifying the indentation level; set in "Parameter::make()", see parameter.cpp) - Indentation is achieved by using "set_margin_left()" on the parameter's widget. This fixes bug #1662035 (comment #4 contains some more details about this patch). - Specifying "indent" on a parameter will now work consistently for all parameters. Previously the "indent" attribute often had no effect at all, e.g. for notebooks but also for parameters with 'appearance="full"' which was reasonable in most cases but made the outcome of using this attribute often unpredictable and is unnecessarily restrictive. - Most visible change: "description"s always used an indentation level of at least one (even if no indentation was specified). For the sake of consistency this discrepancy was dropped. Previous appearance can easily be restored by setting 'indent="1"'. Fixed bugs: - https://launchpad.net/bugs/1662035 (bzr r15508) --- src/extension/param/bool.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/extension/param/bool.cpp') diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp index ca61d8c51..833215546 100644 --- a/src/extension/param/bool.cpp +++ b/src/extension/param/bool.cpp @@ -24,9 +24,17 @@ namespace Inkscape { namespace Extension { -ParamBool::ParamBool(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) : - Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, ext), - _value(false), _indent(0) +ParamBool::ParamBool(const gchar * name, + const gchar * guitext, + const gchar * desc, + const Parameter::_scope_t scope, + bool gui_hidden, + const gchar * gui_tip, + int indent, + Inkscape::Extension::Extension * ext, + Inkscape::XML::Node * xml) + : Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, indent, ext) + , _value(false) { const char * defaultval = NULL; if (xml->firstChild() != NULL) { @@ -39,11 +47,6 @@ ParamBool::ParamBool(const gchar * name, const gchar * guitext, const gchar * de _value = false; } - const char * indent = xml->attribute("indent"); - if (indent != NULL) { - _indent = atoi(indent) * 12; - } - gchar * pref_name = this->pref_name(); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); _value = prefs->getBool(extension_pref_root + pref_name, _value); @@ -66,7 +69,7 @@ bool ParamBool::set( bool in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node bool ParamBool::get(const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) const { - return _value; + return _value; } /** @@ -139,7 +142,7 @@ Gtk::Widget *ParamBool::get_widget(SPDocument * doc, Inkscape::XML::Node * node, ParamBoolCheckButton * checkbox = Gtk::manage(new ParamBoolCheckButton(this, doc, node, changeSignal)); checkbox->show(); - hbox->pack_start(*checkbox, false, false, _indent); + hbox->pack_start(*checkbox, false, false); hbox->show(); -- cgit v1.2.3 From a2e57d792590665163dd07eb5e926017e40ccb90 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Mon, 13 Feb 2017 02:46:19 +0100 Subject: Extensions: Work around gtk3 width/height calculation bug for long labels Also use constants for most dimensions so they can easily be chaned in future. (bzr r15511) --- src/extension/param/bool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension/param/bool.cpp') diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp index 833215546..9f8d3dcc0 100644 --- a/src/extension/param/bool.cpp +++ b/src/extension/param/bool.cpp @@ -133,7 +133,7 @@ Gtk::Widget *ParamBool::get_widget(SPDocument * doc, Inkscape::XML::Node * node, return NULL; } - auto hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 4)); + auto hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, Parameter::GUI_PARAM_WIDGETS_SPACING)); hbox->set_homogeneous(false); Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_START)); -- cgit v1.2.3 From bab6dfe02bd9556c931973a272e154251764e88e Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Mon, 24 Apr 2017 20:59:06 +0200 Subject: Restore r14955 which was reverted in r15047 due to messed up merge http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/14955 http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/15047 Fixed bugs: - https://launchpad.net/bugs/1669951 (bzr r15633) --- src/extension/param/bool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension/param/bool.cpp') diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp index 9f8d3dcc0..a2f4f82c2 100644 --- a/src/extension/param/bool.cpp +++ b/src/extension/param/bool.cpp @@ -136,7 +136,7 @@ Gtk::Widget *ParamBool::get_widget(SPDocument * doc, Inkscape::XML::Node * node, auto hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, Parameter::GUI_PARAM_WIDGETS_SPACING)); hbox->set_homogeneous(false); - Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_START)); + Gtk::Label * label = Gtk::manage(new Gtk::Label(_text, Gtk::ALIGN_START)); label->show(); hbox->pack_end(*label, true, true); -- cgit v1.2.3 From 34a1f9ad048c2aec2149e0bdaca5e66fca8de442 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 9 Apr 2017 15:20:24 +0200 Subject: Remove unused field "gui_tip" ("gui_description" does now what "gui_tip" was supposed to do) (bzr r15633.1.1) --- src/extension/param/bool.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/extension/param/bool.cpp') diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp index a2f4f82c2..612bf0331 100644 --- a/src/extension/param/bool.cpp +++ b/src/extension/param/bool.cpp @@ -29,11 +29,10 @@ ParamBool::ParamBool(const gchar * name, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, indent, ext) + : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) , _value(false) { const char * defaultval = NULL; -- cgit v1.2.3 From f0ad38f6fd0d18f48d92df4b55ff8352747e6b2c Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 9 Apr 2017 15:39:40 +0200 Subject: Remove unused field "scope" (bzr r15633.1.2) --- src/extension/param/bool.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/extension/param/bool.cpp') diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp index 612bf0331..05f896a2d 100644 --- a/src/extension/param/bool.cpp +++ b/src/extension/param/bool.cpp @@ -27,12 +27,11 @@ namespace Extension { ParamBool::ParamBool(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) + : Parameter(name, guitext, desc, gui_hidden, indent, ext) , _value(false) { const char * defaultval = NULL; -- cgit v1.2.3 From bc1ecf9dd11d0b3bb6939114ce6aec229fc86548 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 9 Apr 2017 16:46:33 +0200 Subject: Some code refactoring for consistency (notably "gui_hidden" -> hidden", "guitext" -> "text", "desc" -> "description") (bzr r15633.1.3) --- src/extension/param/bool.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/extension/param/bool.cpp') diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp index 05f896a2d..bfff6015c 100644 --- a/src/extension/param/bool.cpp +++ b/src/extension/param/bool.cpp @@ -25,13 +25,13 @@ namespace Inkscape { namespace Extension { ParamBool::ParamBool(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, gui_hidden, indent, ext) + : Parameter(name, text, description, hidden, indent, ext) , _value(false) { const char * defaultval = NULL; @@ -127,7 +127,7 @@ void ParamBool::string(std::string &string) const Gtk::Widget *ParamBool::get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { - if (_gui_hidden) { + if (_hidden) { return NULL; } -- cgit v1.2.3 From c091b4dad5c911f23eb657130ba260a2b664e944 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Mon, 24 Apr 2017 23:37:16 +0200 Subject: Restore r14978 which was reverted in r15047 due to messed up merge http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/14978 http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/15047 (bzr r15638) --- src/extension/param/bool.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/extension/param/bool.cpp') diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp index bfff6015c..2c7e32480 100644 --- a/src/extension/param/bool.cpp +++ b/src/extension/param/bool.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include "xml/node.h" #include "../extension.h" -- cgit v1.2.3