mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
remove placeholder from single selection combobox
This commit is contained in:
parent
29dbc8b8cf
commit
4c7176c752
2 changed files with 1 additions and 10 deletions
|
|
@ -640,15 +640,13 @@ class EnumAttrWidget(_BaseAttrDefWidget):
|
|||
return self.attr_def.multiselection
|
||||
|
||||
def _ui_init(self):
|
||||
placeholder = self.attr_def.placeholder
|
||||
if self.multiselection:
|
||||
input_widget = MultiSelectionComboBox(
|
||||
self, placeholder=placeholder
|
||||
self, placeholder=self.attr_def.placeholder
|
||||
)
|
||||
|
||||
else:
|
||||
input_widget = CustomTextComboBox(self)
|
||||
input_widget.set_placeholder(placeholder)
|
||||
combo_delegate = QtWidgets.QStyledItemDelegate(input_widget)
|
||||
input_widget.setItemDelegate(combo_delegate)
|
||||
self._combo_delegate = combo_delegate
|
||||
|
|
|
|||
|
|
@ -71,15 +71,8 @@ class CustomTextComboBox(ComboBox):
|
|||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self._custom_text = None
|
||||
self._placeholder = placeholder
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def set_placeholder(self, placeholder: Optional[str]):
|
||||
if placeholder == self._placeholder:
|
||||
return
|
||||
self.lineEdit().setPlaceholderText(placeholder)
|
||||
self.repaint()
|
||||
|
||||
def set_custom_text(self, text=None):
|
||||
if self._custom_text != text:
|
||||
self._custom_text = text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue