Skip to content

Commit

Permalink
remove
Browse files Browse the repository at this point in the history
  • Loading branch information
zkovari committed Oct 10, 2024
1 parent 5008528 commit 814b564
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/python/plotlyst/view/widget/world/conceit.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def __init__(self, conceit: WorldConceit, parent=None):
super().__init__(parent, titleEditable=True, titleMaxWidth=150)
self.conceit = conceit

self._removalEnabled = True

self._title.setIcon(IconRegistry.from_name(self.conceit.icon, '#510442'))
self._title.setText(self.conceit.name)
self._title.lineEdit.textEdited.connect(self._titleEdited)
Expand Down
10 changes: 9 additions & 1 deletion src/main/python/plotlyst/view/widget/world/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ def __init__(self, novel: Novel, element: WorldBuildingEntityElement, parent=Non
@overrides
def resizeEvent(self, event: QResizeEvent) -> None:
super().resizeEvent(event)
self._wdgEditor.updateGeometry()
self._wdgDisplay.updateGeometry()

def refresh(self):
clear_layout(self._wdgDisplay)
Expand Down Expand Up @@ -773,12 +773,20 @@ def _initBubble(self, conceit: WorldConceit) -> ConceitBubble:
bubble = ConceitBubble(conceit)
bubble.nameEdited.connect(partial(self._conceitNameChanged, conceit))
bubble.textChanged.connect(self.save)
bubble.removed.connect(partial(self._conceitRemoved, bubble))
return bubble

def _conceitNameChanged(self, conceit: WorldConceit):
self._wdgTree.updateItem(conceit)
self.save()

def _conceitRemoved(self, bubble: ConceitBubble):
self.novel.world.conceits.remove(bubble.conceit)
fade_out_and_gc(self._wdgDisplay, bubble)

self._wdgTree.refresh()
self.save()


class SectionElementEditor(WorldBuildingEntityElementWidget):
WORLD_BLOCK_MIMETYPE = 'application/world-block'
Expand Down

0 comments on commit 814b564

Please sign in to comment.