From b1c1776bc3923983d55ea1ab9eaf8351087640bd Mon Sep 17 00:00:00 2001 From: Alex Spataru Date: Mon, 11 Nov 2024 12:13:02 -0500 Subject: [PATCH] Allow setting minimum cols/rows for terminal widget --- app/qml/Dialogs/ExternalConsole.qml | 2 ++ app/qml/Widgets/Dashboard/Terminal.qml | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/qml/Dialogs/ExternalConsole.qml b/app/qml/Dialogs/ExternalConsole.qml index 3096d72b..19ba4d5a 100644 --- a/app/qml/Dialogs/ExternalConsole.qml +++ b/app/qml/Dialogs/ExternalConsole.qml @@ -139,6 +139,8 @@ Window { Dashboard.Terminal { id: terminal + minimumRows: 5 + minimumColumns: 80 anchors.margins: 8 anchors.fill: parent } diff --git a/app/qml/Widgets/Dashboard/Terminal.qml b/app/qml/Widgets/Dashboard/Terminal.qml index 82134808..914c8b6a 100644 --- a/app/qml/Widgets/Dashboard/Terminal.qml +++ b/app/qml/Widgets/Dashboard/Terminal.qml @@ -41,6 +41,12 @@ Item { root.forceActiveFocus() } + // + // Custom properties + // + property int minimumRows: 24 + property int minimumColumns: 80 + // // Save settings // @@ -184,8 +190,8 @@ Item { vt100emulation: true Layout.fillWidth: true Layout.fillHeight: true - Layout.minimumWidth: terminal.charWidth * 80 - Layout.minimumHeight: terminal.charHeight * 24 + Layout.minimumHeight: terminal.charHeight * root.minimumRows + Layout.minimumWidth: terminal.charWidth * root.minimumColumns Rectangle { border.width: 1