diff --git a/app/qml/PreprocessedTerminal.qml b/app/qml/PreprocessedTerminal.qml index 1958ca8..81eb705 100644 --- a/app/qml/PreprocessedTerminal.qml +++ b/app/qml/PreprocessedTerminal.qml @@ -27,7 +27,7 @@ import QMLTermWidget 2.0 import "menus" import "utils.js" as Utils -Item{ +Item { id: preprocessedTerminal signal sessionFinished() diff --git a/app/qml/SizeOverlay.qml b/app/qml/SizeOverlay.qml index 247534d..055da64 100644 --- a/app/qml/SizeOverlay.qml +++ b/app/qml/SizeOverlay.qml @@ -21,15 +21,13 @@ import QtQuick 2.2 Rectangle { property size terminalSize - property real topOpacity: 0.6 + property real topOpacity: 0.5 width: textSize.width * 2 height: textSize.height * 2 radius: 5 - border.width: 2 - border.color: "white" color: "black" - opacity: sizetimer.running ? 0.6 : 0.0 + opacity: sizetimer.running ? 0.5 : 0.0 Behavior on opacity { NumberAnimation { diff --git a/app/qml/TerminalTabs.qml b/app/qml/TerminalTabs.qml index 3ea20b5..5a917b6 100644 --- a/app/qml/TerminalTabs.qml +++ b/app/qml/TerminalTabs.qml @@ -20,16 +20,16 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts +import QtQml.Models Item { id: tabsRoot readonly property int innerPadding: 6 readonly property string currentTitle: tabsModel.get(currentIndex).title ?? "cool-retro-term" - readonly property size terminalSize: stack.currentItem ? stack.currentItem.terminalSize : Qt.size(0, 0) property alias currentIndex: tabBar.currentIndex readonly property int count: tabsModel.count - property var hostWindow + property size terminalSize: Qt.size(0, 0) function normalizeTitle(rawTitle) { if (rawTitle === undefined || rawTitle === null) { @@ -45,7 +45,7 @@ Item { function closeTab(index) { if (tabsModel.count <= 1) { - hostWindow.close() + terminalWindow.close() return } @@ -132,10 +132,20 @@ Item { TerminalContainer { id: terminalContainer hasFocus: terminalWindow.active && StackLayout.isCurrentItem + + onTerminalSizeChanged: updateTerminalSize() + onTitleChanged: tabsModel.setProperty(index, "title", normalizeTitle(title)) Layout.fillWidth: true Layout.fillHeight: true onSessionFinished: tabsRoot.closeTab(index) + + function updateTerminalSize() { + // Every tab will have the same size so we can simply take the first one. + if (index == 0) { + tabsRoot.terminalSize = terminalSize + } + } } } } diff --git a/app/qml/TerminalWindow.qml b/app/qml/TerminalWindow.qml index 78b559a..003a50e 100644 --- a/app/qml/TerminalWindow.qml +++ b/app/qml/TerminalWindow.qml @@ -73,7 +73,6 @@ ApplicationWindow { id: terminalTabs width: parent.width height: (parent.height + Math.abs(y)) - hostWindow: terminalWindow } Loader { anchors.centerIn: parent