Make timeline item visibility functions virtual.

This commit is contained in:
Bartosz Taudul 2022-09-04 14:22:12 +02:00
parent 135d3b7f30
commit 9c464e9f05
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@ TimelineItem::TimelineItem( View& view, Worker& worker )
void TimelineItem::Draw( bool firstFrame, double pxns, int& offset, const ImVec2& wpos, bool hover, float yMin, float yMax ) void TimelineItem::Draw( bool firstFrame, double pxns, int& offset, const ImVec2& wpos, bool hover, float yMin, float yMax )
{ {
if( !m_visible ) if( !IsVisible() )
{ {
m_height = 0; m_height = 0;
m_offset = 0; m_offset = 0;
@ -109,7 +109,7 @@ void TimelineItem::Draw( bool firstFrame, double pxns, int& offset, const ImVec2
{ {
if( ImGui::MenuItem( ICON_FA_EYE_SLASH " Hide" ) ) if( ImGui::MenuItem( ICON_FA_EYE_SLASH " Hide" ) )
{ {
m_visible = false; SetVisible( false );
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
ImGui::EndPopup(); ImGui::EndPopup();

View File

@ -20,8 +20,8 @@ public:
void Draw( bool firstFrame, double pxns, int& offset, const ImVec2& wpos, bool hover, float yMin, float yMax ); void Draw( bool firstFrame, double pxns, int& offset, const ImVec2& wpos, bool hover, float yMin, float yMax );
void VisibilityCheckbox(); void VisibilityCheckbox();
void SetVisible( bool visible ) { m_visible = visible; } virtual void SetVisible( bool visible ) { m_visible = visible; }
bool IsVisible() const { return m_visible; } virtual bool IsVisible() const { return m_visible; }
protected: protected:
virtual uint32_t HeaderColor() const = 0; virtual uint32_t HeaderColor() const = 0;