1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2026-02-08 00:32:27 +00:00

Fix fullscreen not tied to multiple windows.

This commit is contained in:
Filippo Scognamiglio
2026-01-17 18:35:05 +01:00
parent e70268bb73
commit 5795aeb6b7
4 changed files with 18 additions and 17 deletions

View File

@@ -40,7 +40,6 @@ QtObject {
property bool isMacOS: Qt.platform.os === "osx" property bool isMacOS: Qt.platform.os === "osx"
// GENERAL SETTINGS /////////////////////////////////////////////////////// // GENERAL SETTINGS ///////////////////////////////////////////////////////
property bool fullscreen: false
property bool showMenubar: false property bool showMenubar: false
property bool showTerminalSize: true property bool showTerminalSize: true
@@ -864,17 +863,12 @@ QtObject {
var profileArgPosition = args.indexOf("--profile") var profileArgPosition = args.indexOf("--profile")
if (profileArgPosition !== -1) { if (profileArgPosition !== -1) {
var profileIndex = getProfileIndexByName( var profileIndex = getProfileIndexByName(args[profileArgPosition + 1])
args[profileArgPosition + 1]) if (profileIndex !== -1) {
if (profileIndex !== -1)
loadProfile(profileIndex) loadProfile(profileIndex)
else } else {
console.log("Warning: selected profile is not valid; ignoring it") console.log("Warning: selected profile is not valid; ignoring it")
} }
if (args.indexOf("--fullscreen") !== -1) {
fullscreen = true
showMenubar = false
} }
initializedSettings() initializedSettings()

View File

@@ -201,7 +201,7 @@ Item{
Loader { Loader {
id: menuLoader id: menuLoader
sourceComponent: (appSettings.isMacOS || appSettings.showMenubar ? shortContextMenu : fullContextMenu) sourceComponent: (appSettings.isMacOS || (appSettings.showMenubar && !terminalWindow.fullscreen) ? shortContextMenu : fullContextMenu)
} }
property alias contextmenu: menuLoader.item property alias contextmenu: menuLoader.item

View File

@@ -40,14 +40,14 @@ ApplicationWindow {
visible: false visible: false
property bool fullscreen: appSettings.fullscreen property bool fullscreen: false
onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed) onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed)
menuBar: qtquickMenuLoader.item menuBar: qtquickMenuLoader.item
Loader { Loader {
id: qtquickMenuLoader id: qtquickMenuLoader
active: !appSettings.isMacOS && appSettings.showMenubar active: !appSettings.isMacOS && (appSettings.showMenubar && !fullscreen)
sourceComponent: WindowMenu { } sourceComponent: WindowMenu { }
} }
@@ -57,6 +57,12 @@ ApplicationWindow {
onTriggered: terminalTabs.addTab() onTriggered: terminalTabs.addTab()
} }
Connections {
target: fullscreenAction
enabled: terminalWindow.active
onTriggered: terminalWindow.fullscreen = !terminalWindow.fullscreen
}
property real normalizedWindowScale: 1024 / ((0.5 * width + 0.5 * height)) property real normalizedWindowScale: 1024 / ((0.5 * width + 0.5 * height))
color: "#00000000" color: "#00000000"

View File

@@ -65,11 +65,10 @@ QtObject {
text: qsTr("Fullscreen") text: qsTr("Fullscreen")
enabled: !appSettings.isMacOS enabled: !appSettings.isMacOS
shortcut: "Alt+F11" 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 { property Action newWindowAction: Action {
text: qsTr("New Window") text: qsTr("New Window")
shortcut: "Ctrl+Shift+N" shortcut: "Ctrl+Shift+N"
@@ -127,11 +126,13 @@ QtObject {
} }
function createWindow() { function createWindow() {
var window = windowComponent.createObject(null) var useFullscreen = initialFullscreenRequested
var window = windowComponent.createObject(null, { fullscreen: useFullscreen })
if (!window) if (!window)
return return
windowsModel.append({ window: window }) windowsModel.append({ window: window })
initialFullscreenRequested = false
window.show() window.show()
window.requestActivate() window.requestActivate()
} }