104 lines
2.8 KiB
QML
104 lines
2.8 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
|
|
import "qml/components" as Components
|
|
import "qml/components/pages" as Pages
|
|
import "qml/buttons" as Buttons
|
|
|
|
ApplicationWindow {
|
|
id: root
|
|
title: "Arch Linux Updater"
|
|
width: 740
|
|
height: 960
|
|
minimumWidth: 740
|
|
minimumHeight: 560
|
|
maximumWidth: 1080
|
|
maximumHeight: 1460
|
|
visible: true
|
|
color: Theme.color1
|
|
|
|
property string packageManager: "yay"
|
|
property bool consoleOpen: false
|
|
|
|
ColumnLayout {
|
|
id: mainLayout
|
|
anchors.fill: parent
|
|
anchors.margins: Theme.baseMargins
|
|
anchors.bottomMargin: Theme.baseMargins + consoleBar.height
|
|
spacing: Theme.baseSpacing
|
|
|
|
RowLayout {
|
|
id: headerLayout
|
|
Layout.maximumWidth: Number.POSITIVE_INFINITY
|
|
|
|
Components.Title {
|
|
id: title
|
|
Layout.maximumWidth: Number.POSITIVE_INFINITY
|
|
Layout.alignment: Qt.AlignBottom
|
|
}
|
|
|
|
Buttons.SettingsBtn {
|
|
id: settingsButton
|
|
Layout.alignment: Qt.AlignBottom
|
|
}
|
|
}
|
|
|
|
Components.Line { id: line }
|
|
|
|
Components.Tabs {
|
|
id: tabs
|
|
parentWidth: mainLayout.width
|
|
}
|
|
|
|
StackLayout {
|
|
id: pages
|
|
Layout.fillWidth: true
|
|
Layout.fillHeight: true
|
|
currentIndex: tabs.currentIndex
|
|
|
|
Pages.UpdatePg {
|
|
id: pgUpdate
|
|
}
|
|
|
|
Pages.InstallPg {
|
|
id: pgInstall
|
|
}
|
|
|
|
Pages.DeletePg {
|
|
id: pgDelete
|
|
}
|
|
}
|
|
}
|
|
|
|
readonly property string consoleTitle: tabs.currentIndex === 0 ? "Консоль обновления" : tabs.currentIndex === 1 ? "Консоль установки" : "Консоль удаления"
|
|
readonly property string consoleStatus: "in develop"
|
|
// readonly property string consoleStatus: tabs.currentIndex === 0
|
|
// ? (UpdateManager.isUpdating ? "обновление..." : "")
|
|
// : tabBar.currentIndex === 1
|
|
// ? (UpdateManager.isInstalling ? "установка..." : "")
|
|
// : (UpdateManager.isRemoving ? "удаление..." : "")
|
|
|
|
readonly property var consoleLog: ""
|
|
// readonly property var consoleLog: tabs.currentIndex === 0 ? UpdateManager.updateLog
|
|
// : tabs.currentIndex === 1 ? UpdateManager.installLog
|
|
// : UpdateManager.removalLog
|
|
|
|
Components.ConsoleBar {
|
|
id: consoleBar
|
|
title: root.consoleTitle
|
|
consoleOpen: root.consoleOpen
|
|
status: root.consoleStatus
|
|
onToggled: root.consoleOpen = !root.consoleOpen
|
|
}
|
|
|
|
Components.ConsolePanel {
|
|
id: consolePanel
|
|
anchors.bottom: consoleBar.top
|
|
consoleOpen: root.consoleOpen
|
|
status: root.consoleStatus
|
|
title: root.consoleTitle
|
|
consoleLogData: root.consoleLogData
|
|
}
|
|
}
|