tiled icon indicating copy to clipboard operation
tiled copied to clipboard

Added Expand/Collapse API to GroupLayer

Open PalaBeaveR opened this issue 7 months ago • 2 comments

Related issue: #3997

Added a new scripting field in GroupLayer called expanded that controls the layer's expand state.

From what I'd been able to gather, in order to expand/collapse layers I would need access to LayerView(QTreeView) which controls layer expansion with setExpanded. It wasn't possible since those properties were privated so I added getters to access LayerDock, LayerView, QAbstractProxyModel.

Right now the expanded state is stored in GroupLayer and is not synced, however since Qt already stores that state itself, the scripting interface can be made to use that instead.

I also don't know if the same API is appropriate for ObjectGroup(as requested by #3997), but i have that code made in the same way as GroupLayer if it is needed.

I'm not sure if the new definitions in changelayer.h/undocommands.h are needed since i was just copying code from other places in the repo so it would be nice to have that clarified.

PalaBeaveR avatar Jul 14 '24 06:07 PalaBeaveR