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:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user