Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Update toolbar when frame's level changes

manongjohnc6f8d320ee45
diff --git a/toonz/sources/toonz/toolbar.cpp b/toonz/sources/toonz/toolbar.cpp
index 6f2e49838..f71e3ddd8 100755
--- a/toonz/sources/toonz/toolbar.cpp
+++ b/toonz/sources/toonz/toolbar.cpp
@@ -313,6 +313,9 @@ void Toolbar::showEvent(QShowEvent *e) {
TFrameHandle *frameHandle = TApp::instance()->getCurrentFrame();
connect(frameHandle, SIGNAL(frameSwitched()), this, SLOT(onFrameSwitched()));
+ TXsheetHandle *xsheetHandle = TApp::instance()->getCurrentXsheet();
+ connect(xsheetHandle, SIGNAL(xsheetChanged()), this, SLOT(onXsheetChanged()));
+
connect(TApp::instance()->getCurrentTool(), SIGNAL(toolSwitched()),
SLOT(onToolChanged()));
}
@@ -323,6 +326,8 @@ void Toolbar::onFrameSwitched() {
updateToolbar();
}
+void Toolbar::onXsheetChanged() { updateToolbar(); }
+
//-----------------------------------------------------------------------------
void Toolbar::hideEvent(QHideEvent *e) {
diff --git a/toonz/sources/toonz/toolbar.h b/toonz/sources/toonz/toolbar.h
index 6a3ad5a8e..ca96cc61d 100755
--- a/toonz/sources/toonz/toolbar.h
+++ b/toonz/sources/toonz/toolbar.h
@@ -31,6 +31,7 @@ protected slots:
void setIsExpanded(bool expand);
void updateToolbar();
void onFrameSwitched();
+ void onXsheetChanged();
};
#endif // TOOLBAR_H