Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2399 from pypeclub/bugfix/placeholder_palette_cha…
Browse files Browse the repository at this point in the history
…nge_fix

Fix: Placeholder Input color set fix
  • Loading branch information
iLLiCiTiT authored Dec 14, 2021
2 parents d69d8f3 + c4106bf commit 897fa65
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions openpype/tools/utils/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 897fa65

Please sign in to comment.