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

Removed application style sheet #1048

Merged
merged 10 commits into from
Dec 6, 2023
4 changes: 0 additions & 4 deletions nexus-constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ def closeEvent(self, event: QCloseEvent) -> None:
if "help" in parser.parse_args():
exit(0)
logging.basicConfig(level=logging.INFO)
if sys.platform == "darwin":
QApplication.setStyle(
"Fusion"
) # this helps macOS but causes Linux GUI to be unusable
QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)
surfaceFormat = QSurfaceFormat()
surfaceFormat.setSwapInterval(1)
Expand Down
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
2 changes: 1 addition & 1 deletion nx-class-documentation/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ <h1>User Manual and Reference Documentation<a class="headerlink" href="#user-man
</div>
<hr class="docutils" />
<p class="rubric">Publishing Information</p>
<p>This manual built Nov 23, 2023.</p>
<p>This manual built Nov 30, 2023.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>This document is available in these formats online:</p>
Expand Down
2 changes: 1 addition & 1 deletion nx-class-documentation/html/searchindex.js

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ def test_GIVEN_invalid_WHEN_validating_line_edit_THEN_line_edit_turns_red():
def test_GIVEN_valid_WHEN_validating_line_edit_THEN_line_edit_turns_white():
line_edit = DummyLineEdit()
validate_line_edit(line_edit, True)
assert (
"background-color: "
+ ("#333333" if os.uname().sysname == "Darwin" else "#FFFFFF")
in line_edit.stylesheet
)
assert ("" in line_edit.stylesheet)


def test_GIVEN_valid_WHEN_validating_line_edit_with_tooltip_THEN_line_edit_tooltip_is_changed():
Expand Down
2 changes: 1 addition & 1 deletion ui_tests/ui_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
LINE_EDIT = "QLineEdit "
SPIN_BOX = "QSpinBox "
RED_LINE_EDIT_STYLE_SHEET = LINE_EDIT + RED_BACKGROUND
WHITE_LINE_EDIT_STYLE_SHEET = LINE_EDIT + WHITE_BACKGROUND
WHITE_LINE_EDIT_STYLE_SHEET = ""
RED_SPIN_BOX_STYLE_SHEET = SPIN_BOX + RED_BACKGROUND
WHITE_SPIN_BOX_STYLE_SHEET = SPIN_BOX + WHITE_BACKGROUND

Expand Down