Merge lp:~chr0x07/inkscape/0.92.fixes.2 into lp:inkscape/0.92.x

Proposed by chr[]
Status: Merged
Merged at revision: 15430
Proposed branch: lp:~chr0x07/inkscape/0.92.fixes.2
Merge into: lp:inkscape/0.92.x
Diff against target: 732 lines (+225/-73)
17 files modified
share/icons/icons.svg (+24/-0)
src/live_effects/lpe-bspline.cpp (+1/-0)
src/live_effects/parameter/path.cpp (+2/-1)
src/path-chemistry.cpp (+2/-1)
src/selection-chemistry.cpp (+62/-2)
src/selection-chemistry.h (+2/-0)
src/sp-item-group.cpp (+1/-0)
src/sp-item.cpp (+6/-2)
src/sp-item.h (+2/-2)
src/sp-pattern.cpp (+4/-2)
src/ui/dialog/objects.cpp (+75/-44)
src/ui/dialog/objects.h (+4/-1)
src/ui/widget/clipmaskicon.cpp (+12/-12)
src/ui/widget/clipmaskicon.h (+2/-2)
src/verbs.cpp (+14/-0)
src/verbs.h (+2/-0)
src/widgets/stroke-marker-selector.cpp (+10/-4)
To merge this branch: bzr merge lp:~chr0x07/inkscape/0.92.fixes.2
Reviewer Review Type Date Requested Status
Mc Approve
Review via email: mp+324218@code.launchpad.net

Description of the change

Support Raise and Lower (z-order) for non-overlapping objects

To generate CNC data with inkscape we want to order objects by z-order

bugfixes object manager panel:

- It uses raise/lower which is clearly a bug

- polish behavior regarding collapsing/expanding the tree: in drawings with many objects in groups it is annoying if it opens group just by selecting them. Expand group as they are entered via double click

- disable search function which eats many keystrokes: use ctrl+f to use it

- fix some memory leaks

- fix: speed up inkscape startup time
 (due to missing icons / non cached icons)
 (~2 seconds left: stroke-panel/arrow marker ....)

Note: this no more modifies default key strokes, you can assign the keystrokes you like to the new functions.

To post a comment you must log in.
Revision history for this message
chr[] (chr0x07) wrote :

I have no idea why CMakeScripts/InstallMSYS2.cmake made it into the diff

Revision history for this message
Patrick Storz (ede123) wrote :

Could you maybe just "bzr revert CMakeScripts/InstallMSYS2.cmake"?

