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

Commit

Permalink
a better change to colour text for light, dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ggoneiESS committed Nov 30, 2023
1 parent adaeebd commit 505644c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nexus_constructor/ui_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ def validate_line_edit(
:param tooltip_on_reject: Tooltip to display if line edit is invalid.
:return: None.
"""
colour = "#FFFFFF" if is_valid else "#f6989d"
if platform == "darwin" and colour == "#FFFFFF":
colour = "#333333"
line_edit.setStyleSheet(f"QLineEdit {{ background-color: {colour} }}")
if is_valid:
line_edit.setStyleSheet("")
else:
line_edit.setStyleSheet("QLineEdit {{ background-color: #f6989d }}")
if "Suggestion" in tooltip_on_reject and callable(suggestion_callable):
tooltip_on_reject += suggestion_callable()
line_edit.setToolTip(tooltip_on_accept) if is_valid else line_edit.setToolTip(
Expand Down

0 comments on commit 505644c

Please sign in to comment.