Merge lp:~sandra-snan/inkscape/sandra into lp:~inkscape.dev/inkscape/trunk
- sandra
- Merge into trunk
Status: | Rejected |
---|---|
Rejected by: | Martin Owens |
Proposed branch: | lp:~sandra-snan/inkscape/sandra |
Merge into: | lp:~inkscape.dev/inkscape/trunk |
Diff against target: |
314 lines (+149/-36) 8 files modified
AUTHORS (+1/-0) share/icons/icons.svg (+54/-0) share/keys/default.xml (+10/-1) share/keys/inkscape.xml (+22/-1) share/keys/xara.xml (+4/-4) src/select-context.cpp (+0/-30) src/verbs.cpp (+52/-0) src/verbs.h (+6/-0) |
To merge this branch: | bzr merge lp:~sandra-snan/inkscape/sandra |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
jazzynico (community) | Needs Information | ||
Review via email: mp+87872@code.launchpad.net |
Commit message
Description of the change
Suggested fix for bug #770681, that comma, period, < and > can’t be remapped (annoying for dvorak users), via moving the hard-coded scaling from select-context.cpp to verbs.cpp.
- 10862. By Sandra Snan <sandra@ellen>
-
Moved the new verbs in verbs.cpp to match verbs.h
Sandra Snan (sandra-snan) wrote : | # |
Jon A. Cruz (jon-joncruz) wrote : | # |
On Jan 9, 2012, at 11:28 PM, Sandra Snan wrote:
> I’ve kinda changed my mind about this merge. There are so many hard-coded GDK_key_name all over Inkscape and so many contexts and the verbs file is already super long. My change just adds fuel to the fire (and even so, the code in the switch that I added should be extracted into methods).
>
> Yes, it’s not acceptable that period and comma are clobbered by some builtins (I really want to remap them, they’re right under my good hand as a dvorak user), but OTOH the entire Inkscape shortcut / verb / context / GDK event system is due for a big rethink.
>
> I’ve got some ideas in mind if / when I get more familiar with the code.
> I’m thinking of maybe replacing the switches (both in verbs.cpp and in the various contexts) with polymorphic objects, just tear everything out. I don’t know. I’ll start a new branch for it if I feel brave enough.
Hi Sandra,
Just wanted to let you know I've had some rough idea of what we need to clean up those situations, and also that I've started in on some input changes that might start to touch the areas you might care about. We probably should coordinate a bit and see where I can support some of your efforts.
Also, the bit I'm coding right now is to allow one to use a joystick to modify standard mouse drawing. I'm hooking things in so the analog joysticks can replace the input normally gained from the tit and pressure of
Sandra Snan (sandra-snan) wrote : | # |
The idea I was having was to make a class that contains or inherits GDK event but also has information about which »verb« / XML-specified key binding to use, which icon and so on.
So code in a something-
Verbs.cpp would be replaced by code that just reads the keybinding XML files to set things up, to make like a factory method that creates these instances.
Still not sure about that either, but I don’t think it’s working the way it is now, with both hard coded things everywhere as well as a huge verbs.cpp file that’s taking on more and more duties.
It needs a rethink.
jazzynico (jazzynico) wrote : | # |
I've just updated the patch (attached to the bug report) so that it works with trunk rev. 14917.
But the reason why the branch was rejected is unclear to me. Could anyone clarify?
Preview Diff
1 | === modified file 'AUTHORS' |
2 | --- AUTHORS 2011-12-11 23:21:19 +0000 |
3 | +++ AUTHORS 2012-01-08 16:11:23 +0000 |
4 | @@ -129,6 +129,7 @@ |
5 | Abhishek Sharma |
6 | Shivaken |
7 | Michael Sloan |
8 | +Sandra Snan |
9 | Danilo Šegan |
10 | Boštjan Špetič |
11 | Aaron Spike |
12 | |
13 | === modified file 'share/icons/icons.svg' |
14 | --- share/icons/icons.svg 2012-01-02 23:02:35 +0000 |
15 | +++ share/icons/icons.svg 2012-01-08 16:11:23 +0000 |
16 | @@ -1203,6 +1203,60 @@ |
17 | <use xlink:href="#use7634" height="1250" width="1250" transform="translate(0,6)" id="use7636" y="0" x="0" /> |
18 | <use xlink:href="#path10505" height="1250" width="1250" id="use5413" y="0" x="0" style="display:inline" transform="matrix(-1,0,0,-1,-74.00271,364.9954)" /> |
19 | </g> |
20 | +<g id="selection-grow" transform="translate(235.0423,-49.96096)" style="display:inline" inkscape:label="#selection_up"> |
21 | +<rect y="175" x="-45" height="16" width="16" id="rect10473" style="color:#000000;fill:none;stroke:none;stroke-width:1;marker:none;display:inline" /> |
22 | +<path style="fill:none;stroke:url(#linearGradient5835);stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none" d="m -43.97588,175.9908 c 4.97368,0 4.97368,0 4.97368,0" id="path10475" /> |
23 | +<rect y="178.46091" x="-44.50185" height="2.002599" width="14.99927" id="rect10479" style="color:#000000;fill:url(#linearGradient5837);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient5839);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline" /> |
24 | +<path style="fill:none;stroke:url(#linearGradient5842);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;display:inline" d="m -44.00221,185.9908 c 7.94048,0 7.94048,0 7.94048,0" id="path10483" /> |
25 | +<use xlink:href="#path10475" height="1250" width="1250" transform="translate(-0.0387999,6.97005)" id="use7634" y="0" x="0" /> |
26 | +<use xlink:href="#use7634" height="1250" width="1250" transform="translate(0,6)" id="use7636" y="0" x="0" /> |
27 | +<use xlink:href="#path10505" height="1250" width="1250" id="use5413" y="0" x="0" style="display:inline" transform="matrix(-1,0,0,-1,-74.00271,364.9954)" /> |
28 | +</g> |
29 | +<g id="selection-grow-screen" transform="translate(235.0423,-49.96096)" style="display:inline" inkscape:label="#selection_up"> |
30 | +<rect y="175" x="-45" height="16" width="16" id="rect10473" style="color:#000000;fill:none;stroke:none;stroke-width:1;marker:none;display:inline" /> |
31 | +<path style="fill:none;stroke:url(#linearGradient5835);stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none" d="m -43.97588,175.9908 c 4.97368,0 4.97368,0 4.97368,0" id="path10475" /> |
32 | +<rect y="178.46091" x="-44.50185" height="2.002599" width="14.99927" id="rect10479" style="color:#000000;fill:url(#linearGradient5837);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient5839);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline" /> |
33 | +<path style="fill:none;stroke:url(#linearGradient5842);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;display:inline" d="m -44.00221,185.9908 c 7.94048,0 7.94048,0 7.94048,0" id="path10483" /> |
34 | +<use xlink:href="#path10475" height="1250" width="1250" transform="translate(-0.0387999,6.97005)" id="use7634" y="0" x="0" /> |
35 | +<use xlink:href="#use7634" height="1250" width="1250" transform="translate(0,6)" id="use7636" y="0" x="0" /> |
36 | +<use xlink:href="#path10505" height="1250" width="1250" id="use5413" y="0" x="0" style="display:inline" transform="matrix(-1,0,0,-1,-74.00271,364.9954)" /> |
37 | +</g> |
38 | +<g id="selection-grow-double" transform="translate(235.0423,-49.96096)" style="display:inline" inkscape:label="#selection_up"> |
39 | +<rect y="175" x="-45" height="16" width="16" id="rect10473" style="color:#000000;fill:none;stroke:none;stroke-width:1;marker:none;display:inline" /> |
40 | +<path style="fill:none;stroke:url(#linearGradient5835);stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none" d="m -43.97588,175.9908 c 4.97368,0 4.97368,0 4.97368,0" id="path10475" /> |
41 | +<rect y="178.46091" x="-44.50185" height="2.002599" width="14.99927" id="rect10479" style="color:#000000;fill:url(#linearGradient5837);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient5839);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline" /> |
42 | +<path style="fill:none;stroke:url(#linearGradient5842);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;display:inline" d="m -44.00221,185.9908 c 7.94048,0 7.94048,0 7.94048,0" id="path10483" /> |
43 | +<use xlink:href="#path10475" height="1250" width="1250" transform="translate(-0.0387999,6.97005)" id="use7634" y="0" x="0" /> |
44 | +<use xlink:href="#use7634" height="1250" width="1250" transform="translate(0,6)" id="use7636" y="0" x="0" /> |
45 | +<use xlink:href="#path10505" height="1250" width="1250" id="use5413" y="0" x="0" style="display:inline" transform="matrix(-1,0,0,-1,-74.00271,364.9954)" /> |
46 | +</g> |
47 | +<g id="selection-shrink" transform="translate(235.0423,-49.96096)" style="display:inline" inkscape:label="#selection_up"> |
48 | +<rect y="175" x="-45" height="16" width="16" id="rect10473" style="color:#000000;fill:none;stroke:none;stroke-width:1;marker:none;display:inline" /> |
49 | +<path style="fill:none;stroke:url(#linearGradient5835);stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none" d="m -43.97588,175.9908 c 4.97368,0 4.97368,0 4.97368,0" id="path10475" /> |
50 | +<rect y="178.46091" x="-44.50185" height="2.002599" width="14.99927" id="rect10479" style="color:#000000;fill:url(#linearGradient5837);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient5839);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline" /> |
51 | +<path style="fill:none;stroke:url(#linearGradient5842);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;display:inline" d="m -44.00221,185.9908 c 7.94048,0 7.94048,0 7.94048,0" id="path10483" /> |
52 | +<use xlink:href="#path10475" height="1250" width="1250" transform="translate(-0.0387999,6.97005)" id="use7634" y="0" x="0" /> |
53 | +<use xlink:href="#use7634" height="1250" width="1250" transform="translate(0,6)" id="use7636" y="0" x="0" /> |
54 | +<use xlink:href="#path10505" height="1250" width="1250" id="use5413" y="0" x="0" style="display:inline" transform="matrix(-1,0,0,-1,-74.00271,364.9954)" /> |
55 | +</g> |
56 | +<g id="selection-shrink-screen" transform="translate(235.0423,-49.96096)" style="display:inline" inkscape:label="#selection_up"> |
57 | +<rect y="175" x="-45" height="16" width="16" id="rect10473" style="color:#000000;fill:none;stroke:none;stroke-width:1;marker:none;display:inline" /> |
58 | +<path style="fill:none;stroke:url(#linearGradient5835);stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none" d="m -43.97588,175.9908 c 4.97368,0 4.97368,0 4.97368,0" id="path10475" /> |
59 | +<rect y="178.46091" x="-44.50185" height="2.002599" width="14.99927" id="rect10479" style="color:#000000;fill:url(#linearGradient5837);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient5839);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline" /> |
60 | +<path style="fill:none;stroke:url(#linearGradient5842);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;display:inline" d="m -44.00221,185.9908 c 7.94048,0 7.94048,0 7.94048,0" id="path10483" /> |
61 | +<use xlink:href="#path10475" height="1250" width="1250" transform="translate(-0.0387999,6.97005)" id="use7634" y="0" x="0" /> |
62 | +<use xlink:href="#use7634" height="1250" width="1250" transform="translate(0,6)" id="use7636" y="0" x="0" /> |
63 | +<use xlink:href="#path10505" height="1250" width="1250" id="use5413" y="0" x="0" style="display:inline" transform="matrix(-1,0,0,-1,-74.00271,364.9954)" /> |
64 | +</g> |
65 | +<g id="selection-shrink-halve" transform="translate(235.0423,-49.96096)" style="display:inline" inkscape:label="#selection_up"> |
66 | +<rect y="175" x="-45" height="16" width="16" id="rect10473" style="color:#000000;fill:none;stroke:none;stroke-width:1;marker:none;display:inline" /> |
67 | +<path style="fill:none;stroke:url(#linearGradient5835);stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none" d="m -43.97588,175.9908 c 4.97368,0 4.97368,0 4.97368,0" id="path10475" /> |
68 | +<rect y="178.46091" x="-44.50185" height="2.002599" width="14.99927" id="rect10479" style="color:#000000;fill:url(#linearGradient5837);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient5839);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline" /> |
69 | +<path style="fill:none;stroke:url(#linearGradient5842);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;display:inline" d="m -44.00221,185.9908 c 7.94048,0 7.94048,0 7.94048,0" id="path10483" /> |
70 | +<use xlink:href="#path10475" height="1250" width="1250" transform="translate(-0.0387999,6.97005)" id="use7634" y="0" x="0" /> |
71 | +<use xlink:href="#use7634" height="1250" width="1250" transform="translate(0,6)" id="use7636" y="0" x="0" /> |
72 | +<use xlink:href="#path10505" height="1250" width="1250" id="use5413" y="0" x="0" style="display:inline" transform="matrix(-1,0,0,-1,-74.00271,364.9954)" /> |
73 | +</g> |
74 | <g id="selection-lower" transform="translate(235.0423,-29.95179)" style="display:inline" inkscape:label="#selection_down"> |
75 | <rect y="175" x="-45" height="16" width="16" id="rect10501" style="color:#000000;fill:none;stroke:none;stroke-width:1;marker:none;display:inline" /> |
76 | <path id="path10505" d="m -42,177.9908 1,0 0,1 -1,0 -3e-6,1 2.000003,0 -2.500003,3 -2.499997,-3 1.999997,0 3e-6,-1 1,-1 z" style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none" sodipodi:nodetypes="ccccccccccc" /> |
77 | |
78 | === modified file 'share/keys/default.xml' |
79 | --- share/keys/default.xml 2011-06-21 09:18:10 +0000 |
80 | +++ share/keys/default.xml 2012-01-08 16:11:23 +0000 |
81 | @@ -365,10 +365,19 @@ |
82 | |
83 | <bind key="Page_Up" action="SelectionRaise" display="true" /> |
84 | <bind key="KP_Page_Up" action="SelectionRaise" /> |
85 | - |
86 | <bind key="Page_Down" action="SelectionLower" display="true" /> |
87 | <bind key="KP_Page_Down" action="SelectionLower" /> |
88 | |
89 | + <bind key="comma" action="SelectionShrink" display="true" /> |
90 | + <bind key="comma" modifiers="Alt" action="SelectionShrinkScreen" /> |
91 | + <bind key="comma" modifiers="Ctrl" action="SelectionShrinkHalve" /> |
92 | + <bind key="period" action="SelectionGrow" display="true" /> |
93 | + <bind key="period" modifiers="Alt" action="SelectionGrowScreen" /> |
94 | + <bind key="period" modifiers="Ctrl" action="SelectionGrowDouble" /> |
95 | + |
96 | + |
97 | + |
98 | + |
99 | <bind key="g" modifiers="Ctrl" action="SelectionGroup" display="true" /> |
100 | <bind key="G" modifiers="Ctrl" action="SelectionGroup" /> |
101 | <bind key="u" modifiers="Ctrl,Shift" action="SelectionGroup" /> |
102 | |
103 | === modified file 'share/keys/inkscape.xml' |
104 | --- share/keys/inkscape.xml 2011-02-21 22:28:50 +0000 |
105 | +++ share/keys/inkscape.xml 2012-01-08 16:11:23 +0000 |
106 | @@ -119,6 +119,9 @@ |
107 | |
108 | <bind action="ArcPrefs" /> |
109 | |
110 | + <bind key="m" action="ToolMeasure" /> |
111 | + <bind key="M" action="ToolMeasure" display="true" /> |
112 | + |
113 | <bind key="F9" modifiers="Shift" action="ToolStar" /> |
114 | <bind key="asterisk" modifiers="Shift" action="ToolStar" /> |
115 | <bind key="asterisk" action="ToolStar" /> |
116 | @@ -362,10 +365,19 @@ |
117 | |
118 | <bind key="Page_Up" action="SelectionRaise" display="true" /> |
119 | <bind key="KP_Page_Up" action="SelectionRaise" /> |
120 | - |
121 | <bind key="Page_Down" action="SelectionLower" display="true" /> |
122 | <bind key="KP_Page_Down" action="SelectionLower" /> |
123 | |
124 | + <bind key="comma" action="SelectionShrink" display="true" /> |
125 | + <bind key="comma" modifiers="Alt" action="SelectionShrinkScreen" /> |
126 | + <bind key="comma" modifiers="Ctrl" action="SelectionShrinkHalve" /> |
127 | + <bind key="period" action="SelectionGrow" display="true" /> |
128 | + <bind key="period" modifiers="Alt" action="SelectionGrowScreen" /> |
129 | + <bind key="period" modifiers="Ctrl" action="SelectionGrowDouble" /> |
130 | + |
131 | + |
132 | + |
133 | + |
134 | <bind key="g" modifiers="Ctrl" action="SelectionGroup" display="true" /> |
135 | <bind key="G" modifiers="Ctrl" action="SelectionGroup" /> |
136 | <bind key="u" modifiers="Ctrl,Shift" action="SelectionGroup" /> |
137 | @@ -589,4 +601,13 @@ |
138 | effect id from the .inx file, for example "org.ekips.filter.addnodes" for the Add |
139 | Nodes effect. --> |
140 | |
141 | + <bind key="g" modifiers="Ctrl,Alt" action="org.inkscape.typography.newglyphlayer" display="true"/> |
142 | + <bind key="G" modifiers="Ctrl,Alt" action="org.inkscape.typography.newglyphlayer"/> |
143 | + |
144 | + <bind key="h" modifiers="Ctrl,Alt" action="org.inkscape.typography.previousglyphlayer" display="true"/> |
145 | + <bind key="H" modifiers="Ctrl,Alt" action="org.inkscape.typography.previousglyphlayer"/> |
146 | + |
147 | + <bind key="j" modifiers="Ctrl,Alt" action="org.inkscape.typography.nextglyphlayer" display="true"/> |
148 | + <bind key="J" modifiers="Ctrl,Alt" action="org.inkscape.typography.nextglyphlayer"/> |
149 | + |
150 | </keys> |
151 | |
152 | === modified file 'share/keys/xara.xml' |
153 | --- share/keys/xara.xml 2007-12-23 21:49:49 +0000 |
154 | +++ share/keys/xara.xml 2012-01-08 16:11:23 +0000 |
155 | @@ -263,13 +263,13 @@ |
156 | <bind key="Z" modifiers="Ctrl" action="EditUndo" display="true"/> |
157 | <bind key="y" modifiers="Ctrl,Shift" action="EditUndo" /> |
158 | <bind key="Y" modifiers="Ctrl,Shift" action="EditUndo" /> |
159 | - <bind key="less" modifiers="Ctrl" action="EditUndo" /> <!-- FIXME: stolen by scaling, redirect that through a verb --> |
160 | - <bind key="comma" modifiers="Ctrl" action="EditUndo" /> <!-- FIXME: stolen by scaling, redirect that through a verb --> |
161 | + <bind key="less" modifiers="Ctrl" action="EditUndo" /> |
162 | + <bind key="comma" modifiers="Ctrl" action="EditUndo" /> |
163 | |
164 | <bind key="y" modifiers="Ctrl" action="EditRedo" display="true"/> |
165 | <bind key="Y" modifiers="Ctrl" action="EditRedo" /> |
166 | - <bind key="greater" modifiers="Ctrl" action="EditRedo" /> <!-- FIXME: stolen by scaling, redirect that through a verb --> |
167 | - <bind key="period" modifiers="Ctrl" action="EditRedo" /> <!-- FIXME: stolen by scaling, redirect that through a verb --> |
168 | + <bind key="greater" modifiers="Ctrl" action="EditRedo" /> |
169 | + <bind key="period" modifiers="Ctrl" action="EditRedo" /> |
170 | |
171 | <bind key="x" modifiers="Ctrl" action="EditCut" display="true"/> |
172 | <bind key="X" modifiers="Ctrl" action="EditCut" /> |
173 | |
174 | === modified file 'src/select-context.cpp' |
175 | --- src/select-context.cpp 2012-01-04 10:32:50 +0000 |
176 | +++ src/select-context.cpp 2012-01-08 16:11:23 +0000 |
177 | @@ -1019,36 +1019,6 @@ |
178 | } |
179 | ret = TRUE; |
180 | break; |
181 | - case GDK_less: |
182 | - case GDK_comma: |
183 | - if (MOD__ALT) { |
184 | - gint mul = 1 + gobble_key_events( |
185 | - get_group0_keyval(&event->key), 0); // with any mask |
186 | - sp_selection_scale_screen(selection, -2*mul); |
187 | - } else if (MOD__CTRL) { |
188 | - sp_selection_scale_times(selection, 0.5); |
189 | - } else { |
190 | - gint mul = 1 + gobble_key_events( |
191 | - get_group0_keyval(&event->key), 0); // with any mask |
192 | - sp_selection_scale(selection, -offset*mul); |
193 | - } |
194 | - ret = TRUE; |
195 | - break; |
196 | - case GDK_greater: |
197 | - case GDK_period: |
198 | - if (MOD__ALT) { |
199 | - gint mul = 1 + gobble_key_events( |
200 | - get_group0_keyval(&event->key), 0); // with any mask |
201 | - sp_selection_scale_screen(selection, 2*mul); |
202 | - } else if (MOD__CTRL) { |
203 | - sp_selection_scale_times(selection, 2); |
204 | - } else { |
205 | - gint mul = 1 + gobble_key_events( |
206 | - get_group0_keyval(&event->key), 0); // with any mask |
207 | - sp_selection_scale(selection, offset*mul); |
208 | - } |
209 | - ret = TRUE; |
210 | - break; |
211 | case GDK_Return: |
212 | if (MOD__CTRL_ONLY) { |
213 | if (selection->singleItem()) { |
214 | |
215 | === modified file 'src/verbs.cpp' |
216 | --- src/verbs.cpp 2012-01-03 12:23:35 +0000 |
217 | +++ src/verbs.cpp 2012-01-08 16:11:23 +0000 |
218 | @@ -1001,6 +1001,7 @@ |
219 | void SelectionVerb::perform(SPAction *action, void *data) |
220 | { |
221 | SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action)); |
222 | + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); |
223 | |
224 | if (!dt) |
225 | return; |
226 | @@ -1057,6 +1058,44 @@ |
227 | sp_selected_path_slice(dt); |
228 | break; |
229 | |
230 | + case SP_VERB_SELECTION_GROW: |
231 | + { // FIXME these and the other grow/shrink they should use gobble_key_events. |
232 | + // the problem is how to get access to which key, if any, to gobble. |
233 | + Inkscape::Selection *selection = sp_desktop_selection(dt); |
234 | + sp_selection_scale(selection, prefs->getDoubleLimited("/options/defaultscale/value", 2, 0, 1000)); |
235 | + break; |
236 | + } |
237 | + case SP_VERB_SELECTION_GROW_SCREEN: |
238 | + { |
239 | + Inkscape::Selection *selection = sp_desktop_selection(dt); |
240 | + sp_selection_scale_screen(selection, 2); |
241 | + break; |
242 | + } |
243 | + case SP_VERB_SELECTION_GROW_DOUBLE: |
244 | + { |
245 | + Inkscape::Selection *selection = sp_desktop_selection(dt); |
246 | + sp_selection_scale_times(selection, 2); |
247 | + break; |
248 | + } |
249 | + case SP_VERB_SELECTION_SHRINK: |
250 | + { |
251 | + Inkscape::Selection *selection = sp_desktop_selection(dt); |
252 | + sp_selection_scale(selection, -prefs->getDoubleLimited("/options/defaultscale/value", 2, 0, 1000)); |
253 | + break; |
254 | + } |
255 | + case SP_VERB_SELECTION_SHRINK_SCREEN: |
256 | + { |
257 | + Inkscape::Selection *selection = sp_desktop_selection(dt); |
258 | + sp_selection_scale_screen(selection, -2); |
259 | + break; |
260 | + } |
261 | + case SP_VERB_SELECTION_SHRINK_HALVE: |
262 | + { |
263 | + Inkscape::Selection *selection = sp_desktop_selection(dt); |
264 | + sp_selection_scale_times(selection, 0.5); |
265 | + break; |
266 | + } |
267 | + |
268 | case SP_VERB_SELECTION_OFFSET: |
269 | sp_selected_path_offset(dt); |
270 | break; |
271 | @@ -1646,6 +1685,7 @@ |
272 | { |
273 | gint mul = 1 + gobble_key_events( |
274 | GDK_KP_Subtract, 0); // with any mask |
275 | + // FIXME what if zoom out is bound to something other than subtract? |
276 | // While drawing with the pen/pencil tool, zoom away from the end of the unfinished path |
277 | if (tools_isactive(dt, TOOLS_FREEHAND_PENCIL) || tools_isactive(dt, TOOLS_FREEHAND_PEN)) { |
278 | SPCurve *rc = SP_DRAW_CONTEXT(ec)->red_curve; |
279 | @@ -2315,6 +2355,18 @@ |
280 | // Advanced tutorial for more info |
281 | new SelectionVerb(SP_VERB_SELECTION_SLICE, "SelectionCutPath", N_("Cut _Path"), |
282 | N_("Cut the bottom path's stroke into pieces, removing fill"), INKSCAPE_ICON("path-cut")), |
283 | + new SelectionVerb(SP_VERB_SELECTION_GROW, "SelectionGrow", N_("_Grow"), |
284 | + N_("Make selected objects bigger"), INKSCAPE_ICON("selection-grow")), |
285 | + new SelectionVerb(SP_VERB_SELECTION_GROW_SCREEN, "SelectionGrowScreen", N_("_Grow on screen"), |
286 | + N_("Make selected objects bigger relative to screen"), INKSCAPE_ICON("selection-grow-screen")), |
287 | + new SelectionVerb(SP_VERB_SELECTION_GROW_DOUBLE, "SelectionGrowDouble", N_("_Double size"), |
288 | + N_("Double the size of selected objects"), INKSCAPE_ICON("selection-grow-double")), |
289 | + new SelectionVerb(SP_VERB_SELECTION_SHRINK, "SelectionShrink", N_("_Shrink"), |
290 | + N_("Make selected objects smaller"), INKSCAPE_ICON("selection-shrink")), |
291 | + new SelectionVerb(SP_VERB_SELECTION_SHRINK_SCREEN, "SelectionShrinkScreen", N_("_Shrink on screen"), |
292 | + N_("Make selected objects smaller relative to screen"), INKSCAPE_ICON("selection-shrink-screen")), |
293 | + new SelectionVerb(SP_VERB_SELECTION_SHRINK_HALVE, "SelectionShrinkHalve", N_("_Halve size"), |
294 | + N_("Halve the size of selected objects"), INKSCAPE_ICON("selection-shrink-halve")), |
295 | // TRANSLATORS: "outset": expand a shape by offsetting the object's path, |
296 | // i.e. by displacing it perpendicular to the path in each point. |
297 | // See also the Advanced Tutorial for explanation. |
298 | |
299 | === modified file 'src/verbs.h' |
300 | --- src/verbs.h 2011-10-25 07:45:35 +0000 |
301 | +++ src/verbs.h 2012-01-08 16:11:23 +0000 |
302 | @@ -111,6 +111,12 @@ |
303 | SP_VERB_SELECTION_SYMDIFF, |
304 | SP_VERB_SELECTION_CUT, |
305 | SP_VERB_SELECTION_SLICE, |
306 | + SP_VERB_SELECTION_GROW, |
307 | + SP_VERB_SELECTION_GROW_SCREEN, |
308 | + SP_VERB_SELECTION_GROW_DOUBLE, |
309 | + SP_VERB_SELECTION_SHRINK, |
310 | + SP_VERB_SELECTION_SHRINK_SCREEN, |
311 | + SP_VERB_SELECTION_SHRINK_HALVE, |
312 | SP_VERB_SELECTION_OFFSET, |
313 | SP_VERB_SELECTION_OFFSET_SCREEN, |
314 | SP_VERB_SELECTION_OFFSET_SCREEN_10, |
I’ve kinda changed my mind about this merge. There are so many hard-coded GDK_key_name all over Inkscape and so many contexts and the verbs file is already super long. My change just adds fuel to the fire (and even so, the code in the switch that I added should be extracted into methods).
Yes, it’s not acceptable that period and comma are clobbered by some builtins (I really want to remap them, they’re right under my good hand as a dvorak user), but OTOH the entire Inkscape shortcut / verb / context / GDK event system is due for a big rethink.
I’ve got some ideas in mind if / when I get more familiar with the code.
I’m thinking of maybe replacing the switches (both in verbs.cpp and in the various contexts) with polymorphic objects, just tear everything out. I don’t know. I’ll start a new branch for it if I feel brave enough.