diff --git a/toonz/sources/include/toonzqt/flipconsole.h b/toonz/sources/include/toonzqt/flipconsole.h index 93e493f..cf9e412 100644 --- a/toonz/sources/include/toonzqt/flipconsole.h +++ b/toonz/sources/include/toonzqt/flipconsole.h @@ -393,7 +393,7 @@ protected slots: void onFPSEdited(); public slots: - void onPreferenceChanged(); + void onPreferenceChanged(const QString &); private: friend class PlaybackExecutor; diff --git a/toonz/sources/toonz/comboviewerpane.cpp b/toonz/sources/toonz/comboviewerpane.cpp index c592005..af1fc70 100644 --- a/toonz/sources/toonz/comboviewerpane.cpp +++ b/toonz/sources/toonz/comboviewerpane.cpp @@ -786,10 +786,6 @@ bool ComboViewerPanel::isFrameAlreadyCached(int frame) { //----------------------------------------------------------------------------- void ComboViewerPanel::onPreferenceChanged(const QString &prefName) { - // if no name specified (on showEvent), then process all updates - if (prefName == "BlankCount" || prefName == "BlankColor" || - prefName.isEmpty()) - m_flipConsole->onPreferenceChanged(); - + m_flipConsole->onPreferenceChanged(prefName); StyleShortcutSwitchablePanel::onPreferenceChanged(prefName); } diff --git a/toonz/sources/toonz/flipbook.cpp b/toonz/sources/toonz/flipbook.cpp index b8cc24e..74f0c01 100644 --- a/toonz/sources/toonz/flipbook.cpp +++ b/toonz/sources/toonz/flipbook.cpp @@ -1872,9 +1872,9 @@ void FlipBook::showEvent(QShowEvent *e) { connect(sceneHandle, SIGNAL(sceneChanged()), m_imageViewer, SLOT(update())); // for updating the blank frame button if (!m_imageViewer->isColorModel()) { - connect(sceneHandle, SIGNAL(preferenceChanged()), m_flipConsole, - SLOT(onPreferenceChanged())); - m_flipConsole->onPreferenceChanged(); + connect(sceneHandle, SIGNAL(preferenceChanged(const QString &)), + m_flipConsole, SLOT(onPreferenceChanged(const QString &))); + m_flipConsole->onPreferenceChanged(""); } m_flipConsole->setActive(true); m_imageViewer->update(); @@ -1886,6 +1886,10 @@ void FlipBook::hideEvent(QHideEvent *e) { TSceneHandle *sceneHandle = TApp::instance()->getCurrentScene(); disconnect(sceneHandle, SIGNAL(sceneChanged()), m_imageViewer, SLOT(update())); + if (!m_imageViewer->isColorModel()) { + disconnect(sceneHandle, SIGNAL(preferenceChanged(const QString &)), + m_flipConsole, SLOT(onPreferenceChanged(const QString &))); + } m_flipConsole->setActive(false); } diff --git a/toonz/sources/toonz/viewerpane.cpp b/toonz/sources/toonz/viewerpane.cpp index 6fc4ef7..5c79951 100644 --- a/toonz/sources/toonz/viewerpane.cpp +++ b/toonz/sources/toonz/viewerpane.cpp @@ -657,12 +657,7 @@ void SceneViewerPanel::onFrameTypeChanged() { //----------------------------------------------------------------------------- void SceneViewerPanel::onPreferenceChanged(const QString &prefName) { - // if no name specified (on StyleShortcutSelectivePanel::showEvent), - // then process all updates - if (prefName == "BlankCount" || prefName == "BlankColor" || - prefName.isEmpty()) - m_flipConsole->onPreferenceChanged(); - + m_flipConsole->onPreferenceChanged(prefName); StyleShortcutSwitchablePanel::onPreferenceChanged(prefName); } diff --git a/toonz/sources/toonzqt/flipconsole.cpp b/toonz/sources/toonzqt/flipconsole.cpp index 1caa5ac..d86ea0f 100644 --- a/toonz/sources/toonzqt/flipconsole.cpp +++ b/toonz/sources/toonzqt/flipconsole.cpp @@ -1847,7 +1847,12 @@ const std::vector *FlipConsole::getProgressBarStatus() const { //-------------------------------------------------------------------- -void FlipConsole::onPreferenceChanged() { +void FlipConsole::onPreferenceChanged(const QString &prefName) { + // react only when related properties are changed + if (prefName != "BlankCount" && prefName != "BlankColor" && + !prefName.isEmpty()) + return; + if (m_drawBlanksEnabled) { Preferences::instance()->getBlankValues(m_blanksCount, m_blankColor); if (m_blanksCount == 0) {