add base console

This commit is contained in:
2026-11-14 12:38:06 +03:00
parent 6b159108af
commit a371de94b8
4 changed files with 163 additions and 0 deletions

View File

@@ -32,6 +32,8 @@ qt_add_qml_module(apparchpack
qml/components/pages/UpdatePg.qml
qml/components/pages/InstallPg.qml
qml/components/pages/DeletePg.qml
qml/components/console/ConsoleBar.qml
qml/components/console/ConsolePanel.qml
SOURCES
cpp/utils/utils.hpp
cpp/utils/utils.cpp

View File

@@ -19,6 +19,7 @@ ApplicationWindow {
color: Theme.color1
property string packageManager: "yay"
property bool consoleOpen: false
ColumnLayout {
id: mainLayout
@@ -67,5 +68,13 @@ ApplicationWindow {
id: pgDelete
}
}
readonly property string consoleTitle: tabs.currentIndex === 0 ? "Консоль обновления" : tabs.currentIndex === 1 ? "Консоль установки" : "Консоль удаления"
Components.ConsoleBar {
title: consoleTitle
consoleOpen: consoleOpen
}
Components.ConsolePanel {}
}
}

View File

@@ -0,0 +1,53 @@
import QtQuick
import QtQuick.Layouts
Rectangle {
id: root
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: 26
color: barMouse.containsMouse ? "#313244" : "#1e1e2e"
z: 50
property string title: ""
property bool consoleOpen: false
Rectangle {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
height: 1
color: "#313244"
}
RowLayout {
anchors.fill: parent
anchors.leftMargin: 12
anchors.rightMargin: 12
spacing: 8
Text {
text: root.consoleOpen ? "▼ Скрыть консоль" : "▲ " + root.title
color: "#a6adc8"
font.pixelSize: 11
}
Item { Layout.fillWidth: true }
Text {
text: "root.consoleStatus"
color: "#f9e2af"
font.pixelSize: 11
}
}
MouseArea {
id: barMouse
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
// onClicked: root.consoleOpen = !root.consoleOpen
}
}

View File

@@ -0,0 +1,99 @@
import QtQuick
import QtQuick.Layouts
Rectangle {
id: root
anchors.left: parent.left
anchors.right: parent.right
// anchors.bottom: consoleBar.top
visible: height > 0
clip: true
color: "#1e1e2e"
z: 40
property string title: ""
Behavior on height { NumberAnimation { duration: 250; easing.type: Easing.InOutQuad } }
Behavior on opacity { NumberAnimation { duration: 180 } }
MouseArea {
anchors.fill: parent
}
Rectangle {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
height: 1
color: "#313244"
}
ColumnLayout {
anchors.fill: parent
anchors.margins: 12
spacing: 8
RowLayout {
Layout.fillWidth: true
spacing: 6
Text {
text: root.title
color: "#cdd6f4"
font.pixelSize: 13
font.bold: true
}
Item { Layout.fillWidth: true }
Text {
text: "root.consoleStatus"
color: "#f9e2af"
font.pixelSize: 11
}
}
Rectangle {
Layout.fillWidth: true
height: 1
color: "#313244"
}
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
// }
}
}
}