Quick fix: extend object alignment hotkeys to work for nodes
Ctrl-Alt-T - Align selected nodes Horizontal to eachother. Ctrl-Alt-H - Align selected nodes Vertical to eachother.
Quickie, but would really help in making diagrams and quick edits within a shape.
-C
I'd like to help out in this one if I may ...
But I've only added some unit tests to lib2geom so far, and would need some guidance to the Inkscape source code.
Anyone care to be my "mentor" for this task...?
Regards, On 10 Mar 2016 21:04, "C R" <cajhne@...400...> wrote:
Ctrl-Alt-T - Align selected nodes Horizontal to eachother. Ctrl-Alt-H - Align selected nodes Vertical to eachother.
Quickie, but would really help in making diagrams and quick edits within a shape.
-C
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Sure, what do you need ?
How I would proceed :
1/ find the functions associated with those buttons(I'd look at the align dialog (in src/ui/dialog/align-and-distribute.cpp), and find something related to nodes)
2/ find the root handler for node tool (in src/ui/tools/node-tool.cpp)
3/ look at how the other keyboard shortcuts are handled there, and add a check for those shortcuts, with the function found in (1) as effect
You guys are stellar! Thanks! :) -C
On Thu, Mar 10, 2016 at 10:14 PM, Marc Jeanmougin <marc@...3062...> wrote:
Sure, what do you need ?
How I would proceed :
1/ find the functions associated with those buttons(I'd look at the align dialog (in src/ui/dialog/align-and-distribute.cpp), and find something related to nodes)
2/ find the root handler for node tool (in src/ui/tools/node-tool.cpp)
3/ look at how the other keyboard shortcuts are handled there, and add a check for those shortcuts, with the function found in (1) as effect
-- Mc
On 03/10/2016 09:52 PM, Olof Bjarnason wrote:
I'd like to help out in this one if I may ...
But I've only added some unit tests to lib2geom so far, and would need some guidance to the Inkscape source code.
Anyone care to be my "mentor" for this task...?
Regards,
On 10 Mar 2016 21:04, "C R" <cajhne@...400... mailto:cajhne@...400...> wrote:
Ctrl-Alt-T - Align selected nodes Horizontal to eachother. Ctrl-Alt-H - Align selected nodes Vertical to eachother. Quickie, but would really help in making diagrams and quick edits within a shape. -C
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net <mailto:Inkscape-devel@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Thank you Marc, that's a great start...
I read through the dialog .cpp file, and found the addNodeTool method, which is used to build up the node alignment buttons. I noticed there is a member _actionList, that is cleared/deleted in the AlignAndDistribute destructor - does that mean the actions/operations are only available if the alignment dialog is open/visible to the end user?
If that is the case, it's a bit annoying, as I'd like keyboard shortcuts to be available to me regardsless of whether a certain dialog is open or not. I'd say as soon as the node tool is active, the Ctrl+Alt+T/H node alignment shortcuts should be available. C R agree?
We could take the discussion off-list if you think it's too noicy. On 10 Mar 2016 22:15, "Marc Jeanmougin" <marc@...3062...> wrote:
Sure, what do you need ?
How I would proceed :
1/ find the functions associated with those buttons(I'd look at the align dialog (in src/ui/dialog/align-and-distribute.cpp), and find something related to nodes)
2/ find the root handler for node tool (in src/ui/tools/node-tool.cpp)
3/ look at how the other keyboard shortcuts are handled there, and add a check for those shortcuts, with the function found in (1) as effect
-- Mc
On 03/10/2016 09:52 PM, Olof Bjarnason wrote:
I'd like to help out in this one if I may ...
But I've only added some unit tests to lib2geom so far, and would need some guidance to the Inkscape source code.
Anyone care to be my "mentor" for this task...?
Regards,
On 10 Mar 2016 21:04, "C R" <cajhne@...400... mailto:cajhne@...400...> wrote:
Ctrl-Alt-T - Align selected nodes Horizontal to eachother. Ctrl-Alt-H - Align selected nodes Vertical to eachother. Quickie, but would really help in making diagrams and quick edits within a shape. -C
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net <mailto:Inkscape-devel@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
If that is the case, it's a bit annoying, as I'd like keyboard shortcuts to be available to me regardsless of whether a certain dialog is open or not. I'd say as soon as the node tool is active, the Ctrl+Alt+T/H node alignment shortcuts should be available. C R agree?
Yep, that sounds right. Which align functions correspond to the align horizontal and align vertical functions are highly dependant on what is selected. For example if you want to be a super-hero, you could automatically align (vertically) to the baselines of the text if two text objects are selected instead of the current behaviour which simply aligns them as if they were non-text objects. 99 times out of 100 this likely isn't what you want with text, which is why special align options were added to align text baselines. Though you may want to leave the horizontal align alone on text, or to be somewhat god-like you could smartly align them based on whether the selected text/paragraphs are to be centered or not.
Highly context dependent. :)
-C
We could take the discussion off-list if you think it's too noicy. On 10 Mar 2016 22:15, "Marc Jeanmougin" <marc@...3062...> wrote:
Sure, what do you need ?
How I would proceed :
1/ find the functions associated with those buttons(I'd look at the align dialog (in src/ui/dialog/align-and-distribute.cpp), and find something related to nodes)
2/ find the root handler for node tool (in src/ui/tools/node-tool.cpp)
3/ look at how the other keyboard shortcuts are handled there, and add a check for those shortcuts, with the function found in (1) as effect
-- Mc
On 03/10/2016 09:52 PM, Olof Bjarnason wrote:
I'd like to help out in this one if I may ...
But I've only added some unit tests to lib2geom so far, and would need some guidance to the Inkscape source code.
Anyone care to be my "mentor" for this task...?
Regards,
On 10 Mar 2016 21:04, "C R" <cajhne@...400... <mailto:cajhne@...400...
wrote:
Ctrl-Alt-T - Align selected nodes Horizontal to eachother. Ctrl-Alt-H - Align selected nodes Vertical to eachother. Quickie, but would really help in making diagrams and quick edits within a shape. -C
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net <mailto:Inkscape-devel@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
To clarify text alignment thing: (align text vertical hotkey ctrl-alt-T):
Case 1: both selected paragraphs are text-aligned Left Smart Align Vertical : aligns both paragraphs to the left baseline
Case 2: both paragraphs are text-aligned Right Smart Align Vertical : aligns both paragraphs to the right baseline
Case 3: both paragraphs are text-aligned Center Smart Align Vertical : aligns both paragraphs to the center (current default behaviour)
Case 4: both paragraphs are text-aligned Justified Smart Align Vertical : aligns both paragraphs to the Right
Case 5: paragraphs have mismatched text-alignment Smart Align Vertical : aligns both paragraphs to the center (current default behaviour)
-C
On Thu, Mar 10, 2016 at 10:30 PM, C R <cajhne@...400...> wrote:
If that is the case, it's a bit annoying, as I'd like keyboard shortcuts
to be available to me regardsless of whether a certain dialog is open or not. I'd say as soon as the node tool is active, the Ctrl+Alt+T/H node alignment shortcuts should be available. C R agree?
Yep, that sounds right. Which align functions correspond to the align horizontal and align vertical functions are highly dependant on what is selected. For example if you want to be a super-hero, you could automatically align (vertically) to the baselines of the text if two text objects are selected instead of the current behaviour which simply aligns them as if they were non-text objects. 99 times out of 100 this likely isn't what you want with text, which is why special align options were added to align text baselines. Though you may want to leave the horizontal align alone on text, or to be somewhat god-like you could smartly align them based on whether the selected text/paragraphs are to be centered or not.
Highly context dependent. :)
-C
We could take the discussion off-list if you think it's too noicy. On 10 Mar 2016 22:15, "Marc Jeanmougin" <marc@...3062...> wrote:
Sure, what do you need ?
How I would proceed :
1/ find the functions associated with those buttons(I'd look at the align dialog (in src/ui/dialog/align-and-distribute.cpp), and find something related to nodes)
2/ find the root handler for node tool (in src/ui/tools/node-tool.cpp)
3/ look at how the other keyboard shortcuts are handled there, and add a check for those shortcuts, with the function found in (1) as effect
-- Mc
On 03/10/2016 09:52 PM, Olof Bjarnason wrote:
I'd like to help out in this one if I may ...
But I've only added some unit tests to lib2geom so far, and would need some guidance to the Inkscape source code.
Anyone care to be my "mentor" for this task...?
Regards,
On 10 Mar 2016 21:04, "C R" <cajhne@...400... <mailto:cajhne@...400...
wrote:
Ctrl-Alt-T - Align selected nodes Horizontal to eachother. Ctrl-Alt-H - Align selected nodes Vertical to eachother. Quickie, but would really help in making diagrams and quick edits within a shape. -C
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net <mailto:Inkscape-devel@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Er, that should be for Horizontal (ctrl-alt-H), not vertical. It's late. lol
:) -C
On Thu, Mar 10, 2016 at 10:45 PM, C R <cajhne@...400...> wrote:
To clarify text alignment thing: (align text vertical hotkey ctrl-alt-T):
Case 1: both selected paragraphs are text-aligned Left Smart Align Vertical : aligns both paragraphs to the left baseline
Case 2: both paragraphs are text-aligned Right Smart Align Vertical : aligns both paragraphs to the right baseline
Case 3: both paragraphs are text-aligned Center Smart Align Vertical : aligns both paragraphs to the center (current default behaviour)
Case 4: both paragraphs are text-aligned Justified Smart Align Vertical : aligns both paragraphs to the Right
Case 5: paragraphs have mismatched text-alignment Smart Align Vertical : aligns both paragraphs to the center (current default behaviour)
-C
On Thu, Mar 10, 2016 at 10:30 PM, C R <cajhne@...400...> wrote:
If that is the case, it's a bit annoying, as I'd like keyboard shortcuts
to be available to me regardsless of whether a certain dialog is open or not. I'd say as soon as the node tool is active, the Ctrl+Alt+T/H node alignment shortcuts should be available. C R agree?
Yep, that sounds right. Which align functions correspond to the align horizontal and align vertical functions are highly dependant on what is selected. For example if you want to be a super-hero, you could automatically align (vertically) to the baselines of the text if two text objects are selected instead of the current behaviour which simply aligns them as if they were non-text objects. 99 times out of 100 this likely isn't what you want with text, which is why special align options were added to align text baselines. Though you may want to leave the horizontal align alone on text, or to be somewhat god-like you could smartly align them based on whether the selected text/paragraphs are to be centered or not.
Highly context dependent. :)
-C
We could take the discussion off-list if you think it's too noicy. On 10 Mar 2016 22:15, "Marc Jeanmougin" <marc@...3062...> wrote:
Sure, what do you need ?
How I would proceed :
1/ find the functions associated with those buttons(I'd look at the align dialog (in src/ui/dialog/align-and-distribute.cpp), and find something related to nodes)
2/ find the root handler for node tool (in src/ui/tools/node-tool.cpp)
3/ look at how the other keyboard shortcuts are handled there, and add a check for those shortcuts, with the function found in (1) as effect
-- Mc
On 03/10/2016 09:52 PM, Olof Bjarnason wrote:
I'd like to help out in this one if I may ...
But I've only added some unit tests to lib2geom so far, and would need some guidance to the Inkscape source code.
Anyone care to be my "mentor" for this task...?
Regards,
On 10 Mar 2016 21:04, "C R" <cajhne@...400... <mailto:
cajhne@...400...>>
wrote:
Ctrl-Alt-T - Align selected nodes Horizontal to eachother. Ctrl-Alt-H - Align selected nodes Vertical to eachother. Quickie, but would really help in making diagrams and quick edits within a shape. -C
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net <mailto:Inkscape-devel@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
I'm not following you now; I thought you were talking about adding keyboard shortcuts to *node* alignment buttons. How did does text baselines get into the mix?
Regards On 10 Mar 2016 23:45, "C R" <cajhne@...400...> wrote:
To clarify text alignment thing: (align text vertical hotkey ctrl-alt-T):
Case 1: both selected paragraphs are text-aligned Left Smart Align Vertical : aligns both paragraphs to the left baseline
Case 2: both paragraphs are text-aligned Right Smart Align Vertical : aligns both paragraphs to the right baseline
Case 3: both paragraphs are text-aligned Center Smart Align Vertical : aligns both paragraphs to the center (current default behaviour)
Case 4: both paragraphs are text-aligned Justified Smart Align Vertical : aligns both paragraphs to the Right
Case 5: paragraphs have mismatched text-alignment Smart Align Vertical : aligns both paragraphs to the center (current default behaviour)
-C
On Thu, Mar 10, 2016 at 10:30 PM, C R <cajhne@...400...> wrote:
If that is the case, it's a bit annoying, as I'd like keyboard shortcuts
to be available to me regardsless of whether a certain dialog is open or not. I'd say as soon as the node tool is active, the Ctrl+Alt+T/H node alignment shortcuts should be available. C R agree?
Yep, that sounds right. Which align functions correspond to the align horizontal and align vertical functions are highly dependant on what is selected. For example if you want to be a super-hero, you could automatically align (vertically) to the baselines of the text if two text objects are selected instead of the current behaviour which simply aligns them as if they were non-text objects. 99 times out of 100 this likely isn't what you want with text, which is why special align options were added to align text baselines. Though you may want to leave the horizontal align alone on text, or to be somewhat god-like you could smartly align them based on whether the selected text/paragraphs are to be centered or not.
Highly context dependent. :)
-C
We could take the discussion off-list if you think it's too noicy. On 10 Mar 2016 22:15, "Marc Jeanmougin" <marc@...3062...> wrote:
Sure, what do you need ?
How I would proceed :
1/ find the functions associated with those buttons(I'd look at the align dialog (in src/ui/dialog/align-and-distribute.cpp), and find something related to nodes)
2/ find the root handler for node tool (in src/ui/tools/node-tool.cpp)
3/ look at how the other keyboard shortcuts are handled there, and add a check for those shortcuts, with the function found in (1) as effect
-- Mc
On 03/10/2016 09:52 PM, Olof Bjarnason wrote:
I'd like to help out in this one if I may ...
But I've only added some unit tests to lib2geom so far, and would need some guidance to the Inkscape source code.
Anyone care to be my "mentor" for this task...?
Regards,
On 10 Mar 2016 21:04, "C R" <cajhne@...400... <mailto:
cajhne@...400...>>
wrote:
Ctrl-Alt-T - Align selected nodes Horizontal to eachother. Ctrl-Alt-H - Align selected nodes Vertical to eachother. Quickie, but would really help in making diagrams and quick edits within a shape. -C
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net <mailto:Inkscape-devel@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
It just means that the button press itself will be unavailable if there is no dialog.
But when you press the button, what's called is the ActionNode (line 351) which has a conveniently named "on_button_click" method, which calls distributeNodes or alignNodes depending on which button the user pushed.
And those functions are submethods of "nt" which is, very conveniently, the node tool (where we want to activate the kb shortcuts) (that just means they can only work when the node tool is active, which is normal since it's the only tool where we have a selection of nodes).
OK I've dug around a little.
The keyboard shortcuts in node tool, for example Ctrl+A for select all, and Ctrl+H to toggle handle's visibility, are "hard coded" in the source code -- at least that is what it looks like to me.
Simplest possible fix would be to repeat the code row from align-and-distribute.cpp which performs the actual vertical- or horisontal node alignment, and hard-coding the keyboard shortcuts in root_handler of node-tool.
1. Is my assumption that these in-tool shortcuts are hardcoded correct?
2. If it is, is the Control+Alt+T and Control+Alt+H suggested by C R OK with others? To me "Control+Alt+V" makes more sense than "H" as V and H stands for Vertical- and Horisontal flip when selecting objects. Suggestion: Re-use the V, H key pair in this context too. There does not seem to be a collision in node tool for these at least.
3. I'd prefer not hard-coding the keyboard shortcuts, and instead having them as defaults to be modifiable by user. How hard is that to achieve?
4. I love the status bar info of Inscape -- would that be the right place to "document" these shortcuts? Or rather on tooltips of the buttons? Or somewhere else? What about keyboard shortcut documentation?
Mvh
/Olof ----------------- 3-5-åriga småttingar i närheten? Lek & lär siffror och bokstäver via mobilen m.h.a. Alfamem till Android. https://play.google.com/store/search?q=alfamem
On 10 March 2016 at 23:57, Marc Jeanmougin <marc@...3062...> wrote:
It just means that the button press itself will be unavailable if there is no dialog.
But when you press the button, what's called is the ActionNode (line 351) which has a conveniently named "on_button_click" method, which calls distributeNodes or alignNodes depending on which button the user pushed.
And those functions are submethods of "nt" which is, very conveniently, the node tool (where we want to activate the kb shortcuts) (that just means they can only work when the node tool is active, which is normal since it's the only tool where we have a selection of nodes).
-- Mc
On 03/10/2016 10:47 PM, Olof Bjarnason wrote:
Thank you Marc, that's a great start...
I read through the dialog .cpp file, and found the addNodeTool method, which is used to build up the node alignment buttons. I noticed there is a member _actionList, that is cleared/deleted in the AlignAndDistribute destructor - does that mean the actions/operations are only available if the alignment dialog is open/visible to the end user?
If that is the case, it's a bit annoying, as I'd like keyboard shortcuts to be available to me regardsless of whether a certain dialog is open or not. I'd say as soon as the node tool is active, the Ctrl+Alt+T/H node alignment shortcuts should be available. C R agree?
We could take the discussion off-list if you think it's too noicy.
On 10 Mar 2016 22:15, "Marc Jeanmougin" <marc@...3062... mailto:marc@...3062...> wrote:
Sure, what do you need ? How I would proceed : 1/ find the functions associated with those buttons(I'd look at the align dialog (in src/ui/dialog/align-and-distribute.cpp), and find something related to nodes) 2/ find the root handler for node tool (in
src/ui/tools/node-tool.cpp)
3/ look at how the other keyboard shortcuts are handled there, and
add a
check for those shortcuts, with the function found in (1) as effect -- Mc On 03/10/2016 09:52 PM, Olof Bjarnason wrote: > I'd like to help out in this one if I may ... > > But I've only added some unit tests to lib2geom so far, and would
need
> some guidance to the Inkscape source code. > > Anyone care to be my "mentor" for this task...? > > Regards, > > On 10 Mar 2016 21:04, "C R" <cajhne@...400... <mailto:cajhne@...400...> <mailto:cajhne@...400... <mailto:cajhne@...400...>>> > wrote: > > Ctrl-Alt-T - Align selected nodes Horizontal to eachother. > Ctrl-Alt-H - Align selected nodes Vertical to eachother. > > Quickie, but would really help in making diagrams and quick
edits
> within a shape. > > -C > >
> Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. >
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
> _______________________________________________ > Inkscape-devel mailing list > Inkscape-devel@lists.sourceforge.net <mailto:Inkscape-devel@lists.sourceforge.net> > <mailto:Inkscape-devel@lists.sourceforge.net <mailto:Inkscape-devel@lists.sourceforge.net>> > https://lists.sourceforge.net/lists/listinfo/inkscape-devel > > > >
> Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 > > > > _______________________________________________ > Inkscape-devel mailing list > Inkscape-devel@lists.sourceforge.net <mailto:Inkscape-devel@lists.sourceforge.net> > https://lists.sourceforge.net/lists/listinfo/inkscape-devel >
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net <mailto:Inkscape-devel@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Please, don't hardcode shortcuts with more than one modifier (like Ctrl+Alt+<key>) because under Windows they could be used to launch some application so they should always be customizable. Combinations with one or zero modifiers (like Ctrl+<key> or Alt+<key>) are usually application specific so it's not a problem if they are hardcoded, unless it's something weird like Ctrl-V to vertically align nodes :)
Luca
-- View this message in context: http://inkscape.13.x6.nabble.com/Quick-fix-extend-object-alignment-hotkeys-t... Sent from the Inkscape - Dev mailing list archive at Nabble.com.
Yes this is my gut feeling too - not to hard code any keyboard shortcuts because of the collision risk.
But I need a little help on how the custom shortcuts system functions...
E.g. in what source file can I read to learn? On 11 Mar 2016 18:02, "LucaDC" <dicappello@...2144...> wrote:
Please, don't hardcode shortcuts with more than one modifier (like Ctrl+Alt+<key>) because under Windows they could be used to launch some application so they should always be customizable. Combinations with one or zero modifiers (like Ctrl+<key> or Alt+<key>) are usually application specific so it's not a problem if they are hardcoded, unless it's something weird like Ctrl-V to vertically align nodes :)
Luca
-- View this message in context: http://inkscape.13.x6.nabble.com/Quick-fix-extend-object-alignment-hotkeys-t... Sent from the Inkscape - Dev mailing list archive at Nabble.com.
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Ctrl-Alt-V it's already used for paste in place. Ctrl-alt-T is consistent with what is used to align objects. These alignment hotkeys should always be the same imho, regardless of what kind of things you are aligning. :)
-C On 11 Mar 2016 5:10 pm, "Olof Bjarnason" <olof.bjarnason@...400...> wrote:
Yes this is my gut feeling too - not to hard code any keyboard shortcuts because of the collision risk.
But I need a little help on how the custom shortcuts system functions...
E.g. in what source file can I read to learn? On 11 Mar 2016 18:02, "LucaDC" <dicappello@...2144...> wrote:
Please, don't hardcode shortcuts with more than one modifier (like Ctrl+Alt+<key>) because under Windows they could be used to launch some application so they should always be customizable. Combinations with one or zero modifiers (like Ctrl+<key> or Alt+<key>) are usually application specific so it's not a problem if they are hardcoded, unless it's something weird like Ctrl-V to vertically align nodes :)
Luca
-- View this message in context: http://inkscape.13.x6.nabble.com/Quick-fix-extend-object-alignment-hotkeys-t... Sent from the Inkscape - Dev mailing list archive at Nabble.com.
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
OK, but Ctrl-alt-T is used to open up a terminal in vanilla Ubuntu operating systems (I guess it's a Unity Window Managers' setting) and it takes precedence to any application shortcut - I guess that's why I didn't know it had a special meaning in Inkscape ;)
It's quite optimistic to attempt to avoid all collisions across all OSs&WMs, though...
Mvh
/Olof ----------------- 3-5-åriga småttingar i närheten? Lek & lär siffror och bokstäver via mobilen m.h.a. Alfamem till Android. https://play.google.com/store/search?q=alfamem
On 11 March 2016 at 19:04, C R <cajhne@...400...> wrote:
Ctrl-Alt-V it's already used for paste in place. Ctrl-alt-T is consistent with what is used to align objects. These alignment hotkeys should always be the same imho, regardless of what kind of things you are aligning. :)
-C On 11 Mar 2016 5:10 pm, "Olof Bjarnason" <olof.bjarnason@...400...> wrote:
Yes this is my gut feeling too - not to hard code any keyboard shortcuts because of the collision risk.
But I need a little help on how the custom shortcuts system functions...
E.g. in what source file can I read to learn? On 11 Mar 2016 18:02, "LucaDC" <dicappello@...2144...> wrote:
Please, don't hardcode shortcuts with more than one modifier (like Ctrl+Alt+<key>) because under Windows they could be used to launch some application so they should always be customizable. Combinations with one or zero modifiers (like Ctrl+<key> or Alt+<key>) are usually application specific so it's not a problem if they are hardcoded, unless it's something weird like Ctrl-V to vertically align nodes :)
Luca
-- View this message in context: http://inkscape.13.x6.nabble.com/Quick-fix-extend-object-alignment-hotkeys-t... Sent from the Inkscape - Dev mailing list archive at Nabble.com.
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
OK, but Ctrl-alt-T is used to open up a terminal in vanilla Ubuntu
operating systems (I guess it's a Unity Window Managers' setting) and it takes precedence to any application shortcut - I guess that's why I didn't know it had a special meaning in Inkscape ;)
Yes. This is also changeable in the keyboard preferences in Ubuntu, though so it's not killer. When talking about hotkeys, I think people who lean on ctrl-alt-T to summon a terminal will have no problem changing one or the other (Inkscape or Ubuntu).
From a UI perspective the C, V, X keys should always be reserved for
cut/paste actions, since they are universally agreed upon cross-platform and cross application for that purpose, imho. It adds a great deal to the intuitiveness of the program when hotkeys behave in a consistent way.
This is not possible for all hotkeys of course, but considering how often Cut/Paste operations are used it makes sense to expect they do the same thing. They are the first ones you try before going to the applications help documentation or the internet to find out. :)
It's quite optimistic to attempt to avoid all collisions across all OSs&WMs, though...
Oh definitely, and you certainly can't avoid all of them. This highlights the importance of making them user changeable whenever possible.
Ctrl-Alt-T is the convention used by the folks who did the original hotkey combos for Align Vertical operation. If we change one, we should change both for consistency. To make life easier, I say we just continue that convention for the time being. Changing the other may require a vote, since it's not new code.
Mvh
/Olof
3-5-åriga småttingar i närheten? Lek & lär siffror och bokstäver via mobilen m.h.a. Alfamem till Android. https://play.google.com/store/search?q=alfamem
On 11 March 2016 at 19:04, C R <cajhne@...400...> wrote:
Ctrl-Alt-V it's already used for paste in place. Ctrl-alt-T is consistent with what is used to align objects. These alignment hotkeys should always be the same imho, regardless of what kind of things you are aligning. :)
-C On 11 Mar 2016 5:10 pm, "Olof Bjarnason" <olof.bjarnason@...400...> wrote:
Yes this is my gut feeling too - not to hard code any keyboard shortcuts because of the collision risk.
But I need a little help on how the custom shortcuts system functions...
E.g. in what source file can I read to learn? On 11 Mar 2016 18:02, "LucaDC" <dicappello@...2144...> wrote:
Please, don't hardcode shortcuts with more than one modifier (like Ctrl+Alt+<key>) because under Windows they could be used to launch some application so they should always be customizable. Combinations with one or zero modifiers (like Ctrl+<key> or Alt+<key>) are usually application specific so it's not a problem if they are hardcoded, unless it's something weird like Ctrl-V to vertically align nodes :)
Luca
-- View this message in context: http://inkscape.13.x6.nabble.com/Quick-fix-extend-object-alignment-hotkeys-t... Sent from the Inkscape - Dev mailing list archive at Nabble.com.
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Those shortcuts already work on the whole objects in the node tool (even if the alignanddistributepanel does not show the buttons).
There is a choice to be made between: - either the current situation should be kept (those shortcuts/verbs should work the same (aligning whole objects) at all times) - either the shortcut aligning objects should align nodes in node tool
Those shortcuts already work on the whole objects in the node tool (even if the alignanddistributepanel does not show the buttons).
Huh, never noticed that. It's correct: If you have two objects selected, and are editing both objects at once using the node tool, the align hotkeys align both shapes regardless of what nodes are selected.
This is an error imho. While in node editing mode it makes sense to leave the parent objects alone (since that's a select tool alignment operation).
There is a choice to be made between:
- either the current situation should be kept (those shortcuts/verbs
should work the same (aligning whole objects) at all times)
- either the shortcut aligning objects should align nodes in node tool
The same hotkeys for aligning objects in Select Tool mode should align nodes in Node tool mode. This is the most intuitive way to handle it. If the user wants to align shapes with hotkeys they would have already done so in select mode. I'd keep node tool mode for editing nodes, and link alignment hotkeys accordingly.
-C
-- Mc
On 03/11/2016 07:04 PM, C R wrote:
Ctrl-Alt-V it's already used for paste in place. Ctrl-alt-T is consistent with what is used to align objects. These alignment hotkeys should always be the same imho, regardless of what kind of things you are aligning. :)
-C
On 11 Mar 2016 5:10 pm, "Olof Bjarnason" <olof.bjarnason@...400... mailto:olof.bjarnason@...400...> wrote:
Yes this is my gut feeling too - not to hard code any keyboard shortcuts because of the collision risk. But I need a little help on how the custom shortcuts system
functions...
E.g. in what source file can I read to learn? On 11 Mar 2016 18:02, "LucaDC" <dicappello@...2144... <mailto:dicappello@...2144...>> wrote: Please, don't hardcode shortcuts with more than one modifier
(like
Ctrl+Alt+<key>) because under Windows they could be used to launch some application so they should always be customizable. Combinations with one or zero modifiers (like Ctrl+<key> or Alt+<key>) are usually application specific so it's not a problem if they are hardcoded, unless it's something weird like Ctrl-V to vertically align
nodes :)
Luca -- View this message in context:
http://inkscape.13.x6.nabble.com/Quick-fix-extend-object-alignment-hotkeys-t...
Sent from the Inkscape - Dev mailing list archive at Nabble.com.
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net <mailto:Inkscape-devel@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net <mailto:Inkscape-devel@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Mvh
/Olof ----------------- 3-5-åriga småttingar i närheten? Lek & lär siffror och bokstäver via mobilen m.h.a. Alfamem till Android. https://play.google.com/store/search?q=alfamem
On 12 March 2016 at 10:44, C R <cajhne@...400...> wrote:
Those shortcuts already work on the whole objects in the node tool (even
if the alignanddistributepanel does not show the buttons).
Huh, never noticed that. It's correct: If you have two objects selected, and are editing both objects at once using the node tool, the align hotkeys align both shapes regardless of what nodes are selected.
This is an error imho. While in node editing mode it makes sense to leave the parent objects alone (since that's a select tool alignment operation).
I didn't know this either, and it surprises me; once in the node tool, moving around objects seems "wrong" - after all this is not the select tool!
There is a choice to be made between:
- either the current situation should be kept (those shortcuts/verbs
should work the same (aligning whole objects) at all times)
- either the shortcut aligning objects should align nodes in node tool
The same hotkeys for aligning objects in Select Tool mode should align nodes in Node tool mode. This is the most intuitive way to handle it. If the user wants to align shapes with hotkeys they would have already done so in select mode. I'd keep node tool mode for editing nodes, and link alignment hotkeys accordingly.
I agree with C R on this - having the same "verb" / shortcut for the same concept (aligning center or middle) for both select tool and node tool makes sense.
Unless someone has a really good reason this is what I'm looking into...
-C
-- Mc
On 03/11/2016 07:04 PM, C R wrote:
Ctrl-Alt-V it's already used for paste in place. Ctrl-alt-T is consistent with what is used to align objects. These alignment hotkeys should always be the same imho, regardless of what kind of things you are aligning. :)
-C
On 11 Mar 2016 5:10 pm, "Olof Bjarnason" <olof.bjarnason@...400... mailto:olof.bjarnason@...400...> wrote:
Yes this is my gut feeling too - not to hard code any keyboard shortcuts because of the collision risk. But I need a little help on how the custom shortcuts system
functions...
E.g. in what source file can I read to learn? On 11 Mar 2016 18:02, "LucaDC" <dicappello@...2144... <mailto:dicappello@...2144...>> wrote: Please, don't hardcode shortcuts with more than one modifier
(like
Ctrl+Alt+<key>) because under Windows they could be used to launch some application so they should always be customizable. Combinations with one or zero modifiers (like Ctrl+<key> or Alt+<key>) are usually application specific so it's not a problem if they are hardcoded, unless it's something weird like Ctrl-V to vertically align
nodes :)
Luca -- View this message in context:
http://inkscape.13.x6.nabble.com/Quick-fix-extend-object-alignment-hotkeys-t...
Sent from the Inkscape - Dev mailing list archive at Nabble.com.
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
_______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net <mailto:Inkscape-devel@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net <mailto:Inkscape-devel@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
participants (4)
-
C R
-
LucaDC
-
Marc Jeanmougin
-
Olof Bjarnason