14.15: a chosen layer is revealed in the Layers panel

This commit is contained in:
ZacharyZhang-NY committed 2026-10-11 07:52:39 -04:00
1 parent e49359d997
commit da8b05509f
9 files changed
+177 -2

No files matched your search

+5
View File
@@ -32,6 +32,8 @@ NativeLayerList::NativeLayerList(EditorSession &session, QWidget *parent)
void NativeLayerList::update()
{
const bool activeChanged = m_shownActive != m_session.activeLayerID();
m_shownActive = m_session.activeLayerID();
const std::vector<LayerHierarchy::Entry> entries = m_session.layerRows();
const std::vector<ImageLayer> &layers = m_session.document() ? m_session.document()->layers : std::vector<ImageLayer>();
std::vector<ImageLayer> next;
@@ -70,6 +72,9 @@ void NativeLayerList::update()
}
// Heights change at once, as Swift's noteHeightOfRows.
m_column->layout()->activate();
// A newly active layer comes into view; a scroll stays.
if (const int row = indexOf(m_rows, m_shownActive); activeChanged && row >= 0)
ensureWidgetVisible(m_cells[row], 0, 0);
// A rename, asked from anywhere, is typed in the row.
if (const std::optional<QUuid> renaming = m_session.renamingLayerID()) {
const int row = indexOf(m_rows, renaming);