Files
amnezia-client/client/ui/qml/Components/HomeContainersListView.qml
T

83 lines
2.0 KiB
QML
Raw Normal View History

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
import ProtocolEnum 1.0
import "../Controls2"
import "../Controls2/TextTypes"
ListView {
id: menuContent
property var rootWidth
width: rootWidth
height: menuContent.contentItem.height
clip: true
interactive: false
ButtonGroup {
id: containersRadioButtonGroup
}
delegate: Item {
implicitWidth: rootWidth
2023-06-05 15:49:10 +08:00
implicitHeight: content.implicitHeight
2023-06-05 15:49:10 +08:00
ColumnLayout {
id: content
2023-06-01 11:25:33 +08:00
anchors.fill: parent
anchors.rightMargin: 16
anchors.leftMargin: 16
2023-06-05 15:49:10 +08:00
VerticalRadioButton {
id: containerRadioButton
2023-06-05 15:49:10 +08:00
Layout.fillWidth: true
2023-06-05 15:49:10 +08:00
text: name
descriptionText: description
2023-06-05 15:49:10 +08:00
ButtonGroup.group: containersRadioButtonGroup
2023-06-05 15:49:10 +08:00
imageSource: "qrc:/images/controls/download.svg"
showImage: !isInstalled
checkable: isInstalled
checked: isDefault
onClicked: {
if (checked) {
isDefault = true
menuContent.currentIndex = index
containersDropDown.menuVisible = false
} else {
2023-06-13 20:03:20 +09:00
ContainersModel.setCurrentlyProcessedContainerIndex(proxyContainersModel.mapToSource(index))
2023-06-05 15:49:10 +08:00
InstallController.setShouldCreateServer(false)
goToPage(PageEnum.PageSetupWizardProtocolSettings)
containersDropDown.menuVisible = false
menu.visible = false
}
}
MouseArea {
anchors.fill: containerRadioButton
cursorShape: Qt.PointingHandCursor
enabled: false
}
}
2023-06-05 15:49:10 +08:00
DividerType {
Layout.fillWidth: true
}
}
}
}