mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-16 10:20:50 +00:00
Fix Ctrl+Tab (and Ctrl+Shift+Tab) when we have multiple WorkspaceTabs
This commit is contained in:
parent
e6c0353e30
commit
ecc2f06492
@ -13,7 +13,7 @@
|
||||
|
||||
#include "app/app.h"
|
||||
#include "app/ui/main_window.h"
|
||||
#include "app/ui/workspace_tabs.h"
|
||||
#include "app/ui/workspace.h"
|
||||
|
||||
namespace app {
|
||||
|
||||
@ -35,7 +35,7 @@ GotoNextTabCommand::GotoNextTabCommand()
|
||||
|
||||
void GotoNextTabCommand::onExecute(Context* context)
|
||||
{
|
||||
App::instance()->getMainWindow()->getTabsBar()->selectNextTab();
|
||||
App::instance()->getMainWindow()->getWorkspace()->selectNextTab();
|
||||
}
|
||||
|
||||
class GotoPreviousTabCommand : public Command {
|
||||
@ -56,7 +56,7 @@ GotoPreviousTabCommand::GotoPreviousTabCommand()
|
||||
|
||||
void GotoPreviousTabCommand::onExecute(Context* context)
|
||||
{
|
||||
App::instance()->getMainWindow()->getTabsBar()->selectPreviousTab();
|
||||
App::instance()->getMainWindow()->getWorkspace()->selectPreviousTab();
|
||||
}
|
||||
|
||||
Command* CommandFactory::createGotoNextTabCommand()
|
||||
|
@ -106,6 +106,16 @@ void Workspace::setMainPanelAsActive()
|
||||
ActiveViewChanged(); // Fire ActiveViewChanged event
|
||||
}
|
||||
|
||||
void Workspace::selectNextTab()
|
||||
{
|
||||
m_activePanel->tabs()->selectNextTab();
|
||||
}
|
||||
|
||||
void Workspace::selectPreviousTab()
|
||||
{
|
||||
m_activePanel->tabs()->selectPreviousTab();
|
||||
}
|
||||
|
||||
void Workspace::onPaint(PaintEvent& ev)
|
||||
{
|
||||
ev.getGraphics()->fillRect(getBgColor(), getClientBounds());
|
||||
|
@ -40,6 +40,8 @@ namespace app {
|
||||
WorkspaceView* activeView();
|
||||
void setActiveView(WorkspaceView* view);
|
||||
void setMainPanelAsActive();
|
||||
void selectNextTab();
|
||||
void selectPreviousTab();
|
||||
|
||||
// Drop views into workspace
|
||||
void setDropViewPreview(const gfx::Point& pos,
|
||||
|
@ -42,6 +42,7 @@ namespace app {
|
||||
~WorkspacePanel();
|
||||
|
||||
void setTabsBar(WorkspaceTabs* tabs);
|
||||
WorkspaceTabs* tabs() const { return m_tabs; }
|
||||
|
||||
iterator begin() { return m_views.begin(); }
|
||||
iterator end() { return m_views.end(); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user