Repeat last used tool

Issue #241 resolved
Felix Ulber created an issue

What I use alot in different graphics creation applications is the command to re-activate the last used tool. In combination with a shortcut that really speeds up drawing/construction.

Not completely sure how this would be called like - Last Tool is a good thing I think

Comments (20)

  1. Roman Telezhynskyi repo owner

    Can you describe how it is work? Because i understand only part about shortcut.

  2. Felix Ulber reporter

    Simply that I can directly (menu/shortcut) re-activate the tool I used last in construction. Whithout having to click it in the toolbox again.

  3. Felix Ulber reporter

    I think it is not very hard implement. Which shortcut use?

    That's a good question. I have to think about - and maybe others have suggesions. Best would be a single character shortcut, thats my experience from other applications. Are single-key shortcuts intended?

    Btw: A custom shortcut editor would be great (first of all for tools selection). Is something like this planned? Or is there maybe a template for sth. like this in the Qt world?

  4. Roman Telezhynskyi repo owner

    Are single-key shortcuts intended?

    Not sure, but i think yes.

    Btw: A custom shortcut editor would be great (first of all for tools selection). Is something like this planned?

    Never planned such feature.

    Or is there maybe a template for sth. like this in the Qt world?

    Quick look show this article Dynamic Keyboard Shortcuts.

  5. Roman Telezhynskyi repo owner

    @kjaft, do you have time for this issue? Because i can take it for myself. Even if issue not very urgent, but not so difficult and can improve GUI.

  6. Felix Ulber reporter

    hehe, I was just starting with that one. But maybe you're still faster cause you know better - does not matter for me. Currently I am asking myself how it's best done to store the information on the last used tool internally, cause that requires

    1) to the VTool type and

    2) the DialogTool type

    for the call to SetToolButtonWithApply. Or am I wrong here?

  7. Roman Telezhynskyi repo owner

    I can't understand why so difficult. I thought just replace part where we show default ask dialog. Do not need save state for each tool.

    My plan was make something with this method only:

    int VAbstractTool::ConfirmDeletion()
    {
        QMessageBox msgBox;
        msgBox.setText(tr("Confirm the deletion."));
        msgBox.setInformativeText(tr("Do you really want delete?"));
        msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
        msgBox.setDefaultButton(QMessageBox::Ok);
        msgBox.setIcon(QMessageBox::Question);
        return msgBox.exec();
    }
    
  8. Felix Ulber reporter

    sorry Roman, I think you are talking about Issue #235? I wanted to care about this one first and then #235. I am really interested in caring about those, but as I am still diving into the architecture and also need to work "besides" :), I might be slower with it.

  9. Roman Telezhynskyi repo owner

    1) to the VTool type and
    2) the DialogTool type
    for the call to SetToolButtonWithApply. Or am I wrong here?

    We already have variable

    /** @brief tool current tool */
        Tool               tool;
    

    I propose create same variable that will keep last used tool. First value set to Tool::Arrow.
    Then modifier MainWindow::SetToolButtonWithApply and MainWindow::SetToolButton methods.
    Create QAction in Qt Designer. And call it through shortcut. We can use switch case here for call right action method for each tool.
    Aso don't forget about MainWindow::Clear().

  10. Felix Ulber reporter

    Thanks for the hints - overlooked that tool enum. Just to give a status update: got it working, not yet pushing. Stil thinking about which shortcut this should get. Actually it would be great to have one-key shortcuts for all tools (like in gimp/photoshop and other graphics applications-> great work speedup!). This one could also be decided and added later. More to follow.

    There's a small issue that already I already recognized when translating: the cut arc tool is cut spline tool at the moment, fair enough for an arc is only a specialized curve, but that makes it impossible to re-call that tool (and causes e.g. a wrong dialog title). Should we open up a own issue for that?

  11. Roman Telezhynskyi repo owner

    There's a small issue that already I already recognized when translating: the cut arc tool is cut spline tool at the moment, fair enough for an arc is only a specialized curve, but that makes it impossible to re-call >that >tool (and causes e.g. a wrong dialog title).

    I made this by purpose. How you correct mention arc is only a specialized curve. But i don't see why it is make impossible to re-call this tool. For this tool it will be more like restart.

    Should we open up a own issue for that?

    I don't think so.

    Also a question, why do you always make a new fork? Maybe better use Compare button?

  12. Felix Ulber reporter

    nevermind the CutArc thing. It was too late last evening and I was to blind to see the CutArc in the Tool enum...

    Also a question, why do you always make a new fork? Maybe better use Compare button?

    That was cause I commited and pushed something wrong - just for safety, I did not know better. Guess I have to get more firm with bitbucket/hg.

    I saw the dynamic shortcuts arcticle and I find thats definitely something that should make it into valentina. Its just on 3rd place in my ToDo queue :) Nevertheless the default shortcut should be chosen carefully.

  13. Log in to comment