Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][UX][Tracker] Active Layer Focus shortcuts working with inverted order #1015

Closed
Jose-Moreno opened this issue Jul 10, 2018 · 4 comments

Comments

Projects
None yet
5 participants
@Jose-Moreno
Copy link
Member

commented Jul 10, 2018

--Issue Summary--

In the past Pencil and Pencil2d had an inverse layer order where the top layer was "at the bottom" of the stack and the bottom layer was "at the top" of the stack. This was changed a few years ago, however there still seems to be some left overs from the previous behaviour.

  • [UX] The issue is that using the hard-coded shortcuts UP ARROW and DOWN ARROW, will change the active layer focus in the same manner as before, that is, pressing UP ARROW will move the focus DOWN, and viceversa.
  • [Request] I'd also like to propose to allow the shortcuts to CYCLE through the layers, that is pressing UP ARROW or DOWN ARROW would jump to the top or bottom layer respectively, once it reaches the end of the layer list / array.
  • [Request] Also would like to suggest allowing for that command to be overridden / modifiable in the shortcuts window.

--Expected Results--

Pressing UP ARROW should change the active layer focus UPWARDS, and pressing DOWN ARROW should change the active layer focus DOWNWARDS

--Steps to reproduce--

  1. Open Pencil2D
  2. Default Active layer would be the Bitmap layer. Press the UP ARROW.
  3. Note that the current active layer is the vector layer.
  4. Press the DOWN ARROW. You'll go back to the Bitmap layer.

--System Information--

  • Pencil2D Version:
    Version: 0.6.1.1
    commit: c7803d0
    date: 2018-07-05_20:03:27
    Development build
    Operating System: Windows 7 SP 1 (6.1)
    CPU Architecture: x86_64
@TheNiteCoder

This comment has been minimized.

Copy link

commented Jul 11, 2018

I don't know how to change the layer to what is displayed on the painters widget(the center widget) I also don't know where to include these files(though, I think I will figure it out once I developed the cycle function)

My code:

`void Layer::cycleLayers()
{
//I didn't know how to set the central widget to a layer otherwise I would include code for this

}

void Layer::createCycleActions()
{
cycleUpwards = new QAction; //this creates a action
cycleUpwards->setShortcut(QKeySequence(Qt::Key_Up)); //sets the shortcut to the up arrow
connect(cycleUpwards, &QAction::triggered, this, &Layer::cycleLayers); //if triggered it cycles to the
//next layer

cycleDownwards = new QAction; //same deal just no function created because I don't know how to set 
                                                    //a layer
cycleDownwards->setShortcut(QKeySequence(Qt::Key_Down));
connect(cycleDownwards, &QAction::triggered, this, &Layer::cycleLayers);

}`

edit: Nevermind, I just found it! : )

@CandyFace

This comment has been minimized.

Copy link
Member

commented Jul 12, 2018

@TheNiteCoder
The section that controls whether to select the next or previous layer is here:

void LayerManager::gotoNextLayer()
{
    if (editor()->currentLayerIndex() < object()->getLayerCount() - 1)
    {
        editor()->setCurrentLayerIndex(editor()->currentLayerIndex() + 1);
        Q_EMIT currentLayerChanged(editor()->currentLayerIndex());
    }
}

void LayerManager::gotoPreviouslayer()
{
    if (editor()->currentLayerIndex() > 0)
    {
        editor()->setCurrentLayerIndex(editor()->currentLayerIndex() - 1);
        Q_EMIT currentLayerChanged(editor()->currentLayerIndex());
    }
}
@chchwy

This comment has been minimized.

Copy link
Member

commented Jul 12, 2018

As CandyFace said, the cycling function should go to LayerManager rather than Layer.

@Jose-Moreno Jose-Moreno added this to the hacktoberfest milestone Oct 1, 2018

@scribblemaniac scribblemaniac removed this from the Hacktoberfest 2018 milestone Nov 4, 2018

ryyharris pushed a commit to ryyharris/pencil that referenced this issue Apr 16, 2019

ryyharris pushed a commit to ryyharris/pencil that referenced this issue May 1, 2019

scribblemaniac added a commit that referenced this issue May 11, 2019

@Jose-Moreno Jose-Moreno added this to the 0.6.4 milestone Jun 19, 2019

@Jose-Moreno

This comment has been minimized.

Copy link
Member Author

commented Jun 19, 2019

Even though the main issue was fixed I'll re-issue the unfulfilled enhancement requests to improve the user experience in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.