I guess this has to do with Bazaar storing something like an inode number for each file, so even if a file has the same content it will show as a conflict (stupid, but that's just the way bzr is ;-) )

I recently had to explicitly delete and recreate that file as it was impossible to merge changes from trunk otherwise (bzr insisted it were different files, even when the content was identical, because they were created "individually" after branching 0.92.x)

Revision history for this message
chr[] (chr0x07) wrote :

so, the diff looks all right now

Revision history for this message
Mc (mc...) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'share/icons/icons.svg'
--- share/icons/icons.svg 2016-12-15 13:03:33 +0000
+++ share/icons/icons.svg 2017-05-17 23:30:53 +0000
@@ -4323,4 +4323,28 @@
4323</g>4323</g>
4324</g>4324</g>
4325</g>4325</g>
4326<g id="object-clipped" transform="translate(238.8904,209.8666)">
4327<rect transform="rotate(90)" style="opacity:1;vector-effect:none;fill:#9ab8d5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:1.5;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" id="rect5272" width="16.00001" height="15.99999" x="159.1449" y="-92.158638" />
4328<path d="m -98.444747,-168.45699 a 12.6149,12.6149 0 0 1 13.078074,12.08243 l -12.60403,0.52356 z" sodipodi:end="6.24167" sodipodi:start="4.674802" sodipodi:ry="12.6149" sodipodi:rx="12.6149" sodipodi:cy="-155.851" sodipodi:cx="-97.970703" sodipodi:type="arc" id="path5274" style="display:inline;opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:0.99335549;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:1.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" transform="rotate(-177.7077)" />
4329<rect y="-91.658653" x="159.6449" height="15" width="15" id="rect5276" style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#c80000;stroke-width:1.00000012;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:1.5;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" transform="rotate(90)" />
4330</g>
4331<g transform="matrix(1.034469,0,0,1.034469,199.9323,-218.0428)" id="object-masked" style="stroke-width:0.96667951">
4332<g style="stroke-width:0.96667659" transform="matrix(1.000013,0,0,0.9999918,121.4104,415.3122)" id="g5284">
4333<path style="opacity:1;vector-effect:none;fill:#9ab8d5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.45001554;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:1.5;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" d="m 13.55417,167.1658 v -14.5 h 14.5 z" id="path5280" inkscape:connector-curvature="0" sodipodi:nodetypes="cccc" />
4334<path style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.45001554;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:1.5;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" d="m 28.05417,152.6658 v 14.5 h -14.5 z" id="path5282" inkscape:connector-curvature="0" sodipodi:nodetypes="cccc" />
4335</g>
4336<g style="stroke-width:2.00240207" id="g5290" transform="matrix(-0.4827649,0,0,-0.4827546,152.2584,652.4268)">
4337<path sodipodi:nodetypes="cccc" inkscape:connector-curvature="0" id="path5286" d="m 13.55417,167.1658 v -14.5 h 14.5 z" style="opacity:1;vector-effect:none;fill:#9ab8d5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.00360346;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:1.5;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" />
4338<path sodipodi:nodetypes="cccc" inkscape:connector-curvature="0" id="path5288" d="m 28.05417,152.6658 v 14.5 h -14.5 z" style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.00360346;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:1.5;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" />
4339</g>
4340<rect y="-149.465" x="567.97681" height="14.50019" width="14.49988" id="rect5292" style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.96667951;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:1.5;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" transform="rotate(90)" />
4341</g>
4342<g style="opacity:1;stroke-width:0.96774209" transform="matrix(1.033333,0,0,1.033333,166.9413,-217.5105)" id="object-clip-mask">
4343<path style="opacity:1;vector-effect:none;fill:#9ab8d5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.45161366;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:1.5;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" d="m 190.0319,582.7473 v -15 h 15 z" id="path5296" inkscape:connector-curvature="0" sodipodi:nodetypes="cccc" />
4344<path style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:0.98349819;fill-rule:nonzero;stroke:none;stroke-width:1.45161366;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:1.5;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" d="m 205.0318,567.7474 v 15 h -15 z" id="path5298" inkscape:connector-curvature="0" sodipodi:nodetypes="cccc" />
4345<path transform="rotate(-177.7077)" style="display:inline;opacity:1;vector-effect:none;fill:none;fill-opacity:0.99335549;fill-rule:nonzero;stroke:#000000;stroke-width:0.96774209;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:1.20000005;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" id="path5300" sodipodi:type="arc" sodipodi:cx="-227.3363" sodipodi:cy="-559.35199" sodipodi:rx="12.6149" sodipodi:ry="12.6149" sodipodi:start="4.674802" sodipodi:end="6.24167" d="m -227.81035,-571.95798 a 12.6149,12.6149 0 0 1 13.07808,12.08243 l -12.60403,0.52356 z" />
4346<path sodipodi:nodetypes="cccc" inkscape:connector-curvature="0" id="path5302" d="m 194.0319,578.7472 v -6.9999 h 7 z" style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.45161378;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:1.5;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" />
4347<rect transform="rotate(90)" style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#c80000;stroke-width:0.96774209;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:1.5;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" id="rect5304" width="14.5" height="14.5" x="567.99731" y="-204.78191" />
4348<path sodipodi:nodetypes="cccc" inkscape:connector-curvature="0" id="path5306" d="m 201.0319,571.7473 v 6.9999 h -7 z" style="opacity:1;vector-effect:none;fill:#9ab8d5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.45161378;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:1.5;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" />
4349</g>
4326</svg>4350</svg>
43274351
=== modified file 'src/live_effects/lpe-bspline.cpp'
--- src/live_effects/lpe-bspline.cpp 2016-01-05 15:30:09 +0000
+++ src/live_effects/lpe-bspline.cpp 2017-05-17 23:30:53 +0000
@@ -168,6 +168,7 @@
168 doBSplineFromWidget(curve, weight_ammount/100.0);168 doBSplineFromWidget(curve, weight_ammount/100.0);
169 gchar *str = sp_svg_write_path(curve->get_pathvector());169 gchar *str = sp_svg_write_path(curve->get_pathvector());
170 path->getRepr()->setAttribute("inkscape:original-d", str);170 path->getRepr()->setAttribute("inkscape:original-d", str);
171 g_free(str);
171 }172 }
172}173}
173174
174175
=== modified file 'src/live_effects/parameter/path.cpp'
--- src/live_effects/parameter/path.cpp 2016-07-02 00:27:56 +0000
+++ src/live_effects/parameter/path.cpp 2017-05-17 23:30:53 +0000
@@ -242,8 +242,9 @@
242 r.lpe_key = param_key;242 r.lpe_key = param_key;
243 Geom::PathVector stored_pv = _pathvector;243 Geom::PathVector stored_pv = _pathvector;
244 param_write_to_repr("M0,0 L1,0");244 param_write_to_repr("M0,0 L1,0");
245 const char *svgd = sp_svg_write_path(stored_pv);245 gchar *svgd = sp_svg_write_path(stored_pv);
246 param_write_to_repr(svgd);246 param_write_to_repr(svgd);
247 g_free(svgd);
247 } else {248 } else {
248 r.item = ref.getObject();249 r.item = ref.getObject();
249 }250 }
250251
=== modified file 'src/path-chemistry.cpp'
--- src/path-chemistry.cpp 2016-04-08 13:26:55 +0000
+++ src/path-chemistry.cpp 2017-05-17 23:30:53 +0000
@@ -250,8 +250,9 @@
250 repr->setAttribute("inkscape:original-d", str);250 repr->setAttribute("inkscape:original-d", str);
251 else251 else
252 repr->setAttribute("d", str);252 repr->setAttribute("d", str);
253 str = sp_svg_transform_write(transform);
254 repr->setAttribute("transform", str);
253 g_free(str);255 g_free(str);
254 repr->setAttribute("transform", sp_svg_transform_write(transform));
255 256
256 // add the new repr to the parent257 // add the new repr to the parent
257 parent->appendChild(repr);258 parent->appendChild(repr);
258259
=== modified file 'src/selection-chemistry.cpp'
--- src/selection-chemistry.cpp 2017-02-22 13:10:40 +0000
+++ src/selection-chemistry.cpp 2017-05-17 23:30:53 +0000
@@ -1115,6 +1115,63 @@
1115 C_("Undo action", "Lower"));1115 C_("Undo action", "Lower"));
1116}1116}
11171117
1118void sp_selection_stack_down(Inkscape::Selection *selection, SPDesktop *desktop)
1119{
1120 SPDocument *document = selection->layers()->getDocument();
1121 std::vector<SPItem*> selected = selection->itemList();
1122
1123 if (selected.empty()) {
1124 selection_display_message(desktop, Inkscape::WARNING_MESSAGE, _("Select <b>object(s)</b> to stack down."));
1125 return;
1126 }
1127
1128 /* Construct direct-ordered list of selected children. */
1129 std::vector<SPItem*> items(selected);
1130 sort(items.begin(),items.end(),sp_item_repr_compare_position_bool);
1131
1132 for (std::vector<SPItem*>::const_iterator item=items.begin();item!=items.end();++item) {
1133 SPItem *item_obj = *item;
1134 if(!item_obj->lowerOne()) {
1135 DocumentUndo::cancel(document);
1136 selection_display_message(desktop, Inkscape::WARNING_MESSAGE, _("We hit bottom."));
1137 return;
1138 }
1139 }
1140
1141 DocumentUndo::done(document, SP_VERB_SELECTION_STACK_DOWN,
1142 //TRANSLATORS: "Lower" means "to lower an object" in the undo history
1143 C_("Undo action", "stack down"));
1144}
1145
1146void sp_selection_stack_up(Inkscape::Selection *selection, SPDesktop *desktop)
1147{
1148 SPDocument *document = selection->layers()->getDocument();
1149 std::vector<SPItem*> selected = selection->itemList();
1150
1151 if (selected.empty()) {
1152 selection_display_message(desktop, Inkscape::WARNING_MESSAGE, _("Select <b>object(s)</b> to stack up."));
1153 return;
1154 }
1155
1156 /* Construct direct-ordered list of selected children. */
1157 std::vector<SPItem*> items(selected);
1158 sort(items.begin(),items.end(),sp_item_repr_compare_position_bool);
1159 bool cancel = false;
1160
1161 for (std::vector<SPItem*>::const_reverse_iterator item=items.rbegin();item!=items.rend();++item) {
1162 SPItem *item_obj = *item;
1163 if (!item_obj->raiseOne()) {
1164 DocumentUndo::cancel(document);
1165 selection_display_message(desktop, Inkscape::WARNING_MESSAGE, _("We hit top."));
1166 return;
1167 }
1168 }
1169
1170 DocumentUndo::done(document, SP_VERB_SELECTION_STACK_UP,
1171 //TRANSLATORS: "Lower" means "to lower an object" in the undo history
1172 C_("Undo action", "stack up"));
1173}
1174
1118void sp_selection_lower_to_bottom(Inkscape::Selection *selection, SPDesktop *desktop)1175void sp_selection_lower_to_bottom(Inkscape::Selection *selection, SPDesktop *desktop)
1119{1176{
1120 SPDocument *document = selection->layers()->getDocument();1177 SPDocument *document = selection->layers()->getDocument();
@@ -3175,8 +3232,11 @@
3175 the_parent_repr->appendChild(clone);3232 the_parent_repr->appendChild(clone);
31763233
3177 if( single_group && transform.isTranslation() ) {3234 if( single_group && transform.isTranslation() ) {
3178 if( !transform.isIdentity() )3235 if( !transform.isIdentity() ) {
3179 clone->setAttribute("transform", sp_svg_transform_write( transform ));3236 gchar *c = sp_svg_transform_write( transform );
3237 clone->setAttribute("transform", c);
3238 g_free(c);
3239 }
3180 }3240 }
31813241
3182 // Change selection to new <use> element.3242 // Change selection to new <use> element.
31833243
=== modified file 'src/selection-chemistry.h'
--- src/selection-chemistry.h 2016-04-14 18:19:03 +0000
+++ src/selection-chemistry.h 2017-05-17 23:30:53 +0000
@@ -79,8 +79,10 @@
79void sp_selection_ungroup_pop_selection(Inkscape::Selection *selection, SPDesktop *desktop);79void sp_selection_ungroup_pop_selection(Inkscape::Selection *selection, SPDesktop *desktop);
8080
81void sp_selection_raise(Inkscape::Selection *selection, SPDesktop *desktop);81void sp_selection_raise(Inkscape::Selection *selection, SPDesktop *desktop);
82void sp_selection_stack_up(Inkscape::Selection *selection, SPDesktop *desktop);
82void sp_selection_raise_to_top(Inkscape::Selection *selection, SPDesktop *desktop);83void sp_selection_raise_to_top(Inkscape::Selection *selection, SPDesktop *desktop);
83void sp_selection_lower(Inkscape::Selection *selection, SPDesktop *desktop);84void sp_selection_lower(Inkscape::Selection *selection, SPDesktop *desktop);
85void sp_selection_stack_down(Inkscape::Selection *selection, SPDesktop *desktop);
84void sp_selection_lower_to_bottom(Inkscape::Selection *selection, SPDesktop *desktop);86void sp_selection_lower_to_bottom(Inkscape::Selection *selection, SPDesktop *desktop);
8587
86SPCSSAttr *take_style_from_item (SPObject *object);88SPCSSAttr *take_style_from_item (SPObject *object);
8789
=== modified file 'src/sp-item-group.cpp'
--- src/sp-item-group.cpp 2016-08-29 06:01:18 +0000
+++ src/sp-item-group.cpp 2017-05-17 23:30:53 +0000
@@ -598,6 +598,7 @@
598 Geom::Affine ttrans = ctrans.inverse() * SP_ITEM(text)->transform * ctrans;598 Geom::Affine ttrans = ctrans.inverse() * SP_ITEM(text)->transform * ctrans;
599 gchar *affinestr = sp_svg_transform_write(ttrans);599 gchar *affinestr = sp_svg_transform_write(ttrans);
600 nrepr->setAttribute("transform", affinestr);600 nrepr->setAttribute("transform", affinestr);
601 g_free(affinestr);
601 }602 }
602 } else {603 } else {
603 nrepr->setAttribute("transform", affinestr);604 nrepr->setAttribute("transform", affinestr);
604605
=== modified file 'src/sp-item.cpp'
--- src/sp-item.cpp 2017-01-17 10:28:55 +0000
+++ src/sp-item.cpp 2017-05-17 23:30:53 +0000
@@ -318,17 +318,19 @@
318 }318 }
319}319}
320320
321void SPItem::raiseOne() {321bool SPItem::raiseOne() {
322 SPObject *next_higher=std::find_if<SPObject::SiblingIterator>(322 SPObject *next_higher=std::find_if<SPObject::SiblingIterator>(
323 next, NULL, &is_item323 next, NULL, &is_item
324 );324 );
325 if (next_higher) {325 if (next_higher) {
326 Inkscape::XML::Node *ref = next_higher->getRepr();326 Inkscape::XML::Node *ref = next_higher->getRepr();
327 getRepr()->parent()->changeOrder(getRepr(), ref);327 getRepr()->parent()->changeOrder(getRepr(), ref);
328 return true;
328 }329 }
330 return false;
329}331}
330332
331void SPItem::lowerOne() {333bool SPItem::lowerOne() {
332 using Inkscape::Util::MutableList;334 using Inkscape::Util::MutableList;
333 using Inkscape::Util::reverse_list;335 using Inkscape::Util::reverse_list;
334336
@@ -343,7 +345,9 @@
343 ++next_lower;345 ++next_lower;
344 Inkscape::XML::Node *ref = ( next_lower ? next_lower->getRepr() : NULL );346 Inkscape::XML::Node *ref = ( next_lower ? next_lower->getRepr() : NULL );
345 getRepr()->parent()->changeOrder(getRepr(), ref);347 getRepr()->parent()->changeOrder(getRepr(), ref);
348 return true;
346 }349 }
350 return false;
347}351}
348352
349void SPItem::lowerToBottom() {353void SPItem::lowerToBottom() {
350354
=== modified file 'src/sp-item.h'
--- src/sp-item.h 2015-03-16 20:22:36 +0000
+++ src/sp-item.h 2017-05-17 23:30:53 +0000
@@ -212,8 +212,8 @@
212212
213 Geom::Affine getRelativeTransform(SPObject const *obj) const;213 Geom::Affine getRelativeTransform(SPObject const *obj) const;
214214
215 void raiseOne();215 bool raiseOne();
216 void lowerOne();216 bool lowerOne();
217 void raiseToTop();217 void raiseToTop();
218 void lowerToBottom();218 void lowerToBottom();
219219
220220
=== modified file 'src/sp-pattern.cpp'
--- src/sp-pattern.cpp 2016-09-06 10:44:16 +0000
+++ src/sp-pattern.cpp 2017-05-17 23:30:53 +0000
@@ -374,8 +374,9 @@
374 }374 }
375 _pattern_transform_set = true;375 _pattern_transform_set = true;
376376
377 Glib::ustring c = sp_svg_transform_write(_pattern_transform);377 gchar *c = sp_svg_transform_write(_pattern_transform);
378 getRepr()->setAttribute("patternTransform", c);378 getRepr()->setAttribute("patternTransform", c);
379 g_free(c);
379}380}
380381
381const gchar *SPPattern::produce(const std::vector<Inkscape::XML::Node *> &reprs, Geom::Rect bounds,382const gchar *SPPattern::produce(const std::vector<Inkscape::XML::Node *> &reprs, Geom::Rect bounds,
@@ -392,8 +393,9 @@
392 sp_repr_set_svg_double(repr, "height", bounds.dimensions()[Geom::Y]);393 sp_repr_set_svg_double(repr, "height", bounds.dimensions()[Geom::Y]);
393 //TODO: Maybe is better handle it in sp_svg_transform_write394 //TODO: Maybe is better handle it in sp_svg_transform_write
394 if(transform != Geom::Affine()){ 395 if(transform != Geom::Affine()){
395 Glib::ustring t = sp_svg_transform_write(transform);396 gchar *t = sp_svg_transform_write(transform);
396 repr->setAttribute("patternTransform", t);397 repr->setAttribute("patternTransform", t);
398 g_free(t);
397 }399 }
398 defsrepr->appendChild(repr);400 defsrepr->appendChild(repr);
399 const gchar *pat_id = repr->attribute("id");401 const gchar *pat_id = repr->attribute("id");
400402
=== modified file 'src/ui/dialog/objects.cpp'
--- src/ui/dialog/objects.cpp 2016-11-07 16:26:09 +0000
+++ src/ui/dialog/objects.cpp 2017-05-17 23:30:53 +0000
@@ -34,6 +34,7 @@
34#include "helper/action.h"34#include "helper/action.h"
35#include "inkscape.h"35#include "inkscape.h"
36#include "layer-manager.h"36#include "layer-manager.h"
37#include "shortcuts.h"
37#include "preferences.h"38#include "preferences.h"
38#include "selection.h"39#include "selection.h"
39#include "sp-clippath.h"40#include "sp-clippath.h"
@@ -319,11 +320,13 @@
319 SPRoot* root = document->getRoot();320 SPRoot* root = document->getRoot();
320 if ( root ) {321 if ( root ) {
321 _selectedConnection.block();322 _selectedConnection.block();
323 _documentChangedCurrentLayer.block();
322 //Clear the tree store324 //Clear the tree store
323 _store->clear();325 _store->clear();
324 //Add all items recursively326 //Add all items recursively
325 _addObject( root, 0 );327 _addObject( root, 0 );
326 _selectedConnection.unblock();328 _selectedConnection.unblock();
329 _documentChangedCurrentLayer.unblock();
327 //Set the tree selection330 //Set the tree selection
328 _objectsSelected(_desktop->selection);331 _objectsSelected(_desktop->selection);
329 //Handle button sensitivity332 //Handle button sensitivity
@@ -362,13 +365,17 @@
362 row[_model->_colLocked] = !item->isSensitive();365 row[_model->_colLocked] = !item->isSensitive();
363 row[_model->_colType] = group ? (group->layerMode() == SPGroup::LAYER ? 2 : 1) : 0;366 row[_model->_colType] = group ? (group->layerMode() == SPGroup::LAYER ? 2 : 1) : 0;
364 row[_model->_colHighlight] = item->isHighlightSet() ? item->highlight_color() : item->highlight_color() & 0xffffff00;367 row[_model->_colHighlight] = item->isHighlightSet() ? item->highlight_color() : item->highlight_color() & 0xffffff00;
365 row[_model->_colClipMask] = item->clip_ref && item->clip_ref->getObject() ? 1 : (item->mask_ref && item->mask_ref->getObject() ? 2 : 0);368 row[_model->_colClipMask] = item ? (
369 (item->clip_ref && item->clip_ref->getObject() ? 1 : 0) |
370 (item->mask_ref && item->mask_ref->getObject() ? 2 : 0)
371 ) : 0;
366 //row[_model->_colInsertOrder] = group ? (group->insertBottom() ? 2 : 1) : 0;372 //row[_model->_colInsertOrder] = group ? (group->insertBottom() ? 2 : 1) : 0;
367373
368 //If our parent object is a group and it's expanded, expand the tree374 //If our parent object is a group and it's expanded, expand the tree
369 if (SP_IS_GROUP(obj) && SP_GROUP(obj)->expanded())375 if (SP_IS_GROUP(obj) && SP_GROUP(obj)->expanded())
370 {376 {
371 _tree.expand_to_path( _store->get_path(iter) );377 _tree.expand_to_path( _store->get_path(iter) );
378 _tree.collapse_row( _store->get_path(iter) );
372 }379 }
373380
374 //Add an object watcher to the item381 //Add an object watcher to the item
@@ -426,7 +433,10 @@
426 row[_model->_colLocked] = item ? !item->isSensitive() : false;433 row[_model->_colLocked] = item ? !item->isSensitive() : false;
427 row[_model->_colType] = group ? (group->layerMode() == SPGroup::LAYER ? 2 : 1) : 0;434 row[_model->_colType] = group ? (group->layerMode() == SPGroup::LAYER ? 2 : 1) : 0;
428 row[_model->_colHighlight] = item ? (item->isHighlightSet() ? item->highlight_color() : item->highlight_color() & 0xffffff00) : 0;435 row[_model->_colHighlight] = item ? (item->isHighlightSet() ? item->highlight_color() : item->highlight_color() & 0xffffff00) : 0;
429 row[_model->_colClipMask] = item ? (item->clip_ref && item->clip_ref->getObject() ? 1 : (item->mask_ref && item->mask_ref->getObject() ? 2 : 0)) : 0;436 row[_model->_colClipMask] = item ? (
437 (item->clip_ref && item->clip_ref->getObject() ? 1 : 0) |
438 (item->mask_ref && item->mask_ref->getObject() ? 2 : 0)
439 ) : 0;
430 //row[_model->_colInsertOrder] = group ? (group->insertBottom() ? 2 : 1) : 0;440 //row[_model->_colInsertOrder] = group ? (group->insertBottom() ? 2 : 1) : 0;
431441
432 return true;442 return true;
@@ -486,13 +496,13 @@
486 _setCompositingValues(item);496 _setCompositingValues(item);
487 setOpacity = false;497 setOpacity = false;
488 }498 }
489 _store->foreach(sigc::bind<SPItem *, bool>( sigc::mem_fun(*this, &ObjectsPanel::_checkForSelected), item, (*i)==items.back()));499 _store->foreach(sigc::bind<SPItem *, bool>( sigc::mem_fun(*this, &ObjectsPanel::_checkForSelected), item, (*i)==items.back(), false));
490 }500 }
491 if (!item) {501 if (!item) {
492 if (_desktop->currentLayer() && SP_IS_ITEM(_desktop->currentLayer())) {502 if (_desktop->currentLayer() && SP_IS_ITEM(_desktop->currentLayer())) {
493 item = SP_ITEM(_desktop->currentLayer());503 item = SP_ITEM(_desktop->currentLayer());
494 _setCompositingValues(item);504 _setCompositingValues(item);
495 _store->foreach(sigc::bind<SPItem *, bool>( sigc::mem_fun(*this, &ObjectsPanel::_checkForSelected), item, true));505 _store->foreach(sigc::bind<SPItem *, bool>( sigc::mem_fun(*this, &ObjectsPanel::_checkForSelected), item, false, true));
496 }506 }
497 }507 }
498 _selectedConnection.unblock();508 _selectedConnection.unblock();
@@ -559,7 +569,7 @@
559 * @param scrollto Whether to scroll to the item569 * @param scrollto Whether to scroll to the item
560 * @return Whether to continue searching the tree570 * @return Whether to continue searching the tree
561 */571 */
562bool ObjectsPanel::_checkForSelected(const Gtk::TreePath &path, const Gtk::TreeIter& iter, SPItem* item, bool scrollto)572bool ObjectsPanel::_checkForSelected(const Gtk::TreePath &path, const Gtk::TreeIter& iter, SPItem* item, bool scrollto, bool expand)
563{573{
564 bool stopGoing = false;574 bool stopGoing = false;
565575
@@ -568,13 +578,16 @@
568 {578 {
569 //We found the item! Expand to the path and select it in the tree.579 //We found the item! Expand to the path and select it in the tree.
570 _tree.expand_to_path( path );580 _tree.expand_to_path( path );
581 if (!expand)
582 // but don't expand itself, just the path
583 _tree.collapse_row(path);
571584
572 Glib::RefPtr<Gtk::TreeSelection> select = _tree.get_selection();585 Glib::RefPtr<Gtk::TreeSelection> select = _tree.get_selection();
573586
574 select->select(iter);587 select->select(iter);
575 if (scrollto) {588 if (scrollto) {
576 //Scroll to the item in the tree589 //Scroll to the item in the tree
577 _tree.scroll_to_row(path);590 _tree.scroll_to_row(path, 0.5);
578 }591 }
579592
580 stopGoing = true;593 stopGoing = true;
@@ -591,6 +604,7 @@
591 if ( _desktop && _desktop->currentRoot() ) {604 if ( _desktop && _desktop->currentRoot() ) {
592 //block connections for selection and compositing values to prevent interference605 //block connections for selection and compositing values to prevent interference
593 _selectionChangedConnection.block();606 _selectionChangedConnection.block();
607 _documentChangedCurrentLayer.block();
594 608
595 //Clear the selection and then iterate over the tree selection, pushing each item to the desktop609 //Clear the selection and then iterate over the tree selection, pushing each item to the desktop
596 _desktop->selection->clear();610 _desktop->selection->clear();
@@ -598,6 +612,7 @@
598 _tree.get_selection()->selected_foreach_iter( sigc::bind<bool *>(sigc::mem_fun(*this, &ObjectsPanel::_selected_row_callback), &setOpacity));612 _tree.get_selection()->selected_foreach_iter( sigc::bind<bool *>(sigc::mem_fun(*this, &ObjectsPanel::_selected_row_callback), &setOpacity));
599 //unblock connections613 //unblock connections
600 _selectionChangedConnection.unblock();614 _selectionChangedConnection.unblock();
615 _documentChangedCurrentLayer.unblock();
601 616
602 _checkTreeSelection();617 _checkTreeSelection();
603 }618 }
@@ -696,53 +711,63 @@
696 */711 */
697bool ObjectsPanel::_handleKeyEvent(GdkEventKey *event)712bool ObjectsPanel::_handleKeyEvent(GdkEventKey *event)
698{713{
699714 if (!_desktop)
715 return false;
716
717 unsigned int shortcut;
718 shortcut = Inkscape::UI::Tools::get_group0_keyval(event) |
719 ( event->state & GDK_SHIFT_MASK ?
720 SP_SHORTCUT_SHIFT_MASK : 0 ) |
721 ( event->state & GDK_CONTROL_MASK ?
722 SP_SHORTCUT_CONTROL_MASK : 0 ) |
723 ( event->state & GDK_MOD1_MASK ?
724 SP_SHORTCUT_ALT_MASK : 0 );
725
726 switch (shortcut) {
727 // how to get users key binding for the action “start-interactive-search” ??
728 // ctrl+f is just the default
729 case GDK_KEY_f | SP_SHORTCUT_CONTROL_MASK:
730 return false;
731 break;
732 // shall we slurp ctrl+w to close panel?
733
734 // defocus:
735 case GDK_KEY_Escape:
736 if (_desktop->canvas) {
737 gtk_widget_grab_focus (GTK_WIDGET(_desktop->canvas));
738 return true;
739 }
740 break;
741 }
742
743 // invoke user defined shortcuts first
744 bool done = sp_shortcut_invoke(shortcut, _desktop);
745 if (done)
746 return true;
747
748 // handle events for the treeview
700 bool empty = _desktop->selection->isEmpty();749 bool empty = _desktop->selection->isEmpty();
701750
702 switch (Inkscape::UI::Tools::get_group0_keyval(event)) {751 switch (Inkscape::UI::Tools::get_group0_keyval(event)) {
703 case GDK_KEY_Return:752 case GDK_KEY_Return:
704 case GDK_KEY_KP_Enter:753 case GDK_KEY_KP_Enter:
705 case GDK_KEY_F2:
706 {754 {
707 Gtk::TreeModel::iterator iter = _tree.get_selection()->get_selected();755 Gtk::TreeModel::Path path;
708 if (iter && !_text_renderer->property_editable()) {756 Gtk::TreeViewColumn *focus_column = 0;
757
758 _tree.get_cursor(path, focus_column);
759 if (focus_column == _name_column && !_text_renderer->property_editable()) {
709 //Rename item760 //Rename item
710 Gtk::TreeModel::Path *path = new Gtk::TreeModel::Path(iter);
711 _text_renderer->property_editable() = true;761 _text_renderer->property_editable() = true;
712 _tree.set_cursor(*path, *_name_column, true);762 _tree.set_cursor(path, *_name_column, true);
713 grab_focus();763 grab_focus();
714 return true;764 return true;
715 }765 }
716 }
717 break;
718 case GDK_KEY_Home:
719 //Move item(s) to top of containing group/layer
720 _fireAction( empty ? SP_VERB_LAYER_TO_TOP : SP_VERB_SELECTION_TO_FRONT );
721 break;
722 case GDK_KEY_End:
723 //Move item(s) to bottom of containing group/layer
724 _fireAction( empty ? SP_VERB_LAYER_TO_BOTTOM : SP_VERB_SELECTION_TO_BACK );
725 break;
726 case GDK_KEY_Page_Up:
727 {
728 //Move item(s) up in containing group/layer
729 int ch = event->state & GDK_SHIFT_MASK ? SP_VERB_LAYER_MOVE_TO_NEXT : SP_VERB_SELECTION_RAISE;
730 _fireAction( empty ? SP_VERB_LAYER_RAISE : ch );
731 break;
732 }
733 case GDK_KEY_Page_Down:
734 {
735 //Move item(s) down in containing group/layer
736 int ch = event->state & GDK_SHIFT_MASK ? SP_VERB_LAYER_MOVE_TO_PREV : SP_VERB_SELECTION_LOWER;
737 _fireAction( empty ? SP_VERB_LAYER_LOWER : ch );
738 break;
739 }
740
741 //TODO: Handle Ctrl-A, etc.
742 default:
743 return false;766 return false;
767 break;
768 }
744 }769 }
745 return true;770 return false;
746}771}
747772
748/**773/**
@@ -1186,7 +1211,7 @@
1186 }1211 }
1187 else1212 else
1188 {1213 {
1189 _fireAction( SP_VERB_SELECTION_RAISE );1214 _fireAction( SP_VERB_SELECTION_STACK_UP );
1190 }1215 }
1191 }1216 }
1192 break;1217 break;
@@ -1198,7 +1223,7 @@
1198 }1223 }
1199 else1224 else
1200 {1225 {
1201 _fireAction( SP_VERB_SELECTION_LOWER );1226 _fireAction( SP_VERB_SELECTION_STACK_DOWN );
1202 }1227 }
1203 }1228 }
1204 break;1229 break;
@@ -1746,6 +1771,8 @@
1746 //Set the expander and search columns1771 //Set the expander and search columns
1747 _tree.set_expander_column( *_tree.get_column(nameColNum) );1772 _tree.set_expander_column( *_tree.get_column(nameColNum) );
1748 _tree.set_search_column(_model->_colLabel);1773 _tree.set_search_column(_model->_colLabel);
1774 // use ctrl+f to start search
1775 _tree.set_enable_search(false);
17491776
1750 //Set up the tree selection1777 //Set up the tree selection
1751 _tree.get_selection()->set_mode(Gtk::SELECTION_MULTIPLE);1778 _tree.get_selection()->set_mode(Gtk::SELECTION_MULTIPLE);
@@ -1914,8 +1941,8 @@
19141941
1915 _popupMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem()));1942 _popupMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem()));
19161943
1917 _watchingNonTop.push_back( &_addPopupItem( targetDesktop, SP_VERB_SELECTION_RAISE, "gtk-go-up", _("Up"), (int)BUTTON_UP ) );1944 _watchingNonTop.push_back( &_addPopupItem( targetDesktop, SP_VERB_SELECTION_STACK_UP, "gtk-go-up", _("Up"), (int)BUTTON_UP ) );
1918 _watchingNonBottom.push_back( &_addPopupItem( targetDesktop, SP_VERB_SELECTION_LOWER, "gtk-go-down", _("Down"), (int)BUTTON_DOWN ) );1945 _watchingNonBottom.push_back( &_addPopupItem( targetDesktop, SP_VERB_SELECTION_STACK_DOWN, "gtk-go-down", _("Down"), (int)BUTTON_DOWN ) );
19191946
1920 _popupMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem()));1947 _popupMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem()));
1921 1948
@@ -2054,6 +2081,7 @@
20542081
2055 if ( desktop != _desktop ) {2082 if ( desktop != _desktop ) {
2056 _documentChangedConnection.disconnect();2083 _documentChangedConnection.disconnect();
2084 _documentChangedCurrentLayer.disconnect();
2057 _selectionChangedConnection.disconnect();2085 _selectionChangedConnection.disconnect();
2058 if ( _desktop ) {2086 if ( _desktop ) {
2059 _desktop = 0;2087 _desktop = 0;
@@ -2063,6 +2091,9 @@
2063 if ( _desktop ) {2091 if ( _desktop ) {
2064 //Connect desktop signals2092 //Connect desktop signals
2065 _documentChangedConnection = _desktop->connectDocumentReplaced( sigc::mem_fun(*this, &ObjectsPanel::setDocument));2093 _documentChangedConnection = _desktop->connectDocumentReplaced( sigc::mem_fun(*this, &ObjectsPanel::setDocument));
2094
2095 _documentChangedCurrentLayer = _desktop->connectCurrentLayerChanged( sigc::mem_fun(*this, &ObjectsPanel::_objectsChanged));
2096
2066 _selectionChangedConnection = _desktop->selection->connectChanged( sigc::mem_fun(*this, &ObjectsPanel::_objectsSelected));2097 _selectionChangedConnection = _desktop->selection->connectChanged( sigc::mem_fun(*this, &ObjectsPanel::_objectsSelected));
2067 2098
2068 setDocument(_desktop, _desktop->doc());2099 setDocument(_desktop, _desktop->doc());
20692100
=== modified file 'src/ui/dialog/objects.h'
--- src/ui/dialog/objects.h 2015-06-18 09:36:24 +0000
+++ src/ui/dialog/objects.h 2017-05-17 23:30:53 +0000
@@ -77,6 +77,9 @@
77 //Connection for when the document changes77 //Connection for when the document changes
78 sigc::connection _documentChangedConnection;78 sigc::connection _documentChangedConnection;
79 79
80 //Connection for when the active layer changes
81 sigc::connection _documentChangedCurrentLayer;
82
80 //Connection for when the active selection in the document changes83 //Connection for when the active selection in the document changes
81 sigc::connection _selectionChangedConnection;84 sigc::connection _selectionChangedConnection;
8285
@@ -226,7 +229,7 @@
226 bool _checkForUpdated(const Gtk::TreeIter& iter, SPObject* obj);229 bool _checkForUpdated(const Gtk::TreeIter& iter, SPObject* obj);
227230
228 void _objectsSelected(Selection *sel);231 void _objectsSelected(Selection *sel);
229 bool _checkForSelected(const Gtk::TreePath& path, const Gtk::TreeIter& iter, SPItem* item, bool scrollto);232 bool _checkForSelected(const Gtk::TreePath& path, const Gtk::TreeIter& iter, SPItem* item, bool scrollto, bool expand);
230233
231 void _objectsChanged(SPObject *obj);234 void _objectsChanged(SPObject *obj);
232 void _addObject( SPObject* obj, Gtk::TreeModel::Row* parentRow );235 void _addObject( SPObject* obj, Gtk::TreeModel::Row* parentRow );
233236
=== modified file 'src/ui/widget/clipmaskicon.cpp'
--- src/ui/widget/clipmaskicon.cpp 2015-04-27 23:38:31 +0000
+++ src/ui/widget/clipmaskicon.cpp 2017-05-17 23:30:53 +0000
@@ -27,13 +27,13 @@
27ClipMaskIcon::ClipMaskIcon() :27ClipMaskIcon::ClipMaskIcon() :
28 Glib::ObjectBase(typeid(ClipMaskIcon)),28 Glib::ObjectBase(typeid(ClipMaskIcon)),
29 Gtk::CellRendererPixbuf(),29 Gtk::CellRendererPixbuf(),
30 _pixClipName(INKSCAPE_ICON("path-intersection")),30 _pixClipName(INKSCAPE_ICON("object-clipped")),
31 _pixInverseName(INKSCAPE_ICON("path-difference")),31 _pixMaskName(INKSCAPE_ICON("object-masked")),
32 _pixMaskName(INKSCAPE_ICON("mask-intersection")),32 _pixBothName(INKSCAPE_ICON("object-clip-mask")),
33 _property_active(*this, "active", 0),33 _property_active(*this, "active", 0),
34 _property_pixbuf_clip(*this, "pixbuf_on", Glib::RefPtr<Gdk::Pixbuf>(0)),34 _property_pixbuf_clip(*this, "pixbuf_on", Glib::RefPtr<Gdk::Pixbuf>(0)),
35 _property_pixbuf_inverse(*this, "pixbuf_on", Glib::RefPtr<Gdk::Pixbuf>(0)),35 _property_pixbuf_mask(*this, "pixbuf_off", Glib::RefPtr<Gdk::Pixbuf>(0)),
36 _property_pixbuf_mask(*this, "pixbuf_off", Glib::RefPtr<Gdk::Pixbuf>(0))36 _property_pixbuf_both(*this, "pixbuf_on", Glib::RefPtr<Gdk::Pixbuf>(0))
37{37{
38 38
39 property_mode() = Gtk::CELL_RENDERER_MODE_ACTIVATABLE;39 property_mode() = Gtk::CELL_RENDERER_MODE_ACTIVATABLE;
@@ -43,22 +43,22 @@
43 if (!icon_theme->has_icon(_pixClipName)) {43 if (!icon_theme->has_icon(_pixClipName)) {
44 Inkscape::queueIconPrerender( INKSCAPE_ICON(_pixClipName.data()), Inkscape::ICON_SIZE_DECORATION );44 Inkscape::queueIconPrerender( INKSCAPE_ICON(_pixClipName.data()), Inkscape::ICON_SIZE_DECORATION );
45 }45 }
46 if (!icon_theme->has_icon(_pixInverseName)) {
47 Inkscape::queueIconPrerender( INKSCAPE_ICON(_pixInverseName.data()), Inkscape::ICON_SIZE_DECORATION );
48 }
49 if (!icon_theme->has_icon(_pixMaskName)) {46 if (!icon_theme->has_icon(_pixMaskName)) {
50 Inkscape::queueIconPrerender( INKSCAPE_ICON(_pixMaskName.data()), Inkscape::ICON_SIZE_DECORATION );47 Inkscape::queueIconPrerender( INKSCAPE_ICON(_pixMaskName.data()), Inkscape::ICON_SIZE_DECORATION );
51 }48 }
49 if (!icon_theme->has_icon(_pixBothName)) {
50 Inkscape::queueIconPrerender( INKSCAPE_ICON(_pixBothName.data()), Inkscape::ICON_SIZE_DECORATION );
51 }
5252
53 if (icon_theme->has_icon(_pixClipName)) {53 if (icon_theme->has_icon(_pixClipName)) {
54 _property_pixbuf_clip = icon_theme->load_icon(_pixClipName, phys, (Gtk::IconLookupFlags)0);54 _property_pixbuf_clip = icon_theme->load_icon(_pixClipName, phys, (Gtk::IconLookupFlags)0);
55 }55 }
56 if (icon_theme->has_icon(_pixInverseName)) {
57 _property_pixbuf_inverse = icon_theme->load_icon(_pixInverseName, phys, (Gtk::IconLookupFlags)0);
58 }
59 if (icon_theme->has_icon(_pixMaskName)) {56 if (icon_theme->has_icon(_pixMaskName)) {
60 _property_pixbuf_mask = icon_theme->load_icon(_pixMaskName, phys, (Gtk::IconLookupFlags)0);57 _property_pixbuf_mask = icon_theme->load_icon(_pixMaskName, phys, (Gtk::IconLookupFlags)0);
61 }58 }
59 if (icon_theme->has_icon(_pixBothName)) {
60 _property_pixbuf_both = icon_theme->load_icon(_pixBothName, phys, (Gtk::IconLookupFlags)0);
61 }
6262
63 property_pixbuf() = Glib::RefPtr<Gdk::Pixbuf>(0);63 property_pixbuf() = Glib::RefPtr<Gdk::Pixbuf>(0);
64}64}
@@ -137,7 +137,7 @@
137 property_pixbuf() = _property_pixbuf_mask;137 property_pixbuf() = _property_pixbuf_mask;
138 break;138 break;
139 case 3:139 case 3:
140 property_pixbuf() = _property_pixbuf_inverse;140 property_pixbuf() = _property_pixbuf_both;
141 break;141 break;
142 default:142 default:
143 property_pixbuf() = Glib::RefPtr<Gdk::Pixbuf>(0);143 property_pixbuf() = Glib::RefPtr<Gdk::Pixbuf>(0);
144144
=== modified file 'src/ui/widget/clipmaskicon.h'
--- src/ui/widget/clipmaskicon.h 2014-10-08 02:22:03 +0000
+++ src/ui/widget/clipmaskicon.h 2017-05-17 23:30:53 +0000
@@ -71,13 +71,13 @@
71 int phys;71 int phys;
72 72
73 Glib::ustring _pixClipName;73 Glib::ustring _pixClipName;
74 Glib::ustring _pixInverseName;
75 Glib::ustring _pixMaskName;74 Glib::ustring _pixMaskName;
75 Glib::ustring _pixBothName;
76 76
77 Glib::Property<int> _property_active;77 Glib::Property<int> _property_active;
78 Glib::Property< Glib::RefPtr<Gdk::Pixbuf> > _property_pixbuf_clip;78 Glib::Property< Glib::RefPtr<Gdk::Pixbuf> > _property_pixbuf_clip;
79 Glib::Property< Glib::RefPtr<Gdk::Pixbuf> > _property_pixbuf_inverse;
80 Glib::Property< Glib::RefPtr<Gdk::Pixbuf> > _property_pixbuf_mask;79 Glib::Property< Glib::RefPtr<Gdk::Pixbuf> > _property_pixbuf_mask;
80 Glib::Property< Glib::RefPtr<Gdk::Pixbuf> > _property_pixbuf_both;
81 81
82};82};
8383
8484
=== modified file 'src/verbs.cpp'
--- src/verbs.cpp 2016-11-02 22:44:54 +0000
+++ src/verbs.cpp 2017-05-17 23:30:53 +0000
@@ -1144,6 +1144,12 @@
1144 case SP_VERB_SELECTION_LOWER:1144 case SP_VERB_SELECTION_LOWER:
1145 sp_selection_lower(selection, dt);1145 sp_selection_lower(selection, dt);
1146 break;1146 break;
1147 case SP_VERB_SELECTION_STACK_UP:
1148 sp_selection_stack_up(selection, dt);
1149 break;
1150 case SP_VERB_SELECTION_STACK_DOWN:
1151 sp_selection_stack_down(selection, dt);
1152 break;
1147 case SP_VERB_SELECTION_GROUP:1153 case SP_VERB_SELECTION_GROUP:
1148 sp_selection_group(selection, dt);1154 sp_selection_group(selection, dt);
1149 break;1155 break;
@@ -2558,6 +2564,14 @@
2558 N_("Raise selection one step"), INKSCAPE_ICON("selection-raise")),2564 N_("Raise selection one step"), INKSCAPE_ICON("selection-raise")),
2559 new SelectionVerb(SP_VERB_SELECTION_LOWER, "SelectionLower", N_("_Lower"),2565 new SelectionVerb(SP_VERB_SELECTION_LOWER, "SelectionLower", N_("_Lower"),
2560 N_("Lower selection one step"), INKSCAPE_ICON("selection-lower")),2566 N_("Lower selection one step"), INKSCAPE_ICON("selection-lower")),
2567
2568
2569 new SelectionVerb(SP_VERB_SELECTION_STACK_UP, "SelectionStackUp", N_("_Stack up"),
2570 N_("Stack selection one step up"), INKSCAPE_ICON("layer-lower")),
2571 new SelectionVerb(SP_VERB_SELECTION_STACK_DOWN, "SelectionStackDown", N_("_Stack down"),
2572 N_("Stack selection one step down"), INKSCAPE_ICON("layer-raise")),
2573
2574
2561 new SelectionVerb(SP_VERB_SELECTION_GROUP, "SelectionGroup", N_("_Group"),2575 new SelectionVerb(SP_VERB_SELECTION_GROUP, "SelectionGroup", N_("_Group"),
2562 N_("Group selected objects"), INKSCAPE_ICON("object-group")),2576 N_("Group selected objects"), INKSCAPE_ICON("object-group")),
2563 new SelectionVerb(SP_VERB_SELECTION_UNGROUP, "SelectionUnGroup", N_("_Ungroup"),2577 new SelectionVerb(SP_VERB_SELECTION_UNGROUP, "SelectionUnGroup", N_("_Ungroup"),
25642578
=== modified file 'src/verbs.h'
--- src/verbs.h 2016-04-14 18:19:03 +0000
+++ src/verbs.h 2017-05-17 23:30:53 +0000
@@ -114,6 +114,8 @@
114 SP_VERB_SELECTION_TO_BACK,114 SP_VERB_SELECTION_TO_BACK,
115 SP_VERB_SELECTION_RAISE,115 SP_VERB_SELECTION_RAISE,
116 SP_VERB_SELECTION_LOWER,116 SP_VERB_SELECTION_LOWER,
117 SP_VERB_SELECTION_STACK_UP,
118 SP_VERB_SELECTION_STACK_DOWN,
117 SP_VERB_SELECTION_GROUP,119 SP_VERB_SELECTION_GROUP,
118 SP_VERB_SELECTION_UNGROUP,120 SP_VERB_SELECTION_UNGROUP,
119 SP_VERB_SELECTION_UNGROUP_POP_SELECTION,121 SP_VERB_SELECTION_UNGROUP_POP_SELECTION,
120122
=== modified file 'src/widgets/stroke-marker-selector.cpp'
--- src/widgets/stroke-marker-selector.cpp 2014-12-23 09:25:08 +0000
+++ src/widgets/stroke-marker-selector.cpp 2017-05-17 23:30:53 +0000
@@ -60,8 +60,13 @@
60 set_cell_data_func(image_renderer, sigc::mem_fun(*this, &MarkerComboBox::prepareImageRenderer));60 set_cell_data_func(image_renderer, sigc::mem_fun(*this, &MarkerComboBox::prepareImageRenderer));
61 gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(gobj()), MarkerComboBox::separator_cb, NULL, NULL);61 gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(gobj()), MarkerComboBox::separator_cb, NULL, NULL);
6262
63 Glib::ustring no_marker("no-marker");
64 Glib::RefPtr<Gtk::IconTheme> iconTheme = Gtk::IconTheme::get_default();
65 if (!iconTheme->has_icon(no_marker)) {
66 Inkscape::queueIconPrerender( INKSCAPE_ICON(no_marker.data()), Inkscape::ICON_SIZE_SMALL_TOOLBAR );
67 }
63 empty_image = new Gtk::Image( Glib::wrap(68 empty_image = new Gtk::Image( Glib::wrap(
64 sp_pixbuf_new( Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("no-marker") ) ) );69 sp_pixbuf_new( Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON(no_marker.data()) ) ) );
6570
66 sandbox = ink_markers_preview_doc ();71 sandbox = ink_markers_preview_doc ();
67 desktop = SP_ACTIVE_DESKTOP;72 desktop = SP_ACTIVE_DESKTOP;
@@ -77,6 +82,7 @@
77MarkerComboBox::~MarkerComboBox() {82MarkerComboBox::~MarkerComboBox() {
78 delete combo_id;83 delete combo_id;
79 delete sandbox;84 delete sandbox;
85 delete empty_image;
8086
81 if (doc) {87 if (doc) {
82 modified_connection.disconnect();88 modified_connection.disconnect();
@@ -399,7 +405,7 @@
399 gchar const *markid = repr->attribute("inkscape:stockid") ? repr->attribute("inkscape:stockid") : repr->attribute("id");405 gchar const *markid = repr->attribute("inkscape:stockid") ? repr->attribute("inkscape:stockid") : repr->attribute("id");
400406
401 // generate preview407 // generate preview
402 Gtk::Image *prv = create_marker_image (22, repr->attribute("id"), source, drawing, visionkey);408 Gtk::Image *prv = create_marker_image (24, repr->attribute("id"), source, drawing, visionkey);
403 prv->show();409 prv->show();
404410
405 // Add history before separator, others after411 // Add history before separator, others after
@@ -430,14 +436,14 @@
430MarkerComboBox::update_marker_image(gchar const *mname)436MarkerComboBox::update_marker_image(gchar const *mname)
431{437{
432 gchar *cache_name = g_strconcat(combo_id, mname, NULL);438 gchar *cache_name = g_strconcat(combo_id, mname, NULL);
433 Glib::ustring key = svg_preview_cache.cache_key(doc->getURI(), cache_name, 22);439 Glib::ustring key = svg_preview_cache.cache_key(doc->getURI(), cache_name, 24);
434 g_free (cache_name);440 g_free (cache_name);
435 svg_preview_cache.remove_preview_from_cache(key);441 svg_preview_cache.remove_preview_from_cache(key);
436442
437 Inkscape::Drawing drawing;443 Inkscape::Drawing drawing;
438 unsigned const visionkey = SPItem::display_key_new(1);444 unsigned const visionkey = SPItem::display_key_new(1);
439 drawing.setRoot(sandbox->getRoot()->invoke_show(drawing, visionkey, SP_ITEM_SHOW_DISPLAY));445 drawing.setRoot(sandbox->getRoot()->invoke_show(drawing, visionkey, SP_ITEM_SHOW_DISPLAY));
440 Gtk::Image *prv = create_marker_image(22, mname, doc, drawing, visionkey);446 Gtk::Image *prv = create_marker_image(24, mname, doc, drawing, visionkey);
441 if (prv) {447 if (prv) {
442 prv->show();448 prv->show();
443 }449 }

Subscribers

People subscribed via source and target branches