diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2016-04-08 13:47:33 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2016-04-08 13:47:33 +0000 |
| commit | 1106ff9eeb561af9216563e3eb7422088fac4cf5 (patch) | |
| tree | 8dc88ec1211b985e18c86835196d45e124d8cfe4 /src/ui | |
| parent | update to trunk (diff) | |
| parent | Bug #1552765 fixed Break Apart dont handle well stroke with in documents diff... (diff) | |
| download | inkscape-1106ff9eeb561af9216563e3eb7422088fac4cf5.tar.gz inkscape-1106ff9eeb561af9216563e3eb7422088fac4cf5.zip | |
update to trunk
(bzr r13645.1.125)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/clipboard.cpp | 2 | ||||
| -rw-r--r-- | src/ui/control-manager.cpp | 56 | ||||
| -rw-r--r-- | src/ui/control-manager.h | 2 | ||||
| -rw-r--r-- | src/ui/dialog/aboutbox.cpp | 12 | ||||
| -rw-r--r-- | src/ui/draw-anchor.cpp | 3 | ||||
| -rw-r--r-- | src/ui/interface.cpp | 2 | ||||
| -rw-r--r-- | src/ui/selected-color.cpp | 1 | ||||
| -rw-r--r-- | src/ui/tool/path-manipulator.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tools/pen-tool.cpp | 21 | ||||
| -rw-r--r-- | src/ui/widget/color-wheel-selector.cpp | 8 | ||||
| -rw-r--r-- | src/ui/widget/gimpcolorwheel.c | 4 | ||||
| -rw-r--r-- | src/ui/widget/preferences-widget.cpp | 4 | ||||
| -rw-r--r-- | src/ui/widget/unit-tracker.h | 2 |
13 files changed, 80 insertions, 39 deletions
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<SPUse *>(item); - if(use){ + if (use && use->get_original()) { if(cloned_elements.insert(use->get_original()).second) _copyUsedDefs(use->get_original()); } 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<void> _sizeChangedSignal; PrefListener _prefHook; - int _size; + int _size; // Size from the grabsize preference + int _resize; // Way size should change from grabsize std::vector<SPCanvasItem *> _itemList; std::map<Inkscape::ControlType, std::vector<int> > _sizeTable; std::map<Inkscape::ControlType, GType> _typeTable; std::map<Inkscape::ControlType, SPCtrlShapeType> _ctrlToShape; - std::set<Inkscape::ControlType> _sizeChangers; + std::set<Inkscape::ControlType> _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::slot<voi void ControlManagerImpl::updateItem(SPCanvasItem *item) { if (item) { - double target = _sizeTable[item->ctrlType][_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/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 = + "<a href=\"https://www.inkscape.org\"> https://www.inkscape.org</a>"; + + 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; diff --git a/src/ui/draw-anchor.cpp b/src/ui/draw-anchor.cpp index 6b9a88ed7..c3bc5676d 100644 --- a/src/ui/draw-anchor.cpp +++ b/src/ui/draw-anchor.cpp @@ -78,6 +78,7 @@ 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) { + ControlManager::getManager().setControlResize(anchor->ctrl, 4); g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_MOUSEOVER, NULL); anchor->active = TRUE; } @@ -85,9 +86,11 @@ SPDrawAnchor *sp_draw_anchor_test(SPDrawAnchor *anchor, Geom::Point w, bool acti } if (anchor->active) { + ControlManager::getManager().setControlResize(anchor->ctrl, 0); g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_NORMAL, NULL); anchor->active = FALSE; } + return NULL; } 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); 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/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 4d28594c1..928355bc8 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -1485,7 +1485,6 @@ void PathManipulator::_getGeometry() void PathManipulator::_setGeometry() { using namespace Inkscape::LivePathEffect; - if (empty()) return; if (!_lpe_key.empty()) { // copied from nodepath.cpp @@ -1498,6 +1497,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); diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp index 2ed366a7d..18af8e105 100644 --- a/src/ui/tools/pen-tool.cpp +++ b/src/ui/tools/pen-tool.cpp @@ -1220,7 +1220,18 @@ 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 p(0, 0); + if(this->red_curve->is_empty()) { + this->red_curve->moveto(p); + } + this->_finishSegment(p, 0); + this->_finish(true); + } else { + this->_finish(false); + } ret = true; } break; @@ -1783,12 +1794,12 @@ void PenTool::_setSubsequentPoint(Geom::Point const p, bool statusbar, guint sta if (statusbar) { gchar *message = is_curve ? - _("<b>Curve segment</b>: angle %3.2f°, distance %s; with <b>Ctrl</b> to snap angle, <b>Enter</b> to finish the path" ): - _("<b>Line segment</b>: angle %3.2f°, distance %s; with <b>Ctrl</b> to snap angle, <b>Enter</b> to finish the path"); + _("<b>Curve segment</b>: angle %3.2f°, distance %s; with <b>Ctrl</b> to snap angle, <b>Enter</b> or <b>Shift+Enter</b> to finish the path" ): + _("<b>Line segment</b>: angle %3.2f°, distance %s; with <b>Ctrl</b> to snap angle, <b>Enter</b> or <b>Shift+Enter</b> to finish the path"); if(this->spiro || this->bspline){ message = is_curve ? - _("<b>Curve segment</b>: angle %3.2f°, distance %s; with <b>Shift+Click</b> make a cusp node, <b>Enter</b> to finish the path" ): - _("<b>Line segment</b>: angle %3.2f°, distance %s; with <b>Shift+Click</b> make a cusp node, <b>Enter</b> to finish the path"); + _("<b>Curve segment</b>: angle %3.2f°, distance %s; with <b>Shift+Click</b> make a cusp node, <b>Enter</b> or <b>Shift+Enter</b> to finish the path" ): + _("<b>Line segment</b>: angle %3.2f°, distance %s; with <b>Shift+Click</b> make a cusp node, <b>Enter</b> or <b>Shift+Enter</b> to finish the path"); } this->_setAngleDistanceStatusMessage(p, 0, message); } diff --git a/src/ui/widget/color-wheel-selector.cpp b/src/ui/widget/color-wheel-selector.cpp index ed3400bb5..22c616325 100644 --- a/src/ui/widget/color-wheel-selector.cpp +++ b/src/ui/widget/color-wheel-selector.cpp @@ -245,22 +245,24 @@ 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->_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; } 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; 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<Cairo::Context>& 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") { diff --git a/src/ui/widget/unit-tracker.h b/src/ui/widget/unit-tracker.h index 0fe5bda80..8fa9ff304 100644 --- a/src/ui/widget/unit-tracker.h +++ b/src/ui/widget/unit-tracker.h @@ -42,8 +42,8 @@ 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 prependUnit(Inkscape::Util::Unit const *u); void setFullVal(GtkAdjustment *adj, gdouble val); GtkAction *createAction(gchar const *name, gchar const *label, gchar const *tooltip); |
