mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #532 from pypeclub/feature/text_input_can_have_placeholder
Feature/text input can have placeholder
This commit is contained in:
commit
b68a342165
2 changed files with 5 additions and 0 deletions
|
|
@ -111,6 +111,7 @@
|
|||
### text
|
||||
- simple text input
|
||||
- key `"multiline"` allows to enter multiple lines of text (Default: `False`)
|
||||
- key `"placeholder"` allows to show text inside input when is empty (Default: `None`)
|
||||
|
||||
```
|
||||
{
|
||||
|
|
|
|||
|
|
@ -906,6 +906,7 @@ class TextWidget(QtWidgets.QWidget, InputObject):
|
|||
self.initial_attributes(input_data, parent, as_widget)
|
||||
|
||||
self.multiline = input_data.get("multiline", False)
|
||||
placeholder = input_data.get("placeholder")
|
||||
|
||||
layout = QtWidgets.QHBoxLayout(self)
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
|
|
@ -916,6 +917,9 @@ class TextWidget(QtWidgets.QWidget, InputObject):
|
|||
else:
|
||||
self.text_input = QtWidgets.QLineEdit(self)
|
||||
|
||||
if placeholder:
|
||||
self.text_input.setPlaceholderText(placeholder)
|
||||
|
||||
self.setFocusProxy(self.text_input)
|
||||
|
||||
layout_kwargs = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue