From 7d08f6e97e57732c94835f536f2efa9e008d7cb6 Mon Sep 17 00:00:00 2001 From: shun_iwasawa Date: Nov 02 2016 06:32:21 +0000 Subject: small fixes and change default shortcuts --- diff --git a/stuff/profiles/layouts/shortcuts/defopentoonz.ini b/stuff/profiles/layouts/shortcuts/defopentoonz.ini index ebb88c6..27ec312 100644 --- a/stuff/profiles/layouts/shortcuts/defopentoonz.ini +++ b/stuff/profiles/layouts/shortcuts/defopentoonz.ini @@ -188,7 +188,7 @@ MI_NextDrawing=. MI_NextFrame=Shift+. MI_NextStep= MI_NoShift= -MI_OpacityCheck=1 +MI_OpacityCheck=Alt+1 MI_OpenBatchServers= MI_OpenChild= MI_OpenCleanupSettings= @@ -359,8 +359,8 @@ T_Tape=T T_Tracker= T_Type=Y T_Zoom=Shift+Space -T_ZoomFit=9 -T_ZoomReset=0 +T_ZoomFit=Alt+9 +T_ZoomReset=Alt+0 T_Zoomin=+ T_Zoomout=- MI_LoadRecentImage= diff --git a/stuff/profiles/layouts/shortcuts/otharmony.ini b/stuff/profiles/layouts/shortcuts/otharmony.ini index 8464172..3675e6d 100644 --- a/stuff/profiles/layouts/shortcuts/otharmony.ini +++ b/stuff/profiles/layouts/shortcuts/otharmony.ini @@ -54,8 +54,8 @@ T_Tape=Alt+C T_Type=Alt+9 T_Zoom=Alt+Z T_ZoomReset= -T_Zoomin=2 -T_Zoomout=1 +T_Zoomin=Alt+2 +T_Zoomout=Alt+1 A_DecreaseBrushHardness= A_DecreaseMaxBrushThickness= A_DecreaseMinBrushThickness= @@ -143,7 +143,7 @@ MI_CloneChild= MI_CloneLevel= MI_ClonePreview= MI_CloseChild= -MI_Collapse=0 +MI_Collapse=Alt+0 MI_CollectAssets= MI_CompareToSnapshot= MI_ConvertFileWithInput= diff --git a/toonz/sources/toonz/CMakeLists.txt b/toonz/sources/toonz/CMakeLists.txt index 1d2b21d..c6849a1 100644 --- a/toonz/sources/toonz/CMakeLists.txt +++ b/toonz/sources/toonz/CMakeLists.txt @@ -142,7 +142,7 @@ set(MOC_HEADERS cleanupsettingspane.h penciltestpopup.h locatorpopup.h - styleshortcutselectivepanel.h + styleshortcutswitchablepanel.h # Tracker file dummyprocessor.h metnum.h @@ -303,7 +303,7 @@ set(SOURCES cleanupsettingspane.cpp penciltestpopup.cpp locatorpopup.cpp - styleshortcutselectivepanel.cpp + styleshortcutswitchablepanel.cpp # Tracker file dummyprocessor.cpp metnum.cpp diff --git a/toonz/sources/toonz/comboviewerpane.cpp b/toonz/sources/toonz/comboviewerpane.cpp index 325f01a..c592005 100644 --- a/toonz/sources/toonz/comboviewerpane.cpp +++ b/toonz/sources/toonz/comboviewerpane.cpp @@ -86,7 +86,7 @@ ComboViewerPanel::ComboViewerPanel(QWidget *parent, Qt::WindowFlags flags) #else ComboViewerPanel::ComboViewerPanel(QWidget *parent, Qt::WFlags flags) #endif - : StyleShortcutSelectivePanel(parent) { + : StyleShortcutSwitchablePanel(parent) { TApp *app = TApp::instance(); QFrame *hbox = new QFrame(this); @@ -103,7 +103,7 @@ ComboViewerPanel::ComboViewerPanel(QWidget *parent, Qt::WFlags flags) ImageUtils::FullScreenWidget *fsWidget = new ImageUtils::FullScreenWidget(this); fsWidget->setWidget(m_sceneViewer = new SceneViewer(fsWidget)); - m_sceneViewer->setIsStyleShortcutSelective(); + m_sceneViewer->setIsStyleShortcutSwitchable(); #if defined(Q_OS_WIN) && (QT_VERSION >= 0x050500) && (QT_VERSION < 0x050600) // Workaround for QTBUG-48288 @@ -341,7 +341,7 @@ ComboViewerPanel::~ComboViewerPanel() { //----------------------------------------------------------------------------- void ComboViewerPanel::showEvent(QShowEvent *event) { - StyleShortcutSelectivePanel::showEvent(event); + StyleShortcutSwitchablePanel::showEvent(event); TApp *app = TApp::instance(); TFrameHandle *frameHandle = app->getCurrentFrame(); TSceneHandle *sceneHandle = app->getCurrentScene(); @@ -406,7 +406,7 @@ void ComboViewerPanel::showEvent(QShowEvent *event) { //----------------------------------------------------------------------------- void ComboViewerPanel::hideEvent(QHideEvent *event) { - StyleShortcutSelectivePanel::hideEvent(event); + StyleShortcutSwitchablePanel::hideEvent(event); TApp *app = TApp::instance(); disconnect(app->getCurrentScene()); disconnect(app->getCurrentLevel()); @@ -791,5 +791,5 @@ void ComboViewerPanel::onPreferenceChanged(const QString &prefName) { prefName.isEmpty()) m_flipConsole->onPreferenceChanged(); - StyleShortcutSelectivePanel::onPreferenceChanged(prefName); + StyleShortcutSwitchablePanel::onPreferenceChanged(prefName); } diff --git a/toonz/sources/toonz/comboviewerpane.h b/toonz/sources/toonz/comboviewerpane.h index e836830..d7f2ea0 100644 --- a/toonz/sources/toonz/comboviewerpane.h +++ b/toonz/sources/toonz/comboviewerpane.h @@ -3,7 +3,7 @@ #ifndef COMBOVIEWER_PANE_INCLUDED #define COMBOVIEWER_PANE_INCLUDED -#include "styleshortcutselectivepanel.h" +#include "styleshortcutswitchablepanel.h" #include "sceneviewer.h" #include "toonzqt/intfield.h" #include "toonzqt/keyframenavigator.h" @@ -37,7 +37,7 @@ enum CV_Parts { }; //----------------------------------------------------------------------------- -class ComboViewerPanel final : public StyleShortcutSelectivePanel, +class ComboViewerPanel final : public StyleShortcutSwitchablePanel, public FlipConsoleOwner { Q_OBJECT diff --git a/toonz/sources/toonz/mainwindow.cpp b/toonz/sources/toonz/mainwindow.cpp index afca011..23c7403 100644 --- a/toonz/sources/toonz/mainwindow.cpp +++ b/toonz/sources/toonz/mainwindow.cpp @@ -1689,7 +1689,7 @@ void MainWindow::defineActions() { MenuScanCleanupCommandType); CameraTestCheck::instance()->setToggle(toggle); - createToggle(MI_OpacityCheck, tr("&Opacity Check"), "1", false, + createToggle(MI_OpacityCheck, tr("&Opacity Check"), "Alt+1", false, MenuScanCleanupCommandType); createMenuScanCleanupAction(MI_Cleanup, tr("&Cleanup"), ""); @@ -2047,8 +2047,8 @@ void MainWindow::defineActions() { createViewerAction(V_ZoomIn, tr("Zoom In"), "+"); createViewerAction(V_ZoomOut, tr("Zoom Out"), "-"); - createViewerAction(V_ZoomReset, tr("Reset View"), "0"); - createViewerAction(V_ZoomFit, tr("Fit to Window"), "9"); + createViewerAction(V_ZoomReset, tr("Reset View"), "Alt+0"); + createViewerAction(V_ZoomFit, tr("Fit to Window"), "Alt+9"); createViewerAction(V_ActualPixelSize, tr("Actual Pixel Size"), "N"); createViewerAction(V_ShowHideFullScreen, tr("Show//Hide Full Screen"), "Alt+F"); diff --git a/toonz/sources/toonz/sceneviewer.h b/toonz/sources/toonz/sceneviewer.h index 1362f66..10276dc 100644 --- a/toonz/sources/toonz/sceneviewer.h +++ b/toonz/sources/toonz/sceneviewer.h @@ -138,7 +138,7 @@ class SceneViewer final : public QGLWidget, LocatorPopup *m_locator; bool m_isLocator; - bool m_isStyleShortcutSelective; + bool m_isStyleShortcutSwitchable; // iwsw commented out temporarily // Ghibli3DLutUtil * m_ghibli3DLutUtil; @@ -236,7 +236,7 @@ public: void setFocus(Qt::FocusReason reason) { QWidget::setFocus(reason); }; void setIsLocator() { m_isLocator = true; } - void setIsStyleShortcutSelective() { m_isStyleShortcutSelective = true; } + void setIsStyleShortcutSwitchable() { m_isStyleShortcutSwitchable = true; } public: // SceneViewer's gadget public functions diff --git a/toonz/sources/toonz/sceneviewerevents.cpp b/toonz/sources/toonz/sceneviewerevents.cpp index c7270fd..fbaea5e 100644 --- a/toonz/sources/toonz/sceneviewerevents.cpp +++ b/toonz/sources/toonz/sceneviewerevents.cpp @@ -775,10 +775,11 @@ void SceneViewer::keyPressEvent(QKeyEvent *event) { // If this object is child of Viewer or ComboViewer // (m_isStyleShortcutSelective = true), // then consider about shortcut for the current style selection. - if (m_isStyleShortcutSelective && + if (m_isStyleShortcutSwitchable && Preferences::instance()->isUseNumpadForSwitchingStylesEnabled() && - (!isTextToolActive) && ((Qt::Key_0 <= key && key <= Qt::Key_9) || - key == Qt::Key_Tab || key == Qt::Key_Backtab)) { + (!isTextToolActive) && event->modifiers() == Qt::NoModifier && + ((Qt::Key_0 <= key && key <= Qt::Key_9) || key == Qt::Key_Tab || + key == Qt::Key_Backtab)) { event->ignore(); return; } diff --git a/toonz/sources/toonz/styleshortcutselectivepanel.cpp b/toonz/sources/toonz/styleshortcutselectivepanel.cpp deleted file mode 100644 index 57b1fab..0000000 --- a/toonz/sources/toonz/styleshortcutselectivepanel.cpp +++ /dev/null @@ -1,109 +0,0 @@ -#include "styleshortcutselectivepanel.h" - -// TnzLib includes -#include "toonz/tscenehandle.h" -#include "toonz/preferences.h" -#include "toonz/palettecontroller.h" -#include "toonz/tpalettehandle.h" - -// TnzTools includes -#include "tools/toolhandle.h" -#include "tools/toolcommandids.h" - -// TnzQt includes -#include "toonzqt/tselectionhandle.h" -#include "toonzqt/styleselection.h" - -// Tnz6 includes -#include "tapp.h" - -#include - -//----------------------------------------------------------------------------- - -void StyleShortcutSelectivePanel::keyPressEvent(QKeyEvent *event) { - if (!Preferences::instance()->isUseNumpadForSwitchingStylesEnabled()) return; - TTool *tool = TApp::instance()->getCurrentTool()->getTool(); - if (!tool) return; - if (tool->getName() == T_Type && tool->isActive()) return; - - int key = event->key(); - if (Qt::Key_0 <= key && key <= Qt::Key_9) { - TPaletteHandle *ph = - TApp::instance()->getPaletteController()->getCurrentLevelPalette(); - - TPalette *palette = ph->getPalette(); - if (palette) { - int styleId = palette->getShortcutValue(key); - if (styleId >= 0) { - ph->setStyleIndex(styleId); - TStyleSelection *selection = dynamic_cast( - TApp::instance()->getCurrentSelection()->getSelection()); - if (selection) selection->selectNone(); - } - } - event->accept(); - } else if (key == Qt::Key_Tab || key == Qt::Key_Backtab) { - TPaletteHandle *ph = - TApp::instance()->getPaletteController()->getCurrentLevelPalette(); - - TPalette *palette = ph->getPalette(); - if (palette) { - palette->nextShortcutScope(key == Qt::Key_Backtab); - ph->notifyPaletteChanged(); - } - event->accept(); - } -} - -//----------------------------------------------------------------------------- - -void StyleShortcutSelectivePanel::showEvent(QShowEvent *event) { - TPanel::showEvent(event); - bool ret = connect(TApp::instance()->getCurrentScene(), - SIGNAL(preferenceChanged(const QString &)), this, - SLOT(onPreferenceChanged(const QString &))); - onPreferenceChanged(""); - assert(ret); -} - -//----------------------------------------------------------------------------- - -void StyleShortcutSelectivePanel::hideEvent(QHideEvent *event) { - TPanel::hideEvent(event); - disconnect(TApp::instance()->getCurrentScene(), - SIGNAL(preferenceChanged(const QString &)), this, - SLOT(onPreferenceChanged(const QString &))); -} - -//----------------------------------------------------------------------------- - -void StyleShortcutSelectivePanel::onPreferenceChanged(const QString &prefName) { - if (prefName == "NumpadForSwitchingStyles" || prefName.isEmpty()) - updateTabFocus(); -} - -//----------------------------------------------------------------------------- - -void StyleShortcutSelectivePanel::updateTabFocus() { - QList widgets = findChildren(); - if (Preferences::instance()->isUseNumpadForSwitchingStylesEnabled()) { - // disable tab focus - foreach (QWidget *widget, widgets) { - Qt::FocusPolicy policy = widget->focusPolicy(); - if (policy == Qt::TabFocus || policy == Qt::StrongFocus || - policy == Qt::WheelFocus) { - m_childrenFocusPolicies[widget] = policy; - widget->setFocusPolicy((policy == Qt::TabFocus) ? Qt::NoFocus - : Qt::ClickFocus); - } - } - } else { - // revert tab focus - QHashIterator i(m_childrenFocusPolicies); - while (i.hasNext()) { - i.next(); - i.key()->setFocusPolicy(i.value()); - } - } -} \ No newline at end of file diff --git a/toonz/sources/toonz/styleshortcutselectivepanel.h b/toonz/sources/toonz/styleshortcutselectivepanel.h deleted file mode 100644 index cacf5ce..0000000 --- a/toonz/sources/toonz/styleshortcutselectivepanel.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#ifndef STYLE_SHORTCUT_SELECTIVE_PANEL_H -#define STYLE_SHORTCUT_SELECTIVE_PANEL_H - -#include "pane.h" - -//============================================================================= -// StyleShortcutSelectivePanel -//----------------------------------------------------------------------------- -// StyleShortcutSelectivePanel class is inherited by panels which can select -// the current style by 0-9 number keys if the Preferences option -// "Use Numpad and Tab keys for Switching Styles" is active. -// Currently inherited by ComboViewer, Viewer and Palette -//----------------------------------------------------------------------------- - -class StyleShortcutSelectivePanel : public TPanel { - Q_OBJECT - - QHash m_childrenFocusPolicies; - -public: - StyleShortcutSelectivePanel( - QWidget *parent = 0, Qt::WindowFlags flags = 0, - TDockWidget::Orientation orientation = TDockWidget::vertical) - : TPanel(parent, flags, orientation) {} - -protected: - void keyPressEvent(QKeyEvent *event) override; - void showEvent(QShowEvent *) override; - void hideEvent(QHideEvent *) override; - -protected slots: - virtual void onPreferenceChanged(const QString &prefName); - void updateTabFocus(); -}; - -#endif \ No newline at end of file diff --git a/toonz/sources/toonz/styleshortcutswitchablepanel.cpp b/toonz/sources/toonz/styleshortcutswitchablepanel.cpp new file mode 100644 index 0000000..4b8ada4 --- /dev/null +++ b/toonz/sources/toonz/styleshortcutswitchablepanel.cpp @@ -0,0 +1,110 @@ +#include "styleshortcutswitchablepanel.h" + +// TnzLib includes +#include "toonz/tscenehandle.h" +#include "toonz/preferences.h" +#include "toonz/palettecontroller.h" +#include "toonz/tpalettehandle.h" + +// TnzTools includes +#include "tools/toolhandle.h" +#include "tools/toolcommandids.h" + +// TnzQt includes +#include "toonzqt/tselectionhandle.h" +#include "toonzqt/styleselection.h" + +// Tnz6 includes +#include "tapp.h" + +#include + +//----------------------------------------------------------------------------- + +void StyleShortcutSwitchablePanel::keyPressEvent(QKeyEvent *event) { + if (!Preferences::instance()->isUseNumpadForSwitchingStylesEnabled()) return; + TTool *tool = TApp::instance()->getCurrentTool()->getTool(); + if (!tool) return; + if (tool->getName() == T_Type && tool->isActive()) return; + if (event->modifiers() != Qt::NoModifier) return; + int key = event->key(); + if (Qt::Key_0 <= key && key <= Qt::Key_9) { + TPaletteHandle *ph = + TApp::instance()->getPaletteController()->getCurrentLevelPalette(); + + TPalette *palette = ph->getPalette(); + if (palette) { + int styleId = palette->getShortcutValue(key); + if (styleId >= 0) { + ph->setStyleIndex(styleId); + TStyleSelection *selection = dynamic_cast( + TApp::instance()->getCurrentSelection()->getSelection()); + if (selection) selection->selectNone(); + } + } + event->accept(); + } else if (key == Qt::Key_Tab || key == Qt::Key_Backtab) { + TPaletteHandle *ph = + TApp::instance()->getPaletteController()->getCurrentLevelPalette(); + + TPalette *palette = ph->getPalette(); + if (palette) { + palette->nextShortcutScope(key == Qt::Key_Backtab); + ph->notifyPaletteChanged(); + } + event->accept(); + } +} + +//----------------------------------------------------------------------------- + +void StyleShortcutSwitchablePanel::showEvent(QShowEvent *event) { + TPanel::showEvent(event); + bool ret = connect(TApp::instance()->getCurrentScene(), + SIGNAL(preferenceChanged(const QString &)), this, + SLOT(onPreferenceChanged(const QString &))); + onPreferenceChanged(""); + assert(ret); +} + +//----------------------------------------------------------------------------- + +void StyleShortcutSwitchablePanel::hideEvent(QHideEvent *event) { + TPanel::hideEvent(event); + disconnect(TApp::instance()->getCurrentScene(), + SIGNAL(preferenceChanged(const QString &)), this, + SLOT(onPreferenceChanged(const QString &))); +} + +//----------------------------------------------------------------------------- + +void StyleShortcutSwitchablePanel::onPreferenceChanged( + const QString &prefName) { + if (prefName == "NumpadForSwitchingStyles" || prefName.isEmpty()) + updateTabFocus(); +} + +//----------------------------------------------------------------------------- + +void StyleShortcutSwitchablePanel::updateTabFocus() { + QList widgets = findChildren(); + if (Preferences::instance()->isUseNumpadForSwitchingStylesEnabled()) { + // disable tab focus + foreach (QWidget *widget, widgets) { + Qt::FocusPolicy policy = widget->focusPolicy(); + if (policy == Qt::TabFocus || policy == Qt::StrongFocus || + policy == Qt::WheelFocus) { + m_childrenFocusPolicies[widget] = policy; + widget->setFocusPolicy((policy == Qt::TabFocus) ? Qt::NoFocus + : Qt::ClickFocus); + } + } + } else { + // revert tab focus + QHashIterator i(m_childrenFocusPolicies); + while (i.hasNext()) { + i.next(); + i.key()->setFocusPolicy(i.value()); + } + } +} \ No newline at end of file diff --git a/toonz/sources/toonz/styleshortcutswitchablepanel.h b/toonz/sources/toonz/styleshortcutswitchablepanel.h new file mode 100644 index 0000000..ce68933 --- /dev/null +++ b/toonz/sources/toonz/styleshortcutswitchablepanel.h @@ -0,0 +1,39 @@ +#pragma once + +#ifndef STYLE_SHORTCUT_SWITCHABLE_PANEL_H +#define STYLE_SHORTCUT_SWITCHABLE_PANEL_H + +#include "pane.h" + +//============================================================================= +// StyleShortcutSwitchablePanel +//----------------------------------------------------------------------------- +// StyleShortcutSwitchablePanel class is subclass of TPanel and +// inherited by panels which can select the current style by 0-9 +// number keys if the Preferences option +// "Use Numpad and Tab keys for Switching Styles" is active. +// Currently inherited by ComboViewer, Viewer and Palette +//----------------------------------------------------------------------------- + +class StyleShortcutSwitchablePanel : public TPanel { + Q_OBJECT + + QHash m_childrenFocusPolicies; + +public: + StyleShortcutSwitchablePanel( + QWidget *parent = 0, Qt::WindowFlags flags = 0, + TDockWidget::Orientation orientation = TDockWidget::vertical) + : TPanel(parent, flags, orientation) {} + +protected: + void keyPressEvent(QKeyEvent *event) override; + void showEvent(QShowEvent *) override; + void hideEvent(QHideEvent *) override; + +protected slots: + virtual void onPreferenceChanged(const QString &prefName); + void updateTabFocus(); +}; + +#endif \ No newline at end of file diff --git a/toonz/sources/toonz/tpanels.cpp b/toonz/sources/toonz/tpanels.cpp index 70dc4b1..8ed5795 100644 --- a/toonz/sources/toonz/tpanels.cpp +++ b/toonz/sources/toonz/tpanels.cpp @@ -403,7 +403,7 @@ public: //----------------------------------------------------------------------------- PaletteViewerPanel::PaletteViewerPanel(QWidget *parent) - : StyleShortcutSelectivePanel(parent) { + : StyleShortcutSwitchablePanel(parent) { m_paletteHandle = new TPaletteHandle(); connect(m_paletteHandle, SIGNAL(colorStyleSwitched()), SLOT(onColorStyleSwitched())); diff --git a/toonz/sources/toonz/tpanels.h b/toonz/sources/toonz/tpanels.h index c0ff58b..d6501d8 100644 --- a/toonz/sources/toonz/tpanels.h +++ b/toonz/sources/toonz/tpanels.h @@ -4,7 +4,7 @@ #define TPANELS_INCLUDED #include "pane.h" -#include "styleshortcutselectivepanel.h" +#include "styleshortcutswitchablepanel.h" #include "tpalette.h" #include "trenderer.h" @@ -28,7 +28,7 @@ class ToolOptions; // PaletteViewerPanel //--------------------------------------------------------- -class PaletteViewerPanel final : public StyleShortcutSelectivePanel { +class PaletteViewerPanel final : public StyleShortcutSwitchablePanel { Q_OBJECT TPaletteHandle *m_paletteHandle; diff --git a/toonz/sources/toonz/viewerpane.cpp b/toonz/sources/toonz/viewerpane.cpp index 68356e1..ef676e7 100644 --- a/toonz/sources/toonz/viewerpane.cpp +++ b/toonz/sources/toonz/viewerpane.cpp @@ -77,7 +77,7 @@ SceneViewerPanel::SceneViewerPanel(QWidget *parent, Qt::WindowFlags flags) #else SceneViewerPanel::SceneViewerPanel(QWidget *parent, Qt::WFlags flags) #endif - : StyleShortcutSelectivePanel(parent) { + : StyleShortcutSwitchablePanel(parent) { QFrame *hbox = new QFrame(this); hbox->setFrameStyle(QFrame::StyledPanel); hbox->setObjectName("ViewerPanel"); @@ -94,7 +94,7 @@ SceneViewerPanel::SceneViewerPanel(QWidget *parent, Qt::WFlags flags) new ImageUtils::FullScreenWidget(viewer); fsWidget->setWidget(m_sceneViewer = new SceneViewer(fsWidget)); - m_sceneViewer->setIsStyleShortcutSelective(); + m_sceneViewer->setIsStyleShortcutSwitchable(); bool ret = true; ret = ret && connect(m_sceneViewer, SIGNAL(onZoomChanged()), @@ -222,7 +222,7 @@ SceneViewerPanel::~SceneViewerPanel() {} //----------------------------------------------------------------------------- void SceneViewerPanel::showEvent(QShowEvent *event) { - StyleShortcutSelectivePanel::showEvent(event); + StyleShortcutSwitchablePanel::showEvent(event); TApp *app = TApp::instance(); TFrameHandle *frameHandle = app->getCurrentFrame(); TSceneHandle *sceneHandle = app->getCurrentScene(); @@ -271,7 +271,7 @@ void SceneViewerPanel::showEvent(QShowEvent *event) { //----------------------------------------------------------------------------- void SceneViewerPanel::hideEvent(QHideEvent *event) { - StyleShortcutSelectivePanel::hideEvent(event); + StyleShortcutSwitchablePanel::hideEvent(event); TApp *app = TApp::instance(); TFrameHandle *frameHandle = app->getCurrentFrame(); TSceneHandle *sceneHandle = app->getCurrentScene(); @@ -644,7 +644,7 @@ void SceneViewerPanel::onPreferenceChanged(const QString &prefName) { prefName.isEmpty()) m_flipConsole->onPreferenceChanged(); - StyleShortcutSelectivePanel::onPreferenceChanged(prefName); + StyleShortcutSwitchablePanel::onPreferenceChanged(prefName); } //----------------------------------------------------------------------------- diff --git a/toonz/sources/toonz/viewerpane.h b/toonz/sources/toonz/viewerpane.h index e75eaca..699873f 100644 --- a/toonz/sources/toonz/viewerpane.h +++ b/toonz/sources/toonz/viewerpane.h @@ -3,7 +3,7 @@ #ifndef VIEWER_PANE_INCLUDED #define VIEWER_PANE_INCLUDED -#include "styleshortcutselectivepanel.h" +#include "styleshortcutswitchablepanel.h" #include "sceneviewer.h" #include "toonzqt/intfield.h" #include "toonzqt/keyframenavigator.h" @@ -25,7 +25,7 @@ class Ruler; class FlipConsole; class TXshLevel; -class SceneViewerPanel final : public StyleShortcutSelectivePanel, +class SceneViewerPanel final : public StyleShortcutSwitchablePanel, public FlipConsoleOwner { Q_OBJECT diff --git a/toonz/sources/toonzlib/preferences.cpp b/toonz/sources/toonzlib/preferences.cpp index 588792e..b325637 100644 --- a/toonz/sources/toonzlib/preferences.cpp +++ b/toonz/sources/toonzlib/preferences.cpp @@ -296,7 +296,7 @@ Preferences::Preferences() , m_precompute(true) , m_ffmpegTimeout(30) , m_shortcutPreset("defopentoonz") - , m_useNumpadForSwitchingStyles(false) { + , m_useNumpadForSwitchingStyles(true) { TCamera camera; m_defLevelType = PLI_XSHLEVEL; m_defLevelWidth = camera.getSize().lx;