Merge pull request #3005 from shun-iwasawa/fix_toggle_link_to_studio_palette_to_prevent_edit_immediately

Fix Toggle Link to Studio Palette to Prevent Editing Style Immediately
This commit is contained in:
Rodney 2020-01-11 08:12:50 -07:00 committed by GitHub
commit 32b829f00b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,6 +62,14 @@ void PaletteController::setCurrentPalette(TPaletteHandle *paletteHandle) {
// perform signal BROADCASTING to all palette handles implicitly mapping to
// the associated palette:
// in case the handle is not changed, skip the reconnection
if (m_originalCurrentPalette == paletteHandle) {
if (!paletteHandle) return;
m_currentPalette->setPalette(paletteHandle->getPalette(),
paletteHandle->getStyleIndex());
return;
}
if (m_originalCurrentPalette) {
m_originalCurrentPalette->disconnectBroadcasts(m_currentPalette);
m_currentPalette->disconnectBroadcasts(m_originalCurrentPalette);