From a714c688d60a3a62114591984f57f26cd41dbed9 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Fri, 18 Mar 2016 11:23:29 +0100 Subject: Reverting 14701. (bzr r14716.1.2) --- src/ui/widget/unit-tracker.cpp | 10 ---------- src/ui/widget/unit-tracker.h | 1 - 2 files changed, 11 deletions(-) (limited to 'src/ui') diff --git a/src/ui/widget/unit-tracker.cpp b/src/ui/widget/unit-tracker.cpp index a1501c229..c6318db25 100644 --- a/src/ui/widget/unit-tracker.cpp +++ b/src/ui/widget/unit-tracker.cpp @@ -12,7 +12,6 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "style-internal.h" #include "unit-tracker.h" #include "widgets/ege-select-one-action.h" @@ -122,15 +121,6 @@ void UnitTracker::addUnit(Inkscape::Util::Unit const *u) gtk_list_store_set(_store, &iter, COLUMN_STRING, u ? u->abbr.c_str() : "NULL", -1); } -void UnitTracker::prependUnit(Inkscape::Util::Unit const *u) -{ - GtkTreeIter iter; - gtk_list_store_prepend(_store, &iter); - gtk_list_store_set(_store, &iter, COLUMN_STRING, u ? u->abbr.c_str() : "NULL", -1); - /* Re-shuffle our default selection here (_active gets out of sync) */ - setActiveUnit(_activeUnit); -} - void UnitTracker::setFullVal(GtkAdjustment *adj, gdouble val) { _priorValues[adj] = val; diff --git a/src/ui/widget/unit-tracker.h b/src/ui/widget/unit-tracker.h index 0fe5bda80..06245930e 100644 --- a/src/ui/widget/unit-tracker.h +++ b/src/ui/widget/unit-tracker.h @@ -42,7 +42,6 @@ public: Inkscape::Util::Unit const * getActiveUnit() const; void addUnit(Inkscape::Util::Unit const *u); - void prependUnit(Inkscape::Util::Unit const *u); void addAdjustment(GtkAdjustment *adj); void setFullVal(GtkAdjustment *adj, gdouble val); -- cgit v1.2.3 From ae7a4f0320d820a6183dde933fba576bc2c9f58f Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Fri, 18 Mar 2016 18:34:07 +0100 Subject: Bug #1419517 Fix Crash when applying new path effect after deleting pattern of Pattern-along-path LPE Fixed bugs: - https://launchpad.net/bugs/1419517 (bzr r14717) --- src/ui/tool/path-manipulator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui') diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index f4790c317..3b25439f3 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -1492,7 +1492,6 @@ void PathManipulator::_getGeometry() void PathManipulator::_setGeometry() { using namespace Inkscape::LivePathEffect; - if (empty()) return; if (!_lpe_key.empty()) { // copied from nodepath.cpp @@ -1505,6 +1504,7 @@ void PathManipulator::_setGeometry() LIVEPATHEFFECT(_path)->requestModified(SP_OBJECT_MODIFIED_FLAG); } } else { + if (empty()) return; //XML Tree being used here directly while it shouldn't be. if (_path->getRepr()->attribute("inkscape:original-d")) _path->set_original_curve(_spcurve, false, false); -- cgit v1.2.3 From 2ab92c531add6a786d4a9cacf41ce33381c2ffe2 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sat, 19 Mar 2016 22:42:23 -0400 Subject: Add Shift+Enter path complete and larger square node on mouse over. (bzr r14721) --- src/ui/draw-anchor.cpp | 9 +++++++-- src/ui/tools/pen-tool.cpp | 14 +++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'src/ui') diff --git a/src/ui/draw-anchor.cpp b/src/ui/draw-anchor.cpp index 6b9a88ed7..e5a7a493e 100644 --- a/src/ui/draw-anchor.cpp +++ b/src/ui/draw-anchor.cpp @@ -26,6 +26,9 @@ using Inkscape::ControlManager; #define FILL_COLOR_NORMAL 0xffffff7f #define FILL_COLOR_MOUSEOVER 0xff0000ff +#define NODE_SIZE_NORMAL 7.0 +#define NODE_SIZE_MOUSEOVER 10.0 + /** * Creates an anchor object and initializes it. */ @@ -78,14 +81,16 @@ SPDrawAnchor *sp_draw_anchor_test(SPDrawAnchor *anchor, Geom::Point w, bool acti if ( activate && ( Geom::LInfty( w - anchor->dc->getDesktop().d2w(anchor->dp) ) <= (ctrl->box.width() / 2.0) ) ) { if (!anchor->active) { - g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_MOUSEOVER, NULL); + g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_MOUSEOVER, + "size", NODE_SIZE_MOUSEOVER, NULL); anchor->active = TRUE; } return anchor; } if (anchor->active) { - g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_NORMAL, NULL); + g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_NORMAL, + "size", NODE_SIZE_NORMAL, NULL); anchor->active = FALSE; } return NULL; diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp index 2ed366a7d..ff49417f4 100644 --- a/src/ui/tools/pen-tool.cpp +++ b/src/ui/tools/pen-tool.cpp @@ -1220,7 +1220,19 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { case GDK_KEY_KP_Enter: if (this->npoints != 0) { this->ea = NULL; // unset end anchor if set (otherwise crashes) - this->_finish(false); + if(MOD__SHIFT_ONLY(event)) { + // All this is needed to stop the last control + // point dispeating and stop making an n-1 shape. + Geom::Point const event_w(0, 0); + Geom::Point event_dt(desktop->w2d(event_w)); + if(this->red_curve->is_empty()) { + this->red_curve->moveto(event_w); + } + this->_finishSegment(event_w, 0); + this->_finish(true); + } else { + this->_finish(false); + } ret = true; } break; -- cgit v1.2.3 From bb5e99e378d45f0d8cb3db9842a248acc4dadd43 Mon Sep 17 00:00:00 2001 From: suv-lp <> Date: Sun, 20 Mar 2016 09:32:53 +0100 Subject: [Bug #1545332] Canvas context menu: allow grouping a single selection (same as menu, toolbar command). Fixed bugs: - https://launchpad.net/bugs/1545332 (bzr r14723) --- src/ui/interface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui') diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp index 69b229519..531aa728d 100644 --- a/src/ui/interface.cpp +++ b/src/ui/interface.cpp @@ -1786,7 +1786,7 @@ void ContextMenu::MakeItemMenu (void) /* Group */ mi = Gtk::manage(new Gtk::MenuItem(_("_Group"), 1)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ActivateGroup)); - if (_desktop->selection->isEmpty() || _desktop->selection->single()) { + if (_desktop->selection->isEmpty()) { mi->set_sensitive(FALSE); } else { mi->set_sensitive(TRUE); -- cgit v1.2.3 From fd794a9d8bf0e82e62dfdb75a9f337b361f26b3e Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sun, 20 Mar 2016 09:21:29 -0400 Subject: Update status bar text and remove spare Geom Point variable. (bzr r14725) --- src/ui/tools/pen-tool.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/ui') diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp index ff49417f4..18af8e105 100644 --- a/src/ui/tools/pen-tool.cpp +++ b/src/ui/tools/pen-tool.cpp @@ -1223,12 +1223,11 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { if(MOD__SHIFT_ONLY(event)) { // All this is needed to stop the last control // point dispeating and stop making an n-1 shape. - Geom::Point const event_w(0, 0); - Geom::Point event_dt(desktop->w2d(event_w)); + Geom::Point const p(0, 0); if(this->red_curve->is_empty()) { - this->red_curve->moveto(event_w); + this->red_curve->moveto(p); } - this->_finishSegment(event_w, 0); + this->_finishSegment(p, 0); this->_finish(true); } else { this->_finish(false); @@ -1795,12 +1794,12 @@ void PenTool::_setSubsequentPoint(Geom::Point const p, bool statusbar, guint sta if (statusbar) { gchar *message = is_curve ? - _("Curve segment: angle %3.2f°, distance %s; with Ctrl to snap angle, Enter to finish the path" ): - _("Line segment: angle %3.2f°, distance %s; with Ctrl to snap angle, Enter to finish the path"); + _("Curve segment: angle %3.2f°, distance %s; with Ctrl to snap angle, Enter or Shift+Enter to finish the path" ): + _("Line segment: angle %3.2f°, distance %s; with Ctrl to snap angle, Enter or Shift+Enter to finish the path"); if(this->spiro || this->bspline){ message = is_curve ? - _("Curve segment: angle %3.2f°, distance %s; with Shift+Click make a cusp node, Enter to finish the path" ): - _("Line segment: angle %3.2f°, distance %s; with Shift+Click make a cusp node, Enter to finish the path"); + _("Curve segment: angle %3.2f°, distance %s; with Shift+Click make a cusp node, Enter or Shift+Enter to finish the path" ): + _("Line segment: angle %3.2f°, distance %s; with Shift+Click make a cusp node, Enter or Shift+Enter to finish the path"); } this->_setAngleDistanceStatusMessage(p, 0, message); } -- cgit v1.2.3 From 4cce40a79ab973a3609cd5ee7666673bc2337fef Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 22 Mar 2016 14:56:36 +0100 Subject: Add line-height unit selector to text toolbar. Remove 'm' and 'ft' non-CSS lengths. (bzr r14716.1.3) --- src/ui/widget/preferences-widget.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/ui') diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index e906762e3..d56506d62 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -468,12 +468,8 @@ ZoomCorrRuler::on_draw(const Cairo::RefPtr& cr) { Glib::ustring abbr = prefs->getString("/options/zoomcorrection/unit"); if (abbr == "cm") { draw_marks(cr, 0.1, 10); - } else if (abbr == "ft") { - draw_marks(cr, 1/12.0, 12); } else if (abbr == "in") { draw_marks(cr, 0.25, 4); - } else if (abbr == "m") { - draw_marks(cr, 1/10.0, 10); } else if (abbr == "mm") { draw_marks(cr, 10, 10); } else if (abbr == "pc") { -- cgit v1.2.3 From 41751706dc695123b53136bd4fe3d069f5321337 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Tue, 22 Mar 2016 15:10:16 -0400 Subject: Add prependUnit function (bzr r14737) --- src/ui/widget/unit-tracker.cpp | 10 ++++++++++ src/ui/widget/unit-tracker.h | 1 + 2 files changed, 11 insertions(+) (limited to 'src/ui') diff --git a/src/ui/widget/unit-tracker.cpp b/src/ui/widget/unit-tracker.cpp index c6318db25..a1501c229 100644 --- a/src/ui/widget/unit-tracker.cpp +++ b/src/ui/widget/unit-tracker.cpp @@ -12,6 +12,7 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include "style-internal.h" #include "unit-tracker.h" #include "widgets/ege-select-one-action.h" @@ -121,6 +122,15 @@ void UnitTracker::addUnit(Inkscape::Util::Unit const *u) gtk_list_store_set(_store, &iter, COLUMN_STRING, u ? u->abbr.c_str() : "NULL", -1); } +void UnitTracker::prependUnit(Inkscape::Util::Unit const *u) +{ + GtkTreeIter iter; + gtk_list_store_prepend(_store, &iter); + gtk_list_store_set(_store, &iter, COLUMN_STRING, u ? u->abbr.c_str() : "NULL", -1); + /* Re-shuffle our default selection here (_active gets out of sync) */ + setActiveUnit(_activeUnit); +} + void UnitTracker::setFullVal(GtkAdjustment *adj, gdouble val) { _priorValues[adj] = val; diff --git a/src/ui/widget/unit-tracker.h b/src/ui/widget/unit-tracker.h index 06245930e..8fa9ff304 100644 --- a/src/ui/widget/unit-tracker.h +++ b/src/ui/widget/unit-tracker.h @@ -43,6 +43,7 @@ public: void addUnit(Inkscape::Util::Unit const *u); void addAdjustment(GtkAdjustment *adj); + void prependUnit(Inkscape::Util::Unit const *u); void setFullVal(GtkAdjustment *adj, gdouble val); GtkAction *createAction(gchar const *name, gchar const *label, gchar const *tooltip); -- cgit v1.2.3 From 401c2f70ce1ffcdf7a041c27df8c06e19f42e847 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Mon, 28 Mar 2016 20:49:42 -0400 Subject: Fix bugs with the colour selector self-signaling on change. Fixed bugs: - https://launchpad.net/bugs/1462907 - https://launchpad.net/bugs/1249618 (bzr r14747) --- src/ui/selected-color.cpp | 1 - src/ui/widget/color-wheel-selector.cpp | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/ui') diff --git a/src/ui/selected-color.cpp b/src/ui/selected-color.cpp index 8c37ee7e0..846d50a5b 100644 --- a/src/ui/selected-color.cpp +++ b/src/ui/selected-color.cpp @@ -139,7 +139,6 @@ void SelectedColor::setHeld(bool held) { if (released) { signal_released.emit(); - signal_changed.emit(); } _updating = false; } diff --git a/src/ui/widget/color-wheel-selector.cpp b/src/ui/widget/color-wheel-selector.cpp index ed3400bb5..cac812640 100644 --- a/src/ui/widget/color-wheel-selector.cpp +++ b/src/ui/widget/color-wheel-selector.cpp @@ -246,21 +246,23 @@ void ColorWheelSelector::_wheelChanged(GimpColorWheel *wheel, ColorWheelSelector guint32 end = color.toRGBA32(0xff); wheelSelector->_slider->setColors(start, mid, end); - wheelSelector->_color.preserveICC(); + wheelSelector->_updating = true; wheelSelector->_color.setHeld(gimp_color_wheel_is_adjusting(wheel)); wheelSelector->_color.setColor(color); + wheelSelector->_updating = false; } void ColorWheelSelector::_updateDisplay() { + if(_updating) { return; } + #ifdef DUMP_CHANGE_INFO g_message("ColorWheelSelector::_colorChanged( this=%p, %f, %f, %f, %f)", this, _color.color().v.c[0], _color.color().v.c[1], _color.color().v.c[2], alpha); #endif - bool oldval = _updating; _updating = true; { float hsv[3] = { 0, 0, 0 }; @@ -276,7 +278,7 @@ void ColorWheelSelector::_updateDisplay() ColorScales::setScaled(_alpha_adjustment->gobj(), _color.alpha()); - _updating = oldval; + _updating = false; } -- cgit v1.2.3 From b2587a888338617bc8482bfc969072b979911719 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Tue, 29 Mar 2016 15:54:04 -0400 Subject: Protect the color wheel from hue loss at a deeper level. (bzr r14748) --- src/ui/widget/color-wheel-selector.cpp | 2 +- src/ui/widget/gimpcolorwheel.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/ui') diff --git a/src/ui/widget/color-wheel-selector.cpp b/src/ui/widget/color-wheel-selector.cpp index cac812640..22c616325 100644 --- a/src/ui/widget/color-wheel-selector.cpp +++ b/src/ui/widget/color-wheel-selector.cpp @@ -245,10 +245,10 @@ void ColorWheelSelector::_wheelChanged(GimpColorWheel *wheel, ColorWheelSelector guint32 mid = color.toRGBA32(0x7f); guint32 end = color.toRGBA32(0xff); + wheelSelector->_updating = true; wheelSelector->_slider->setColors(start, mid, end); wheelSelector->_color.preserveICC(); - wheelSelector->_updating = true; wheelSelector->_color.setHeld(gimp_color_wheel_is_adjusting(wheel)); wheelSelector->_color.setColor(color); wheelSelector->_updating = false; diff --git a/src/ui/widget/gimpcolorwheel.c b/src/ui/widget/gimpcolorwheel.c index f632331d8..c857cfa8a 100644 --- a/src/ui/widget/gimpcolorwheel.c +++ b/src/ui/widget/gimpcolorwheel.c @@ -1412,6 +1412,10 @@ gimp_color_wheel_set_color (GimpColorWheel *wheel, priv = wheel->priv; + if(h == 0.0 && s == 0.0) { + h = priv->h; + } + priv->h = h; priv->s = s; priv->v = v; -- cgit v1.2.3 From 8199cf68c6dbb74a7f1b4eedb970427171bb4d9f Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 2 Apr 2016 17:15:43 +0200 Subject: Fix crash on copying orphaned clones Fixed bugs: - https://launchpad.net/bugs/1565272 (bzr r14759) --- src/ui/clipboard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui') diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index f04d8a591..f0dc33740 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -759,7 +759,7 @@ void ClipboardManagerImpl::_copySelection(Inkscape::Selection *selection) void ClipboardManagerImpl::_copyUsedDefs(SPItem *item) { SPUse *use=dynamic_cast(item); - if(use){ + if (use && use->get_original()) { if(cloned_elements.insert(use->get_original()).second) _copyUsedDefs(use->get_original()); } -- cgit v1.2.3 From ab843636c11bb0d0550a8987fbdfcb089a55832e Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sat, 2 Apr 2016 14:21:12 -0400 Subject: Fix node size regression and add ctrlResize property for multiple use. Fixed bugs: - https://launchpad.net/bugs/1562197 (bzr r14761) --- src/ui/control-manager.cpp | 56 ++++++++++++++++++++++++++++------------------ src/ui/control-manager.h | 2 ++ src/ui/draw-anchor.cpp | 12 +++++----- 3 files changed, 41 insertions(+), 29 deletions(-) (limited to 'src/ui') diff --git a/src/ui/control-manager.cpp b/src/ui/control-manager.cpp index cedaea405..a2c977533 100644 --- a/src/ui/control-manager.cpp +++ b/src/ui/control-manager.cpp @@ -54,9 +54,6 @@ ControlFlags& operator ^=(ControlFlags &lhs, ControlFlags rhs) } // namespace -#define FILL_COLOR_NORMAL 0xffffff7f -#define FILL_COLOR_MOUSEOVER 0xff0000ff - // Default color for line: #define LINE_COLOR_PRIMARY 0x0000ff7f #define LINE_COLOR_SECONDARY 0xff00007f @@ -83,6 +80,8 @@ public: bool setControlType(SPCanvasItem *item, ControlType type); + bool setControlResize(SPCanvasItem *item, int ctrlResize); + void setSelected(SPCanvasItem *item, bool selected); private: @@ -108,12 +107,13 @@ private: ControlManager &_manager; sigc::signal _sizeChangedSignal; PrefListener _prefHook; - int _size; + int _size; // Size from the grabsize preference + int _resize; // Way size should change from grabsize std::vector _itemList; std::map > _sizeTable; std::map _typeTable; std::map _ctrlToShape; - std::set _sizeChangers; + std::set _resizeOnSelect; }; ControlManagerImpl::ControlManagerImpl(ControlManager &manager) : @@ -121,6 +121,7 @@ ControlManagerImpl::ControlManagerImpl(ControlManager &manager) : _sizeChangedSignal(), _prefHook(*this), _size(3), + _resize(3), _itemList(), _sizeTable() { @@ -153,10 +154,10 @@ ControlManagerImpl::ControlManagerImpl(ControlManager &manager) : // ------- - _sizeChangers.insert(CTRL_TYPE_NODE_AUTO); - _sizeChangers.insert(CTRL_TYPE_NODE_CUSP); - _sizeChangers.insert(CTRL_TYPE_NODE_SMOOTH); - _sizeChangers.insert(CTRL_TYPE_NODE_SYMETRICAL); + _resizeOnSelect.insert(CTRL_TYPE_NODE_AUTO); + _resizeOnSelect.insert(CTRL_TYPE_NODE_CUSP); + _resizeOnSelect.insert(CTRL_TYPE_NODE_SMOOTH); + _resizeOnSelect.insert(CTRL_TYPE_NODE_SYMETRICAL); // ------- @@ -234,7 +235,7 @@ SPCanvasItem *ControlManagerImpl::createControl(SPCanvasGroup *parent, ControlTy item = sp_canvas_item_new(parent, SP_TYPE_CTRL, "size", targetSize, "filled", 1, - "fill_color", FILL_COLOR_NORMAL, + "fill_color", 0xffffff7f, "stroked", 1, "stroke_color", 0x000000ff, NULL); @@ -284,11 +285,8 @@ sigc::connection ControlManagerImpl::connectCtrlSizeChanged(const sigc::slotctrlType][_size - 1]; + double target = _sizeTable[item->ctrlType][_size - 1] + item->ctrlResize; - if (_sizeChangers.count(item->ctrlType) && _manager.isSelected(item)) { - target += 2; - } g_object_set(item, "size", target, NULL); sp_canvas_item_request_update(item); @@ -303,11 +301,9 @@ bool ControlManagerImpl::setControlType(SPCanvasItem *item, ControlType type) accepted = true; } else if (item) { if (_ctrlToShape.count(type) && (_typeTable[type] == _typeTable[item->ctrlType])) { // compatible? - double targetSize = _sizeTable[type][_size - 1]; - if (_manager.isSelected(item) && _sizeChangers.count(item->ctrlType)) { - targetSize += 2.0; - } + double targetSize = _sizeTable[type][_size - 1] + item->ctrlResize; SPCtrlShapeType targetShape = _ctrlToShape[type]; + g_object_set(item, "shape", targetShape, "size", targetSize, NULL); item->ctrlType = type; accepted = true; @@ -317,17 +313,28 @@ bool ControlManagerImpl::setControlType(SPCanvasItem *item, ControlType type) return accepted; } +bool ControlManagerImpl::setControlResize(SPCanvasItem *item, int ctrlResize) +{ + if(item) { + item->ctrlResize = ctrlResize; + double targetSize = _sizeTable[item->ctrlType][_size - 1] + item->ctrlResize; + g_object_set(item, "size", targetSize, NULL); + return true; + } + return false; +} void ControlManagerImpl::setSelected(SPCanvasItem *item, bool selected) { if (_manager.isSelected(item) != selected) { item->ctrlFlags ^= CTRL_FLAG_SELECTED; // toggle, since we know it is different - // TODO refresh colors - double targetSize = _sizeTable[item->ctrlType][_size - 1]; - if (selected && _sizeChangers.count(item->ctrlType)) { - targetSize += 2.0; + if (selected && _resizeOnSelect.count(item->ctrlType)) { + item->ctrlResize = 2; } + + // TODO refresh colors + double targetSize = _sizeTable[item->ctrlType][_size - 1] + _resize; g_object_set(item, "size", targetSize, NULL); } } @@ -431,6 +438,11 @@ bool ControlManager::setControlType(SPCanvasItem *item, ControlType type) return _impl->setControlType(item, type); } +bool ControlManager::setControlResize(SPCanvasItem *item, int ctrlResize) +{ + return _impl->setControlResize(item, ctrlResize); +} + bool ControlManager::isActive(SPCanvasItem *item) const { return (item->ctrlFlags & CTRL_FLAG_ACTIVE) != 0; diff --git a/src/ui/control-manager.h b/src/ui/control-manager.h index 964ad0a29..3f090d0bd 100644 --- a/src/ui/control-manager.h +++ b/src/ui/control-manager.h @@ -63,6 +63,8 @@ public: bool setControlType(SPCanvasItem *item, ControlType type); + bool setControlResize(SPCanvasItem *item, int ctrlResize); + bool isActive(SPCanvasItem *item) const; void setActive(SPCanvasItem *item, bool active); diff --git a/src/ui/draw-anchor.cpp b/src/ui/draw-anchor.cpp index e5a7a493e..c3bc5676d 100644 --- a/src/ui/draw-anchor.cpp +++ b/src/ui/draw-anchor.cpp @@ -26,9 +26,6 @@ using Inkscape::ControlManager; #define FILL_COLOR_NORMAL 0xffffff7f #define FILL_COLOR_MOUSEOVER 0xff0000ff -#define NODE_SIZE_NORMAL 7.0 -#define NODE_SIZE_MOUSEOVER 10.0 - /** * Creates an anchor object and initializes it. */ @@ -81,18 +78,19 @@ SPDrawAnchor *sp_draw_anchor_test(SPDrawAnchor *anchor, Geom::Point w, bool acti if ( activate && ( Geom::LInfty( w - anchor->dc->getDesktop().d2w(anchor->dp) ) <= (ctrl->box.width() / 2.0) ) ) { if (!anchor->active) { - g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_MOUSEOVER, - "size", NODE_SIZE_MOUSEOVER, NULL); + ControlManager::getManager().setControlResize(anchor->ctrl, 4); + g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_MOUSEOVER, NULL); anchor->active = TRUE; } return anchor; } if (anchor->active) { - g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_NORMAL, - "size", NODE_SIZE_NORMAL, NULL); + ControlManager::getManager().setControlResize(anchor->ctrl, 0); + g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_NORMAL, NULL); anchor->active = FALSE; } + return NULL; } -- cgit v1.2.3 From d3460d8a60c4d2c99c2c12fe0646db224335e232 Mon Sep 17 00:00:00 2001 From: Kamalpreet Grewal <> Date: Thu, 7 Apr 2016 12:54:08 +0200 Subject: Add clickable link to www.inkscape.org to splash screen dialog. (bzr r14764) --- src/ui/dialog/aboutbox.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/ui') diff --git a/src/ui/dialog/aboutbox.cpp b/src/ui/dialog/aboutbox.cpp index 81f48e6ef..b653a630d 100644 --- a/src/ui/dialog/aboutbox.cpp +++ b/src/ui/dialog/aboutbox.cpp @@ -120,10 +120,22 @@ AboutBox::AboutBox() : Gtk::Dialog(_("About Inkscape")) { label->set_selectable(true); label->show(); + Gtk::Label *link = new Gtk::Label(); + const gchar *website_link = + " https://www.inkscape.org"; + + link->set_markup(website_link); + link->set_alignment(Gtk::ALIGN_END); + link->set_padding(5,5); + link->set_selectable(true); + link->show(); + #if WITH_GTKMM_3_0 get_content_area()->pack_start(*manage(label), false, false); + get_content_area()->pack_start(*manage(link), false, false); #else get_vbox()->pack_start(*manage(label), false, false); + get_vbox()->pack_start(*manage(link), false, false); #endif Gtk::Requisition requisition; -- cgit v1.2.3