cool-retro-term
53 строки · 1.6 Кб
1/*******************************************************************************
2* Copyright (c) 2013-2021 "Filippo Scognamiglio"
3* https://github.com/Swordfish90/cool-retro-term
4*
5* This file is part of cool-retro-term.
6*
7* cool-retro-term is free software: you can redistribute it and/or modify
8* it under the terms of the GNU General Public License as published by
9* the Free Software Foundation, either version 3 of the License, or
10* (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU General Public License for more details.
16*
17* You should have received a copy of the GNU General Public License
18* along with this program. If not, see <http://www.gnu.org/licenses/>.
19*******************************************************************************/
20import QtQuick 2.2
21
22Rectangle {
23property size terminalSize
24property real topOpacity: 0.6
25
26width: textSize.width * 2
27height: textSize.height * 2
28radius: 5
29border.width: 2
30border.color: "white"
31color: "black"
32opacity: sizetimer.running ? 0.6 : 0.0
33
34Behavior on opacity {
35NumberAnimation {
36duration: 200
37}
38}
39
40onTerminalSizeChanged: sizetimer.restart()
41
42Text {
43id: textSize
44anchors.centerIn: parent
45color: "white"
46text: terminalSize.width + "x" + terminalSize.height
47}
48Timer {
49id: sizetimer
50interval: 1000
51running: false
52}
53}
54