[MERGED] Some shortcuts should be verified
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
- Shalmeneser
- Veteran
- Posts: 9560
- Joined: Wed Dec 23, 2020 12:04 am
- Location: Fr
Re: [IN DEVELOPMENT] Some shortcuts should be verified
Do not play me escape game.
Re: [IN DEVELOPMENT] Some shortcuts should be verified
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [IN DEVELOPMENT] Some shortcuts should be verified
I have been reflecting and the usage argument for horizontal and vertical datums I find compelling due to its high usage. So "I" will be vertical distance constraint, and "L" will be horizontal distance constraint (see M4X post, due to the "similarity", though the "L" does have a vertical and a horizontal segments, but one can remember that the I only has one...)
The currently selected radius tool will be assigned "R". This does not interfere with those who want to use a specific radius/diameter/smart tool for a specific situation, but it enables a normal user to select once the flavour he wants to use and then trigger that with "R".
I will be committing this today. Any feedback or change request is welcome.
EDIT: And I invite you to start using the keyboard shortcuts. It is important for your health. I only used some, but now I will be starting to use many of them
The currently selected radius tool will be assigned "R". This does not interfere with those who want to use a specific radius/diameter/smart tool for a specific situation, but it enables a normal user to select once the flavour he wants to use and then trigger that with "R".
I will be committing this today. Any feedback or change request is welcome.
EDIT: And I invite you to start using the keyboard shortcuts. It is important for your health. I only used some, but now I will be starting to use many of them
Re: [IN DEVELOPMENT] Some shortcuts should be verified
git commit 0926a4148bcff11249fd4f56bc30256102ffe105
Re: [IN DEVELOPMENT] Some shortcuts should be verified
Just in time for the next weekly. Thanks!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [IN DEVELOPMENT] Some shortcuts should be verified
Very nice! This makes me notice a peripheral bug, however -- the tools that have option drop-downs don't list the keyboard shortcuts in their tooltip (e.g. circle, rectangle, b-spline). Presumably this has to do with how the Command is being created, or maybe just an oversight in the new tooltip-generation code.
Re: [IN DEVELOPMENT] Some shortcuts should be verified
Really nice catch!chennes wrote: ↑Sat Oct 16, 2021 5:07 pm Very nice! This makes me notice a peripheral bug, however -- the tools that have option drop-downs don't list the keyboard shortcuts in their tooltip (e.g. circle, rectangle, b-spline). Presumably this has to do with how the Command is being created, or maybe just an oversight in the new tooltip-generation code.
This has to do with:
1. When a Gui::Action (or Gui::ActionGroup) is created passing as parameter one command, the shortcut of the command is not set as the shortcut of the action (which probably is intentional, I did not investigate enough).
2. Then Command has a function applyCommandData(context, pcAction), which updates the action with data from the command. This function is responsible for creating the tooltip, calling recreateTooltip(context, pcAction).
3. This recreateToolTip takes the shortcut from the action, not from the command, which in our case is empty.
The obvious fix (which generates the tooltip correctly), is to assign the shortcut to the action (see the commented out line):
However, this might not be the right way.Gui::Action * CmdSketcherCompConstrainRadDia::createAction(void)
{
Gui::ActionGroup* pcAction = new Gui::ActionGroup(this, Gui::getMainWindow());
pcAction->setDropDownMenu(true);
//pcAction->setShortcut(QString::fromLatin1(this->getAccel()));
applyCommandData(this->className(), pcAction);
If this was generally intended, I would have expected that the constructors of Gui::Action or Gui::ActionGroup would take this into account and assign the shortcut directly. It could be that this was not seen when coding it, or that there is some interference that was being avoided by not assigning it.
If the latter, what is shown above as code would also cause the same "interference".
It is a matter needing some further investigation. I do not know if you feel like taking a look...
Re: [IN DEVELOPMENT] Some shortcuts should be verified
I am happy to do so, I think I'm the one who merged the "recreateTooltip" PR, so I've recently reviewed that code: however, I am in the middle of a large change to Addon Manager, so if may be a week or two before I can get to it. If you (or someone else!) beat me to it I won't feel bad .
Re: [IN DEVELOPMENT] Some shortcuts should be verified
FWIW this was recently fixed/worked-around for the Draft WB: https://github.com/FreeCAD/FreeCAD/pull/5072.