From c6f8d320ee458b77649a3857dd06a722bb2b8242 Mon Sep 17 00:00:00 2001 From: manongjohn Date: Feb 09 2019 14:50:10 +0000 Subject: Update toolbar when frame's level changes --- diff --git a/toonz/sources/toonz/toolbar.cpp b/toonz/sources/toonz/toolbar.cpp index 6f2e498..f71e3dd 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 6a3ad5a..ca96cc6 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