add console impl close/open

This commit is contained in:
2026-11-14 13:19:42 +03:00
parent a371de94b8
commit 9cb13ba392
4 changed files with 54 additions and 56 deletions

View File

@@ -7,47 +7,50 @@ Rectangle {
anchors.right: parent.right
anchors.bottom: parent.bottom
height: 26
color: barMouse.containsMouse ? "#313244" : "#1e1e2e"
color: mouseArea.containsMouse ? Theme.color9 : Theme.color8
z: 50
property string title: ""
property string status: ""
property bool consoleOpen: false
signal toggled()
Rectangle {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
height: 1
color: "#313244"
color: Theme.color5
}
RowLayout {
anchors.fill: parent
anchors.leftMargin: 12
anchors.rightMargin: 12
spacing: 8
anchors.leftMargin: Theme.baseMargins
anchors.rightMargin: Theme.baseMargins
spacing: Theme.baseSpacing
Text {
text: root.consoleOpen ? "▼ Скрыть консоль" : "▲ " + root.title
color: "#a6adc8"
color: Theme.color3
font.pixelSize: 11
}
Item { Layout.fillWidth: true }
Text {
text: "root.consoleStatus"
color: "#f9e2af"
text: root.status
color: Theme.color7
font.pixelSize: 11
}
}
MouseArea {
id: barMouse
id: mouseArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
// onClicked: root.consoleOpen = !root.consoleOpen
onClicked: root.toggled()
}
}

View File

@@ -5,13 +5,17 @@ Rectangle {
id: root
anchors.left: parent.left
anchors.right: parent.right
// anchors.bottom: consoleBar.top
visible: height > 0
clip: true
color: "#1e1e2e"
color: Theme.color8
height: root.consoleOpen ? root.consoleHeight : 0
opacity: root.consoleOpen ? 1 : 0
z: 40
property string title: ""
property string status: ""
property int consoleHeight: 320
property bool consoleOpen: false
Behavior on height { NumberAnimation { duration: 250; easing.type: Easing.InOutQuad } }
Behavior on opacity { NumberAnimation { duration: 180 } }
@@ -25,7 +29,7 @@ Rectangle {
anchors.left: parent.left
anchors.right: parent.right
height: 1
color: "#313244"
color: Theme.color5
}
ColumnLayout {
@@ -39,7 +43,7 @@ Rectangle {
Text {
text: root.title
color: "#cdd6f4"
color: Theme.color2
font.pixelSize: 13
font.bold: true
}
@@ -47,53 +51,21 @@ Rectangle {
Item { Layout.fillWidth: true }
Text {
text: "root.consoleStatus"
color: "#f9e2af"
text: root.status
color: Theme.color7
font.pixelSize: 11
}
}
Rectangle {
Layout.fillWidth: true
height: 1
color: "#313244"
implicitHeight: 1
color: Theme.color5
}
Item {
Layout.fillWidth: true
Layout.fillHeight: true
// ListView {
// id: logView
// anchors.fill: parent
// clip: true
// model: root.consoleLog
// onModelChanged: positionViewAtEnd()
// spacing: 2
// onCountChanged: positionViewAtEnd()
//
// ScrollBar.vertical: ScrollBar {
// policy: ScrollBar.AsNeeded
// width: 6
// }
//
// delegate: Text {
// width: logView.width
// text: modelData
// color: "#a6adc8"
// font.family: "monospace"
// font.pixelSize: 11
// wrapMode: Text.WrapAnywhere
// }
// }
//
// Text {
// anchors.centerIn: parent
// text: root.consolePlaceholder
// color: "#585b70"
// font.pixelSize: 12
// visible: root.consoleLog.length === 0
// }
}
}
}