Page 2 of 7

Re: NEW FEATURE ! Sketcher Tool Settings.

Posted: Fri Jan 14, 2022 10:23 am
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 56 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) {

Re: NEW FEATURE ! Sketcher Tool Settings.

Posted: Fri Jan 14, 2022 12:02 pm
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.

Re: NEW FEATURE ! Sketcher Tool Settings.

Posted: Fri Jan 14, 2022 1:05 pm
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?

Re: NEW FEATURE ! Sketcher Tool Settings.

Posted: Fri Jan 14, 2022 2:13 pm
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.

Re: NEW FEATURE ! Sketcher Tool Settings.

Posted: Fri Jan 14, 2022 2:24 pm
by chrisb

Re: NEW FEATURE ! Sketcher Tool Settings.

Posted: Fri Jan 14, 2022 2:37 pm
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.

Re: NEW FEATURE ! Sketcher Tool Settings.

Posted: Fri Jan 14, 2022 9:38 pm
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.

Re: NEW FEATURE ! Sketcher Tool Settings.

Posted: Fri Jan 14, 2022 9:41 pm
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.

Re: NEW FEATURE ! Sketcher Tool Settings.

Posted: Sat Jan 15, 2022 1:03 am
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.

Re: NEW FEATURE ! Sketcher Tool Settings.

Posted: Sat Jan 15, 2022 2:12 pm
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.