mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 13:24:54 +01:00
Merge pull request #2399 from pypeclub/bugfix/placeholder_palette_change_fix
Fix: Placeholder Input color set fix
This commit is contained in:
commit
897fa65ee9
1 changed files with 10 additions and 15 deletions
|
|
@ -12,22 +12,17 @@ class PlaceholderLineEdit(QtWidgets.QLineEdit):
|
|||
"""Set placeholder color of QLineEdit in Qt 5.12 and higher."""
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(PlaceholderLineEdit, self).__init__(*args, **kwargs)
|
||||
self._first_show = True
|
||||
|
||||
def showEvent(self, event):
|
||||
super(PlaceholderLineEdit, self).showEvent(event)
|
||||
if self._first_show:
|
||||
self._first_show = False
|
||||
# Change placeholder palette color
|
||||
if hasattr(QtGui.QPalette, "PlaceholderText"):
|
||||
filter_palette = self.palette()
|
||||
if hasattr(filter_palette, "PlaceholderText"):
|
||||
color_obj = get_objected_colors()["font"]
|
||||
color = color_obj.get_qcolor()
|
||||
color.setAlpha(67)
|
||||
filter_palette.setColor(
|
||||
filter_palette.PlaceholderText,
|
||||
color
|
||||
)
|
||||
self.setPalette(filter_palette)
|
||||
color_obj = get_objected_colors()["font"]
|
||||
color = color_obj.get_qcolor()
|
||||
color.setAlpha(67)
|
||||
filter_palette.setColor(
|
||||
QtGui.QPalette.PlaceholderText,
|
||||
color
|
||||
)
|
||||
self.setPalette(filter_palette)
|
||||
|
||||
|
||||
class ImageButton(QtWidgets.QPushButton):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue