Skip to content

Commit

Permalink
Rework character topics editor
Browse files Browse the repository at this point in the history
  • Loading branch information
zkovari committed Oct 5, 2024
1 parent 7a455c0 commit 9b10219
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/main/python/plotlyst/view/character_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
from plotlyst.view.widget.character.editor import CharacterAgeEditor
from plotlyst.view.widget.character.editor import CharacterRoleSelector
from plotlyst.view.widget.character.profile import CharacterProfileEditor
from plotlyst.view.widget.character.topic import CharacterTopicsEditor
from plotlyst.view.widget.confirm import asked
from plotlyst.view.widget.tour.core import CharacterEditorTourEvent, \
CharacterEditorNameLineEditTourEvent, TourEvent, CharacterEditorNameFilledTourEvent, \
Expand Down Expand Up @@ -142,7 +143,7 @@ def __init__(self, novel: Novel):
set_tab_icon(self.ui.tabAttributes, self.ui.tabNotes, IconRegistry.document_edition_icon())
set_tab_icon(self.ui.tabAttributes, self.ui.tabGoals, IconRegistry.goal_icon('black', PLOTLYST_SECONDARY_COLOR))

set_tab_visible(self.ui.tabAttributes, self.ui.tabTopics, False)
# set_tab_visible(self.ui.tabAttributes, self.ui.tabTopics, False)
set_tab_visible(self.ui.tabAttributes, self.ui.tabBigFive, False)
set_tab_visible(self.ui.tabAttributes, self.ui.tabGoals, False)

Expand All @@ -155,8 +156,8 @@ def __init__(self, novel: Novel):
self.ui.lineName.setReadOnly(self.novel.is_readonly())
self.ui.lineName.textEdited.connect(self._name_edited)

# self.wdgTopicsEditor = CharacterTopicsEditor()
# self.ui.tabTopics.layout().addWidget(self.wdgTopicsEditor)
self.wdgTopicsEditor = CharacterTopicsEditor()
self.ui.tabTopics.layout().addWidget(self.wdgTopicsEditor)

self.profile = CharacterProfileEditor(self.novel)
self.ui.wdgProfile.layout().addWidget(self.profile)
Expand Down Expand Up @@ -220,7 +221,7 @@ def set_character(self, character: Character):
self.ui.lineName.setText(self.character.name)
self.ui.wdgAvatar.setCharacter(self.character)
self.ui.wdgAvatar.setUploadPopupMenu()
# self.wdgTopicsEditor.setCharacter(self.character)
self.wdgTopicsEditor.setCharacter(self.character)
self.ui.wdgBackstory.setCharacter(self.character)
self.profile.setCharacter(self.character)
if self.character.document and self.character.document.loaded:
Expand Down
1 change: 1 addition & 0 deletions src/main/python/plotlyst/view/widget/character/topic.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def __init__(self, parent=None):
vbox(self, 0, 0)
self.layout().addWidget(self.btnAdd, alignment=Qt.AlignmentFlag.AlignLeft)
self._scrollarea, self._wdgCenter = scrolled(self, frameless=True)
self._wdgCenter.setProperty('relaxed-white-bg', True)
vbox(self._wdgCenter)
self._wdgCenter.layout().addWidget(self._wdgTopics)
self._wdgCenter.layout().addWidget(vspacer())
Expand Down
4 changes: 2 additions & 2 deletions src/main/python/plotlyst/view/widget/topic.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ def __init__(self, topic: Topic, value: TemplateValue, parent=None):
tooltip=topic.description, transparent_=True)

self.textEdit = AutoAdjustableTextEdit(height=60)
self.textEdit.setProperty('rounded', True)
self.textEdit.setProperty('white-bg', True)
self.textEdit.setProperty('transparent', True)
# self.textEdit.setProperty('white-bg', True)
self.textEdit.setAutoFormatting(QTextEdit.AutoFormattingFlag.AutoAll)
self.textEdit.setTabChangesFocus(True)
self.textEdit.setPlaceholderText(self._topic.description)
Expand Down

0 comments on commit 9b10219

Please sign in to comment.