From 3994a29bf7a7c83ee8636680e3a0372f07d2d52a Mon Sep 17 00:00:00 2001 From: Igor <13848605+vint2k@users.noreply.github.com> Date: Mon, 4 May 2026 23:48:45 +0400 Subject: [PATCH] Fix macOS JSON editor window controls --- Furious/Window/TextEditorWindow.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Furious/Window/TextEditorWindow.py b/Furious/Window/TextEditorWindow.py index 0261255..7cd5bc8 100644 --- a/Furious/Window/TextEditorWindow.py +++ b/Furious/Window/TextEditorWindow.py @@ -76,7 +76,19 @@ class TextEditorWindow(AppQMainWindow): super().__init__(*args, **kwargs) self.customWindowTitle = '' - self.setWindowModality(QtCore.Qt.WindowModality.WindowModal) + if PLATFORM == 'Darwin': + # Window-modal child windows are rendered as macOS sheets + # without traffic-light controls. + self.setWindowFlags( + self.windowFlags() + | QtCore.Qt.WindowType.Window + | QtCore.Qt.WindowType.WindowTitleHint + | QtCore.Qt.WindowType.WindowSystemMenuHint + | QtCore.Qt.WindowType.WindowMinimizeButtonHint + | QtCore.Qt.WindowType.WindowCloseButtonHint + ) + else: + self.setWindowModality(QtCore.Qt.WindowModality.WindowModal) self.setFixedSize(450, int(450 * GOLDEN_RATIO)) # Current editing index