add console listview
This commit is contained in:
@@ -36,6 +36,7 @@ qt_add_qml_module(apparchpack
|
|||||||
qml/console/ConsoleBar.qml
|
qml/console/ConsoleBar.qml
|
||||||
qml/console/ConsolePanel.qml
|
qml/console/ConsolePanel.qml
|
||||||
qml/lists/PackageList.qml
|
qml/lists/PackageList.qml
|
||||||
|
qml/lists/ConsoleList.qml
|
||||||
qml/dialogs/PasswordDialog.qml
|
qml/dialogs/PasswordDialog.qml
|
||||||
SOURCES
|
SOURCES
|
||||||
cpp/utils/utils.hpp
|
cpp/utils/utils.hpp
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import "../lists" as Lists
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
@@ -68,28 +69,8 @@ Rectangle {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
// ListView {
|
Lists.ConsoleList {}
|
||||||
// id: logView
|
|
||||||
// clip: true
|
|
||||||
// spacing: 2
|
|
||||||
// model: root.consoleLogData
|
|
||||||
// onModelChanged: positionViewAtEnd()
|
|
||||||
// onCountChanged: positionViewAtEnd()
|
|
||||||
//
|
|
||||||
// ScrollBar.vertical: ScrollBar {
|
|
||||||
// policy: ScrollBar.AsNeeded
|
|
||||||
// width: 6
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// delegate: Text {
|
|
||||||
// width: logView.width
|
|
||||||
// text: modelData
|
|
||||||
// color: Theme.color3
|
|
||||||
// font.family: "monospace"
|
|
||||||
// font.pixelSize: 11
|
|
||||||
// wrapMode: Text.WrapAnywhere
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|||||||
34
qml/lists/ConsoleList.qml
Normal file
34
qml/lists/ConsoleList.qml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import archpack
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
id: root
|
||||||
|
clip: true
|
||||||
|
spacing: 2
|
||||||
|
model: consoleLogData
|
||||||
|
onModelChanged: positionViewAtEnd()
|
||||||
|
onCountChanged: positionViewAtEnd()
|
||||||
|
|
||||||
|
property var consoleLogData: ""
|
||||||
|
|
||||||
|
ScrollBar.vertical: ScrollBar {
|
||||||
|
policy: ScrollBar.AsNeeded
|
||||||
|
width: 6
|
||||||
|
}
|
||||||
|
|
||||||
|
delegate: Text {
|
||||||
|
width: root.width
|
||||||
|
text: modelData
|
||||||
|
color: Theme.color3
|
||||||
|
font.family: "monospace"
|
||||||
|
font.pixelSize: 11
|
||||||
|
wrapMode: Text.WrapAnywhere
|
||||||
|
|
||||||
|
// из-зa предупреждение qmllint
|
||||||
|
required property var modelData
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ Item {
|
|||||||
radius: 7
|
radius: 7
|
||||||
color: modelData.updating ? "#313244" : "transparent"
|
color: modelData.updating ? "#313244" : "transparent"
|
||||||
|
|
||||||
// из-зи предупреждение qmllint
|
// из-зa предупреждение qmllint
|
||||||
required property var modelData
|
required property var modelData
|
||||||
|
|
||||||
Behavior on color { ColorAnimation { duration: 300 } }
|
Behavior on color { ColorAnimation { duration: 300 } }
|
||||||
|
|||||||
Reference in New Issue
Block a user