Skip to content

Commit

Permalink
Remove dashes alongside secondary attributes in character editor, closes
Browse files Browse the repository at this point in the history
  • Loading branch information
zkovari committed Oct 16, 2024
1 parent 9455d48 commit 97163a4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main/python/plotlyst/view/widget/character/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,12 @@ def _renamePrimaryField(self, wdg: 'MultiAttributesTemplateWidgetBase'):
class SmallTextTemplateFieldWidget(TemplateFieldWidgetBase):
def __init__(self, parent=None, minHeight: int = 60):
super(SmallTextTemplateFieldWidget, self).__init__(parent)
_layout = vbox(self, margin=self._boxMargin, spacing=self._boxSpacing)

hbox(self, 0, 0)
self._wdgMain = QWidget()
self.layout().addWidget(self._wdgMain)

_layout = vbox(self._wdgMain, margin=self._boxMargin, spacing=self._boxSpacing)
self.wdgEditor = AutoAdjustableTextEdit(height=minHeight)
self.wdgEditor.setProperty('white-bg', True)
self.wdgEditor.setProperty('rounded', True)
Expand Down Expand Up @@ -941,16 +946,15 @@ def _toggleSecondaryField(self, secondary: TemplateField, toggled: bool):
if secondary_attribute is None:
secondary_attribute = CharacterSecondaryAttribute(type_)
self.attribute.attributes[type_.value] = secondary_attribute
wdg = CustomTextField(secondary, secondary_attribute, minHeight=50)
wdg = CustomTextField(secondary, secondary_attribute, minHeight=60)
wdg.valueFilled.connect(self.valueChanged.emit)
wdg.valueReset.connect(self.valueChanged.emit)
self._secondaryFieldWidgets[secondary] = wdg
item = self._secondaryWdgContainer.layout().itemAt(i)
icon = Icon()
icon.setIcon(IconRegistry.from_name('msc.dash', 'grey'))
spac = spacer()
sp(spac).h_preferred()
self._secondaryWdgContainer.layout().replaceWidget(item.widget(), group(icon, wdg, spac))
wdg.layout().insertWidget(0, icon)
self._secondaryWdgContainer.layout().replaceWidget(item.widget(), wdg)
else:
self._secondaryWdgContainer.layout().replaceWidget(self._secondaryFieldWidgets[secondary], spacer())
gc(self._secondaryFieldWidgets[secondary])
Expand Down

0 comments on commit 97163a4

Please sign in to comment.