diff --git a/app/qml/ApplicationSettings.qml b/app/qml/ApplicationSettings.qml index 655385a..b975a22 100644 --- a/app/qml/ApplicationSettings.qml +++ b/app/qml/ApplicationSettings.qml @@ -40,7 +40,6 @@ QtObject { property bool isMacOS: Qt.platform.os === "osx" // GENERAL SETTINGS /////////////////////////////////////////////////////// - property bool fullscreen: false property bool showMenubar: false property bool showTerminalSize: true @@ -864,17 +863,12 @@ QtObject { var profileArgPosition = args.indexOf("--profile") if (profileArgPosition !== -1) { - var profileIndex = getProfileIndexByName( - args[profileArgPosition + 1]) - if (profileIndex !== -1) + var profileIndex = getProfileIndexByName(args[profileArgPosition + 1]) + if (profileIndex !== -1) { loadProfile(profileIndex) - else + } else { console.log("Warning: selected profile is not valid; ignoring it") - } - - if (args.indexOf("--fullscreen") !== -1) { - fullscreen = true - showMenubar = false + } } initializedSettings() diff --git a/app/qml/PreprocessedTerminal.qml b/app/qml/PreprocessedTerminal.qml index 3b084b3..36917e3 100644 --- a/app/qml/PreprocessedTerminal.qml +++ b/app/qml/PreprocessedTerminal.qml @@ -201,7 +201,7 @@ Item{ Loader { id: menuLoader - sourceComponent: (appSettings.isMacOS || appSettings.showMenubar ? shortContextMenu : fullContextMenu) + sourceComponent: (appSettings.isMacOS || (appSettings.showMenubar && !terminalWindow.fullscreen) ? shortContextMenu : fullContextMenu) } property alias contextmenu: menuLoader.item diff --git a/app/qml/TerminalWindow.qml b/app/qml/TerminalWindow.qml index 8cc1c31..78b559a 100644 --- a/app/qml/TerminalWindow.qml +++ b/app/qml/TerminalWindow.qml @@ -40,14 +40,14 @@ ApplicationWindow { visible: false - property bool fullscreen: appSettings.fullscreen + property bool fullscreen: false onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed) menuBar: qtquickMenuLoader.item Loader { id: qtquickMenuLoader - active: !appSettings.isMacOS && appSettings.showMenubar + active: !appSettings.isMacOS && (appSettings.showMenubar && !fullscreen) sourceComponent: WindowMenu { } } @@ -57,6 +57,12 @@ ApplicationWindow { onTriggered: terminalTabs.addTab() } + Connections { + target: fullscreenAction + enabled: terminalWindow.active + onTriggered: terminalWindow.fullscreen = !terminalWindow.fullscreen + } + property real normalizedWindowScale: 1024 / ((0.5 * width + 0.5 * height)) color: "#00000000" diff --git a/app/qml/main.qml b/app/qml/main.qml index db0be61..53c24b9 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -65,11 +65,10 @@ QtObject { text: qsTr("Fullscreen") enabled: !appSettings.isMacOS shortcut: "Alt+F11" - onTriggered: appSettings.fullscreen = !appSettings.fullscreen - checkable: true - checked: appSettings.fullscreen } + property bool initialFullscreenRequested: Qt.application.arguments.indexOf("--fullscreen") !== -1 + property Action newWindowAction: Action { text: qsTr("New Window") shortcut: "Ctrl+Shift+N" @@ -127,11 +126,13 @@ QtObject { } function createWindow() { - var window = windowComponent.createObject(null) + var useFullscreen = initialFullscreenRequested + var window = windowComponent.createObject(null, { fullscreen: useFullscreen }) if (!window) return windowsModel.append({ window: window }) + initialFullscreenRequested = false window.show() window.requestActivate() }