fix: update Controls on Timeline.enabled changes

closes #340
This commit is contained in:
tomasklaen
2022-10-25 17:46:22 +02:00
parent f776bf39eb
commit 2b0aadfa7b
2 changed files with 4 additions and 1 deletions

View File

@@ -325,5 +325,6 @@ function Controls:on_dispositions() self:reflow() end
function Controls:on_display() self:update_dimensions() end
function Controls:on_prop_border() self:update_dimensions() end
function Controls:on_prop_fullormaxed() self:update_dimensions() end
function Controls:on_timeline_enabled() self:update_dimensions() end
return Controls

View File

@@ -24,7 +24,9 @@ function Timeline:get_visibility()
end
function Timeline:decide_enabled()
self.enabled = not self.obstructed and state.duration and state.duration > 0 and state.time
local previous = self.enabled
self.enabled = not self.obstructed and state.duration ~= nil and state.duration > 0 and state.time ~= nil
if self.enabled ~= previous then Elements:trigger('timeline_enabled', self.enabled) end
end
function Timeline:get_effective_size_min()