mirror of https://github.com/aseprite/aseprite.git
[lua] Refresh timeline when changing layer collapsed status (fix #5366)
This commit is contained in:
parent
983b07383f
commit
8e75cfc4c7
|
@ -22,6 +22,7 @@
|
|||
#include "app/script/luacpp.h"
|
||||
#include "app/script/userdata.h"
|
||||
#include "app/tx.h"
|
||||
#include "app/ui/timeline/timeline.h"
|
||||
#include "doc/layer.h"
|
||||
#include "doc/layer_tilemap.h"
|
||||
#include "doc/sprite.h"
|
||||
|
@ -355,6 +356,9 @@ int Layer_set_isCollapsed(lua_State* L)
|
|||
{
|
||||
auto layer = get_docobj<Layer>(L, 1);
|
||||
layer->setCollapsed(lua_toboolean(L, 2));
|
||||
|
||||
if (auto* timeline = App::instance()->timeline())
|
||||
timeline->refresh();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -362,6 +366,9 @@ int Layer_set_isExpanded(lua_State* L)
|
|||
{
|
||||
auto layer = get_docobj<Layer>(L, 1);
|
||||
layer->setCollapsed(!lua_toboolean(L, 2));
|
||||
|
||||
if (auto* timeline = App::instance()->timeline())
|
||||
timeline->refresh();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -4321,6 +4321,13 @@ void Timeline::clearAndInvalidateRange()
|
|||
}
|
||||
}
|
||||
|
||||
void Timeline::refresh()
|
||||
{
|
||||
regenerateCols();
|
||||
regenerateRows();
|
||||
invalidate();
|
||||
}
|
||||
|
||||
app::gen::GlobalPref::Timeline& Timeline::timelinePref() const
|
||||
{
|
||||
return Preferences::instance().timeline;
|
||||
|
|
|
@ -155,6 +155,8 @@ public:
|
|||
|
||||
void clearAndInvalidateRange();
|
||||
|
||||
void refresh();
|
||||
|
||||
protected:
|
||||
bool onProcessMessage(ui::Message* msg) override;
|
||||
void onInitTheme(ui::InitThemeEvent& ev) override;
|
||||
|
|
Loading…
Reference in New Issue