mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-16 04:13:50 +00:00
Fix bug where Layer > Open Group didn't update the Timeline rows
This commit is contained in:
parent
69d3ada204
commit
49e4e10311
@ -1,4 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2022 Igara Studio S.A.
|
||||
// Copyright (C) 2017 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -53,9 +54,11 @@ bool OpenGroupCommand::onChecked(Context* context)
|
||||
void OpenGroupCommand::onExecute(Context* context)
|
||||
{
|
||||
ContextWriter writer(context);
|
||||
Doc* doc = writer.document();
|
||||
Layer* layer = writer.layer();
|
||||
|
||||
layer->setCollapsed(layer->isExpanded());
|
||||
doc->notifyLayerGroupCollapseChange(layer);
|
||||
|
||||
update_screen_for_document(writer.document());
|
||||
}
|
||||
|
@ -267,6 +267,13 @@ void Doc::notifyTilesetChanged(Tileset* tileset)
|
||||
notify_observers<DocEvent&>(&DocObserver::onTilesetChanged, ev);
|
||||
}
|
||||
|
||||
void Doc::notifyLayerGroupCollapseChange(Layer* layer)
|
||||
{
|
||||
DocEvent ev(this);
|
||||
ev.layer(layer);
|
||||
notify_observers<DocEvent&>(&DocObserver::onLayerCollapsedChanged, ev);
|
||||
}
|
||||
|
||||
bool Doc::isModified() const
|
||||
{
|
||||
return !m_undo->isSavedState();
|
||||
|
@ -115,6 +115,7 @@ namespace app {
|
||||
void notifySelectionChanged();
|
||||
void notifySelectionBoundariesChanged();
|
||||
void notifyTilesetChanged(Tileset* tileset);
|
||||
void notifyLayerGroupCollapseChange(Layer* layer);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// File related properties
|
||||
|
@ -89,6 +89,9 @@ namespace app {
|
||||
// The tileset has changed.
|
||||
virtual void onTilesetChanged(DocEvent& ev) { }
|
||||
|
||||
// The collapsed/expanded flag of a specific layer changed.
|
||||
virtual void onLayerCollapsedChanged(DocEvent& ev) { }
|
||||
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
|
@ -1926,6 +1926,12 @@ void Timeline::onTagRename(DocEvent& ev)
|
||||
invalidateHit(Hit(PART_TAGS));
|
||||
}
|
||||
|
||||
void Timeline::onLayerCollapsedChanged(DocEvent& ev)
|
||||
{
|
||||
regenerateRows();
|
||||
invalidate();
|
||||
}
|
||||
|
||||
void Timeline::onStateChanged(Editor* editor)
|
||||
{
|
||||
m_aniControls.updateUsingEditor(editor);
|
||||
@ -4442,9 +4448,7 @@ void Timeline::setLayerCollapsedFlag(const layer_t l, const bool state)
|
||||
|
||||
if (layer->isGroup() && layer->isCollapsed() != state) {
|
||||
layer->setCollapsed(state);
|
||||
|
||||
regenerateRows();
|
||||
invalidate();
|
||||
m_document->notifyLayerGroupCollapseChange(layer);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -165,6 +165,7 @@ namespace app {
|
||||
void onRemoveTag(DocEvent& ev) override;
|
||||
void onTagChange(DocEvent& ev) override;
|
||||
void onTagRename(DocEvent& ev) override;
|
||||
void onLayerCollapsedChanged(DocEvent& ev) override;
|
||||
|
||||
// app::Context slots.
|
||||
void onBeforeCommandExecution(CommandExecutionEvent& ev);
|
||||
|
Loading…
Reference in New Issue
Block a user