Skip to content

Commit

Permalink
exclude_type_list
Browse files Browse the repository at this point in the history
  • Loading branch information
PingHsunTsai committed Aug 8, 2024
1 parent b942be5 commit 6c57aa0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

* Fixed `GroupObject` `pointcolor` not found error with impliment `exclude_type_list`.

### Removed


Expand Down
9 changes: 8 additions & 1 deletion src/compas_viewer/components/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ def __init__(
self.items = items
self.type = type

@property
def exclude_type_list(self) -> tuple[type, ...]:
from compas_viewer.scene import GroupObject
from compas_viewer.scene import TagObject

return (GroupObject, TagObject)

def generate_layout(self) -> None:
self.layout = QVBoxLayout()
self.widgets = {}
Expand All @@ -106,7 +113,7 @@ def generate_layout(self) -> None:
if obj.is_selected:
obj_list.append(obj)

if not obj_list:
if not obj_list or isinstance(obj_list[0], self.exclude_type_list):
return
# Only support one item selected per time
self.set_layout(self.items, obj_list[0])
Expand Down

0 comments on commit 6c57aa0

Please sign in to comment.