Decide a timeline row's visibility in one place
This commit is contained in:
1 parent
f78d35b12b
commit
c467c39baa
4 files changed
+12
-12
No files matched your search
@@ -227,6 +227,7 @@ struct TimelineContext : TimelineState
|
|||||||
void frame_split();
|
void frame_split();
|
||||||
std::vector<TimelineRow> timeline_item_rows_get();
|
std::vector<TimelineRow> timeline_item_rows_get();
|
||||||
bool is_row_selected(const TimelineRow& row);
|
bool is_row_selected(const TimelineRow& row);
|
||||||
|
bool is_row_visible(const TimelineRow&, const Track*);
|
||||||
void row_selection_clear();
|
void row_selection_clear();
|
||||||
void row_selection_insert(const TimelineRow& row);
|
void row_selection_insert(const TimelineRow& row);
|
||||||
bool is_row_reference_selected(const TimelineRow& row);
|
bool is_row_reference_selected(const TimelineRow& row);
|
||||||
|
|||||||
@@ -97,12 +97,7 @@ void TimelineContext::frame_child(const TimelineRow& row, int& index, float widt
|
|||||||
if (type != NONE && !item)
|
if (type != NONE && !item)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto isVisible = item ? item->isVisible && is_track_group_visible(type, row.groupId) : false;
|
auto isVisible = is_row_visible(row, item);
|
||||||
if (item && type == ROOT && row.groupId != -1)
|
|
||||||
isVisible = item->isVisible && is_track_group_visible(row.groupType, row.groupId);
|
|
||||||
auto& isOnlyShowLayers = settings.timelineIsOnlyShowLayers;
|
|
||||||
if (isOnlyShowLayers && type != LAYER)
|
|
||||||
isVisible = false;
|
|
||||||
|
|
||||||
auto colorVec = color_get(COLOR_FRAME_BASE, type);
|
auto colorVec = color_get(COLOR_FRAME_BASE, type);
|
||||||
auto colorActiveVec = color_get(COLOR_FRAME_ACTIVE, type);
|
auto colorActiveVec = color_get(COLOR_FRAME_ACTIVE, type);
|
||||||
|
|||||||
@@ -331,3 +331,12 @@ std::vector<TimelineRow> TimelineContext::row_drag_references_get(const Timeline
|
|||||||
rows = {clicked};
|
rows = {clicked};
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Whether a row's track shows: it and its group are visible, and only layers show when asked.
|
||||||
|
bool TimelineContext::is_row_visible(const TimelineRow& row, const Track* item)
|
||||||
|
{
|
||||||
|
if (!item || (settings.timelineIsOnlyShowLayers && row.type != LAYER))
|
||||||
|
return false;
|
||||||
|
auto groupType = row.type == ROOT && row.groupId != -1 ? row.groupType : row.type;
|
||||||
|
return item->isVisible && is_track_group_visible(groupType, row.groupId);
|
||||||
|
}
|
||||||
@@ -132,12 +132,7 @@ void TimelineContext::item_child(const TimelineRow& row, int index)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto isItemVisible = item ? item->isVisible : false;
|
auto isItemVisible = item ? item->isVisible : false;
|
||||||
auto isVisible = item ? item->isVisible && is_track_group_visible(type, row.groupId) : false;
|
auto isVisible = is_row_visible(row, item);
|
||||||
if (item && type == ROOT && row.groupId != -1)
|
|
||||||
isVisible = item->isVisible && is_track_group_visible(row.groupType, row.groupId);
|
|
||||||
auto& isOnlyShowLayers = settings.timelineIsOnlyShowLayers;
|
|
||||||
if (isOnlyShowLayers && type != LAYER)
|
|
||||||
isVisible = false;
|
|
||||||
auto isReferenced = is_same_item(reference, row_reference_make());
|
auto isReferenced = is_same_item(reference, row_reference_make());
|
||||||
auto isItemSelected = is_row_selected(row);
|
auto isItemSelected = is_row_selected(row);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user