rename packagelist to updatelist and fix visible preloader
This commit is contained in:
@@ -43,7 +43,7 @@ qt_add_qml_module(apparchpack
|
|||||||
qml/pages/DeletePg.qml
|
qml/pages/DeletePg.qml
|
||||||
qml/console/ConsoleBar.qml
|
qml/console/ConsoleBar.qml
|
||||||
qml/console/ConsolePanel.qml
|
qml/console/ConsolePanel.qml
|
||||||
qml/lists/PackageList.qml
|
qml/lists/UpdateList.qml
|
||||||
qml/lists/ConsoleList.qml
|
qml/lists/ConsoleList.qml
|
||||||
qml/dialogs/PasswordDialog.qml
|
qml/dialogs/PasswordDialog.qml
|
||||||
SOURCES
|
SOURCES
|
||||||
|
|||||||
1
Main.qml
1
Main.qml
@@ -87,6 +87,7 @@ ApplicationWindow {
|
|||||||
id: pgUpdate
|
id: pgUpdate
|
||||||
packageCount: ProcessManager.packageCount
|
packageCount: ProcessManager.packageCount
|
||||||
status: ProcessManager.status
|
status: ProcessManager.status
|
||||||
|
visiblePreLoader: ProcessManager.status === ProcessManager.Status.Checking
|
||||||
packages: ProcessManager.packages
|
packages: ProcessManager.packages
|
||||||
onUpdate: {
|
onUpdate: {
|
||||||
if (ProcessManager.passwordEmpty())
|
if (ProcessManager.passwordEmpty())
|
||||||
|
|||||||
@@ -7,14 +7,11 @@ import archpack
|
|||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property int status: 0
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
spacing: 8
|
spacing: 8
|
||||||
|
|
||||||
BusyIndicator {
|
BusyIndicator {
|
||||||
running: root.status != ProcessManager.Status.Null
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
implicitWidth: 24
|
implicitWidth: 24
|
||||||
implicitHeight: 24
|
implicitHeight: 24
|
||||||
|
|||||||
@@ -1,104 +0,0 @@
|
|||||||
pragma ComponentBehavior: Bound
|
|
||||||
|
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Controls
|
|
||||||
import archpack
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property var packages: []
|
|
||||||
|
|
||||||
ListView {
|
|
||||||
id: listView
|
|
||||||
anchors.fill: parent
|
|
||||||
// свойство, которое обрезает всё содержимое списка по его границам. Без него элементы списка (делегаты) могут визуально «вылезать» за пределы ListView, наезжая на другие элементы интерфейса.
|
|
||||||
clip: true
|
|
||||||
spacing: 2
|
|
||||||
model: root.packages
|
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBar {
|
|
||||||
policy: ScrollBar.AsNeeded
|
|
||||||
width: 6
|
|
||||||
}
|
|
||||||
|
|
||||||
delegate: Rectangle {
|
|
||||||
id: delegate
|
|
||||||
width: listView.width
|
|
||||||
height: 32
|
|
||||||
radius: 7
|
|
||||||
color: modelData.updating ? "#313244" : "transparent"
|
|
||||||
|
|
||||||
// из-зa предупреждение qmllint
|
|
||||||
required property var modelData
|
|
||||||
|
|
||||||
Behavior on color { ColorAnimation { duration: 300 } }
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: 8
|
|
||||||
anchors.rightMargin: 8
|
|
||||||
spacing: 8
|
|
||||||
|
|
||||||
Text {
|
|
||||||
text: delegate.modelData.name
|
|
||||||
font.pixelSize: 13
|
|
||||||
font.family: "monospace"
|
|
||||||
color: delegate.modelData.updated ? Theme.color2 : delegate.modelData.updating ? Theme.color7 : Theme.color3
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
Behavior on color { ColorAnimation { duration: 300 } }
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
text: delegate.modelData.version
|
|
||||||
font.pixelSize: 11
|
|
||||||
color: Theme.color12
|
|
||||||
visible: delegate.modelData.version !== ""
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
text: "○"
|
|
||||||
font.pixelSize: 16
|
|
||||||
font.bold: true
|
|
||||||
color: Theme.color4
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
Layout.preferredWidth: 18
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
visible: !delegate.modelData.updating && !delegate.modelData.updated
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
text: "⟳"
|
|
||||||
font.pixelSize: 14
|
|
||||||
color: Theme.color7
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
Layout.preferredWidth: 18
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
visible: delegate.modelData.updating
|
|
||||||
|
|
||||||
RotationAnimation on rotation {
|
|
||||||
running: delegate.modelData.updating
|
|
||||||
loops: Animation.Infinite
|
|
||||||
from: 0
|
|
||||||
to: 360
|
|
||||||
duration: 1000
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
text: "✓"
|
|
||||||
font.pixelSize: 16
|
|
||||||
font.bold: true
|
|
||||||
color: Theme.color13
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
Layout.preferredWidth: 18
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
visible: delegate.modelData.updated && !delegate.modelData.updating
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
104
qml/lists/UpdateList.qml
Normal file
104
qml/lists/UpdateList.qml
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Controls
|
||||||
|
import archpack
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property var packages: []
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
id: listView
|
||||||
|
anchors.fill: parent
|
||||||
|
// свойство, которое обрезает всё содержимое списка по его границам. Без него элементы списка (делегаты) могут визуально «вылезать» за пределы ListView, наезжая на другие элементы интерфейса.
|
||||||
|
clip: true
|
||||||
|
spacing: 2
|
||||||
|
model: root.packages
|
||||||
|
|
||||||
|
ScrollBar.vertical: ScrollBar {
|
||||||
|
policy: ScrollBar.AsNeeded
|
||||||
|
width: 6
|
||||||
|
}
|
||||||
|
|
||||||
|
delegate: Rectangle {
|
||||||
|
id: delegate
|
||||||
|
width: listView.width
|
||||||
|
height: 32
|
||||||
|
radius: 7
|
||||||
|
color: modelData.updating ? "#313244" : "transparent"
|
||||||
|
|
||||||
|
// из-зa предупреждение qmllint
|
||||||
|
required property var modelData
|
||||||
|
|
||||||
|
Behavior on color { ColorAnimation { duration: 300 } }
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.leftMargin: 8
|
||||||
|
anchors.rightMargin: 8
|
||||||
|
spacing: 8
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: delegate.modelData.name
|
||||||
|
font.pixelSize: 13
|
||||||
|
font.family: "monospace"
|
||||||
|
color: delegate.modelData.updated ? Theme.color2 : delegate.modelData.updating ? Theme.color7 : Theme.color3
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
Behavior on color { ColorAnimation { duration: 300 } }
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: delegate.modelData.version
|
||||||
|
font.pixelSize: 11
|
||||||
|
color: Theme.color12
|
||||||
|
visible: delegate.modelData.version !== ""
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: "○"
|
||||||
|
font.pixelSize: 16
|
||||||
|
font.bold: true
|
||||||
|
color: Theme.color4
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
Layout.preferredWidth: 18
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
visible: !delegate.modelData.updating && !delegate.modelData.updated
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: "⟳"
|
||||||
|
font.pixelSize: 14
|
||||||
|
color: Theme.color7
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
Layout.preferredWidth: 18
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
visible: delegate.modelData.updating
|
||||||
|
|
||||||
|
RotationAnimation on rotation {
|
||||||
|
running: delegate.modelData.updating
|
||||||
|
loops: Animation.Infinite
|
||||||
|
from: 0
|
||||||
|
to: 360
|
||||||
|
duration: 1000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: "✓"
|
||||||
|
font.pixelSize: 16
|
||||||
|
font.bold: true
|
||||||
|
color: Theme.color13
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
Layout.preferredWidth: 18
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
visible: delegate.modelData.updated && !delegate.modelData.updating
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -9,6 +9,7 @@ Item {
|
|||||||
|
|
||||||
property int packageCount: 0
|
property int packageCount: 0
|
||||||
property int status: 0
|
property int status: 0
|
||||||
|
property bool visiblePreLoader: true
|
||||||
property var packages: []
|
property var packages: []
|
||||||
signal update()
|
signal update()
|
||||||
|
|
||||||
@@ -20,15 +21,14 @@ Item {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
Lists.PackageList {
|
Lists.UpdateList {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
packages: root.packages
|
packages: root.packages
|
||||||
}
|
}
|
||||||
|
|
||||||
Components.PreLoader {
|
Components.PreLoader {
|
||||||
visible: root.status === ProcessManager.Status.Checking
|
visible: root.visiblePreLoader
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
status: root.status
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user