Skip to content

Commit

Permalink
color
Browse files Browse the repository at this point in the history
  • Loading branch information
zkovari committed Oct 10, 2024
1 parent 731fbee commit 5b70216
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/python/plotlyst/core/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2184,8 +2184,8 @@ class WorldConceit:
type: WorldConceitType
id: uuid.UUID = field(default_factory=uuid.uuid4)
text: str = field(default='', metadata=config(exclude=exclude_if_empty))
icon: str = ''
icon_color: str = 'black'
icon: str = field(default='', metadata=config(exclude=exclude_if_empty))
icon_color: str = field(default='', metadata=config(exclude=exclude_if_empty))
children: List['WorldConceit'] = field(default_factory=list, metadata=config(exclude=exclude_if_empty))

@overrides
Expand Down
6 changes: 5 additions & 1 deletion src/main/python/plotlyst/view/widget/world/conceit.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def __init__(self, conceit: WorldConceit, parent=None):
self._removalEnabled = True

icon = self.conceit.icon if self.conceit.icon else self.conceit.type.icon()
self._title.setIcon(IconRegistry.from_name(icon, '#510442'))
color = self.conceit.icon_color if self.conceit.icon_color else '#510442'
self._title.setIcon(IconRegistry.from_name(icon, color))
self._title.setText(self.conceit.name)
self._title.lineEdit.textEdited.connect(self._titleEdited)
self._title.iconChanged.connect(self._iconChanged)
Expand All @@ -70,6 +71,9 @@ def _textChanged(self):

def _iconChanged(self, icon: str, color: str):
self.conceit.icon = icon
if color == 'black' or color == '#000000':
color = '#510442'
self._title.setIcon(IconRegistry.from_name(icon, color))
self.conceit.icon_color = color
self.iconChanged.emit()

Expand Down
2 changes: 1 addition & 1 deletion src/main/python/plotlyst/view/widget/world/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def __init__(self, novel: Novel, element: WorldBuildingEntityElement, parent=Non
self._splitter.setChildrenCollapsible(False)
self._splitter.setHandleWidth(10)
self._splitter.setProperty('framed', True)
self._splitter.setSizes([150, 500])
self._splitter.setSizes([100, 500])
self._wdgEditor.layout().addWidget(self._splitter)

self._wdgTree = ConceitsTreeView(novel)
Expand Down

0 comments on commit 5b70216

Please sign in to comment.