2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2021 The Qt Company Ltd.
|
2023-01-04 08:52:22 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2021-02-04 16:18:45 +02:00
|
|
|
|
|
|
|
|
import QtQuick 2.15
|
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
|
import QtQuickDesignerTheme 1.0
|
2021-03-02 13:35:07 +01:00
|
|
|
import HelperWidgets 2.0
|
|
|
|
|
import StudioTheme 1.0 as StudioTheme
|
2021-02-04 16:18:45 +02:00
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
id: root
|
|
|
|
|
|
2022-02-03 19:49:27 +02:00
|
|
|
spacing: 5
|
|
|
|
|
|
|
|
|
|
signal back()
|
|
|
|
|
|
|
|
|
|
Row {
|
|
|
|
|
spacing: 5
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
|
|
|
|
|
Button {
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
text: "<"
|
|
|
|
|
width: 25
|
|
|
|
|
height: 25
|
|
|
|
|
onClicked: back()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Text {
|
|
|
|
|
text: qsTr("Select a Module to Add")
|
|
|
|
|
color: StudioTheme.Values.themeTextColor
|
|
|
|
|
font.pixelSize: 16
|
|
|
|
|
}
|
2021-02-04 16:18:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ScrollView { // ListView not used because of QTBUG-52941
|
|
|
|
|
id: listView
|
|
|
|
|
width: parent.width
|
2022-02-03 19:49:27 +02:00
|
|
|
height: parent.height - y
|
2021-02-04 16:18:45 +02:00
|
|
|
clip: true
|
|
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
spacing: 2
|
|
|
|
|
|
|
|
|
|
Repeater {
|
2022-02-03 19:49:27 +02:00
|
|
|
model: addModuleModel
|
2021-02-04 16:18:45 +02:00
|
|
|
|
|
|
|
|
delegate: Rectangle {
|
2021-03-02 13:35:07 +01:00
|
|
|
id: itemBackground
|
2021-02-04 16:18:45 +02:00
|
|
|
width: listView.width
|
2021-03-01 16:32:41 +02:00
|
|
|
height: isSeparator ? 4 : 25
|
2021-03-02 13:35:07 +01:00
|
|
|
color: StudioTheme.Values.themeListItemBackground
|
2021-02-04 16:18:45 +02:00
|
|
|
visible: importVisible
|
|
|
|
|
|
|
|
|
|
Text {
|
2021-03-02 13:35:07 +01:00
|
|
|
id: itemText
|
2021-02-04 16:18:45 +02:00
|
|
|
text: importUrl
|
2021-03-02 13:35:07 +01:00
|
|
|
color: StudioTheme.Values.themeListItemText
|
2021-02-04 16:18:45 +02:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.leftMargin: 10
|
|
|
|
|
anchors.rightMargin: 10
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
|
id: mouseArea
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
hoverEnabled: true
|
2021-03-05 19:47:53 +02:00
|
|
|
onClicked: rootView.handleAddImport(index)
|
2021-03-01 16:32:41 +02:00
|
|
|
enabled: !isSeparator
|
2021-02-04 16:18:45 +02:00
|
|
|
}
|
2021-03-02 13:35:07 +01:00
|
|
|
|
|
|
|
|
states: [
|
|
|
|
|
State {
|
|
|
|
|
name: "default"
|
|
|
|
|
when: !isSeparator && !mouseArea.containsMouse && !mouseArea.pressed
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: itemBackground
|
|
|
|
|
color: StudioTheme.Values.themeListItemBackground
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: itemText
|
|
|
|
|
color: StudioTheme.Values.themeListItemText
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: "separator"
|
|
|
|
|
when: isSeparator
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: itemBackground
|
|
|
|
|
color: StudioTheme.Values.themePanelBackground
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: "hover"
|
|
|
|
|
when: !isSeparator && mouseArea.containsMouse && !mouseArea.containsPress
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: itemBackground
|
|
|
|
|
color: StudioTheme.Values.themeListItemBackgroundHover
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: itemText
|
|
|
|
|
color: StudioTheme.Values.themeListItemTextHover
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: "press"
|
|
|
|
|
when: !isSeparator && mouseArea.containsPress
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: itemBackground
|
|
|
|
|
color: StudioTheme.Values.themeListItemBackgroundPress
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: itemText
|
|
|
|
|
color: StudioTheme.Values.themeListItemTextPress
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
2021-02-04 16:18:45 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|