NEW FEATURE ! Sketcher Tool Settings.

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
paddle
Veteran
Posts: 1412
Joined: Mon Feb 03, 2020 4:47 pm

Re: NEW FEATURE ! Sketcher Tool Settings.

Post by paddle »

chrisb wrote: Thu Jan 13, 2022 9:54 pm The M key is very important, as that's what makes polyline so powerful. See Sketcher Polyline.
That's very nice ! I didn't knew it could do all of that.
Maybe the Polyline icon could have an arc? To make it clearer that the tool can make different geometries. Like this?
Sketcher_CreatePolyline.svg
(14.63 KiB) Downloaded 57 times

So yes that can't be lost, we need a way around that to catch the press of M. Though if user wants to type the unit 'mm' in the spinbox... Could the shortcut changed to another key? Like Ctrl or Alt.
edit: I tried to change the mode key to CTRL but it doesn't work. I guess it's because the view doesn't have the focus?

Code: Select all

if ( (key == SoKeyboardEvent::RIGHT_CONTROL || key == SoKeyboardEvent::LEFT_CONTROL) && pressed && previousCurve != -1) {
chrisb
Veteran
Posts: 54164
Joined: Tue Mar 17, 2015 9:14 am

Re: NEW FEATURE ! Sketcher Tool Settings.

Post by chrisb »

paddle wrote: Fri Jan 14, 2022 10:23 am Maybe the Polyline icon could have an arc?
I suggested that already years ago :), although I had the arc in a different place. I think there are styles having this already.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
paddle
Veteran
Posts: 1412
Joined: Mon Feb 03, 2020 4:47 pm

Re: NEW FEATURE ! Sketcher Tool Settings.

Post by paddle »

chrisb wrote: Fri Jan 14, 2022 12:02 pm
paddle wrote: Fri Jan 14, 2022 10:23 am Maybe the Polyline icon could have an arc?
I suggested that already years ago :), although I had the arc in a different place. I think there are styles having this already.
Why it did not went through then? Was it just forgotten/not done or was it refused?
chrisb
Veteran
Posts: 54164
Joined: Tue Mar 17, 2015 9:14 am

Re: NEW FEATURE ! Sketcher Tool Settings.

Post by chrisb »

I could search for the old discussions, I would start at the time, when I had added the documentation about the M key to the wiki. But I'm afraid this wouldn't lead us further.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54164
Joined: Tue Mar 17, 2015 9:14 am

Re: NEW FEATURE ! Sketcher Tool Settings.

Post by chrisb »

A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
davidosterberg
Posts: 529
Joined: Fri Sep 18, 2020 5:40 pm

Re: NEW FEATURE ! Sketcher Tool Settings.

Post by davidosterberg »

Nice feature. Do you already have a PR? If not I think you should do it. Maybe break it up into several PRs, one for one tool at a time. That way it will be easier to review.
User avatar
paddle
Veteran
Posts: 1412
Joined: Mon Feb 03, 2020 4:47 pm

Re: NEW FEATURE ! Sketcher Tool Settings.

Post by paddle »

So yeah it sounds like it just got forgotten.
I can make the second icon for construction mode too. What is the two other icons? It's for draft workbench and another?
I can make them all based on the icon I posted before. I think it looks quite good in my UI now.
User avatar
paddle
Veteran
Posts: 1412
Joined: Mon Feb 03, 2020 4:47 pm

Re: NEW FEATURE ! Sketcher Tool Settings.

Post by paddle »

davidosterberg wrote: Fri Jan 14, 2022 2:37 pm Nice feature. Do you already have a PR? If not I think you should do it. Maybe break it up into several PRs, one for one tool at a time. That way it will be easier to review.
Yes right I'll make a PR with what is done already. Probably by monday. The time to clean up and check all is ok.
chrisb
Veteran
Posts: 54164
Joined: Tue Mar 17, 2015 9:14 am

Re: NEW FEATURE ! Sketcher Tool Settings.

Post by chrisb »

paddle wrote: Fri Jan 14, 2022 9:38 pm It's for draft workbench and another?
I can make them all based on the icon I posted before. I think it looks quite good in my UI now.
Draft polyline icon should stay as it is. It hasn't the fancy continuation modes.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
paddle
Veteran
Posts: 1412
Joined: Mon Feb 03, 2020 4:47 pm

Re: NEW FEATURE ! Sketcher Tool Settings.

Post by paddle »

Hmm having the focus on the task window actually creates a problem :
pressing escape doesn't close the tool anymore but it closes the sketch edit.

Having a look a ViewProviderSketch :

Code: Select all

bool ViewProviderSketch::keyPressed(bool pressed, int key)
{
    switch (key)
    {
    case SoKeyboardEvent::ESCAPE:
        {
            // make the handler quit but not the edit mode
            if (edit && edit->sketchHandler) {
                if (!pressed)
                    edit->sketchHandler->quit();
                return true;
            }
I think the problem is that when task window has the focus, then edit->sketchHandler is not true. You can see this behavior if you start to draw a circle (first point) then you go to click on the task window to give it the focus, then press escape. It exit the edit of the sketch and not the tool handler.
Post Reply