try to fix #LINQT-1605 again
This commit is contained in:
parent
afbf8c1fa4
commit
fd57e952e4
1 changed files with 141 additions and 141 deletions
|
|
@ -14,7 +14,7 @@ Rectangle {
|
||||||
property var contentModel
|
property var contentModel
|
||||||
property var topbarOptionalComponent
|
property var topbarOptionalComponent
|
||||||
property var model
|
property var model
|
||||||
color: 'white'
|
color: DefaultStyle.grey_0
|
||||||
property var container
|
property var container
|
||||||
property int contentHeight: contentRepeater.count > 0 ? contentRepeater.itemAt(0).height * contentRepeater.count : 0
|
property int contentHeight: contentRepeater.count > 0 ? contentRepeater.itemAt(0).height * contentRepeater.count : 0
|
||||||
property int minimumWidthForSwitchintToRowLayout: 981 * DefaultStyle.dp
|
property int minimumWidthForSwitchintToRowLayout: 981 * DefaultStyle.dp
|
||||||
|
|
@ -34,149 +34,149 @@ Rectangle {
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
setResponsivityFlags()
|
setResponsivityFlags()
|
||||||
}
|
}
|
||||||
Control.Control {
|
ColumnLayout {
|
||||||
id: header
|
spacing: 0
|
||||||
anchors.left: parent.left
|
anchors.fill: parent
|
||||||
anchors.right: parent.right
|
Control.Control {
|
||||||
leftPadding: 45 * DefaultStyle.dp
|
id: header
|
||||||
rightPadding: 45 * DefaultStyle.dp
|
Layout.fillWidth: true
|
||||||
z: 1
|
leftPadding: 45 * DefaultStyle.dp
|
||||||
background: Rectangle {
|
rightPadding: 45 * DefaultStyle.dp
|
||||||
anchors.fill: parent
|
z: 1
|
||||||
color: DefaultStyle.grey_0
|
background: Rectangle {
|
||||||
}
|
anchors.fill: parent
|
||||||
contentItem: ColumnLayout {
|
color: DefaultStyle.grey_0
|
||||||
RowLayout {
|
}
|
||||||
Layout.fillWidth: true
|
contentItem: ColumnLayout {
|
||||||
Layout.topMargin: 20 * DefaultStyle.dp
|
RowLayout {
|
||||||
spacing: 5 * DefaultStyle.dp
|
|
||||||
Layout.bottomMargin: 10 * DefaultStyle.dp
|
|
||||||
Button {
|
|
||||||
id: backButton
|
|
||||||
Layout.preferredHeight: 24 * DefaultStyle.dp
|
|
||||||
Layout.preferredWidth: 24 * DefaultStyle.dp
|
|
||||||
icon.source: AppIcons.leftArrow
|
|
||||||
focus: true
|
|
||||||
visible: mainItem.container.depth > 1
|
|
||||||
Layout.rightMargin: 41 * DefaultStyle.dp
|
|
||||||
style: ButtonStyle.noBackground
|
|
||||||
onClicked: {
|
|
||||||
mainItem.container.pop()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Text {
|
|
||||||
text: titleText
|
|
||||||
color: DefaultStyle.main2_600
|
|
||||||
font: Typography.h3
|
|
||||||
}
|
|
||||||
Item {
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
Layout.topMargin: 20 * DefaultStyle.dp
|
||||||
Loader {
|
spacing: 5 * DefaultStyle.dp
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.bottomMargin: 10 * DefaultStyle.dp
|
||||||
sourceComponent: mainItem.topbarOptionalComponent
|
Button {
|
||||||
Layout.rightMargin: 34 * DefaultStyle.dp
|
id: backButton
|
||||||
}
|
Layout.preferredHeight: 24 * DefaultStyle.dp
|
||||||
MediumButton {
|
Layout.preferredWidth: 24 * DefaultStyle.dp
|
||||||
id: saveButton
|
icon.source: AppIcons.leftArrow
|
||||||
style: ButtonStyle.main
|
focus: true
|
||||||
text: qsTr("Enregistrer")
|
visible: mainItem.container.depth > 1
|
||||||
Layout.rightMargin: 6 * DefaultStyle.dp
|
Layout.rightMargin: 41 * DefaultStyle.dp
|
||||||
visible: mainItem.saveButtonVisible
|
style: ButtonStyle.noBackground
|
||||||
onClicked: {
|
onClicked: {
|
||||||
mainItem.save()
|
mainItem.container.pop()
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Rectangle {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
height: 1 * DefaultStyle.dp
|
|
||||||
color: DefaultStyle.main2_500main
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Control.ScrollView {
|
|
||||||
id: scrollView
|
|
||||||
anchors.top: header.bottom
|
|
||||||
anchors.topMargin: 16 * DefaultStyle.dp
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
leftPadding: 45 * DefaultStyle.dp
|
|
||||||
rightPadding: 45 * DefaultStyle.dp
|
|
||||||
Control.ScrollBar.vertical: ScrollBar {
|
|
||||||
active: scrollViewContent.implicitHeight > scrollView.height
|
|
||||||
visible: scrollViewContent.implicitHeight > scrollView.height
|
|
||||||
interactive: true
|
|
||||||
policy: Control.ScrollBar.AsNeeded
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: 15 * DefaultStyle.dp
|
|
||||||
}
|
|
||||||
Control.ScrollBar.horizontal: ScrollBar {
|
|
||||||
active: false
|
|
||||||
}
|
|
||||||
ColumnLayout {
|
|
||||||
id: scrollViewContent
|
|
||||||
width: parent.width
|
|
||||||
spacing: 10 * DefaultStyle.dp
|
|
||||||
Repeater {
|
|
||||||
id: contentRepeater
|
|
||||||
model: mainItem.contentModel
|
|
||||||
Layout.preferredHeight: implicitHeight
|
|
||||||
delegate: ColumnLayout {
|
|
||||||
Rectangle {
|
|
||||||
visible: index !== 0
|
|
||||||
Layout.topMargin: (modelData.hideTopSeparator ? 0 : 16) * DefaultStyle.dp
|
|
||||||
Layout.bottomMargin: 16 * DefaultStyle.dp
|
|
||||||
Layout.fillWidth: true
|
|
||||||
height: 1 * DefaultStyle.dp
|
|
||||||
color: modelData.hideTopSeparator ? 'transparent' : DefaultStyle.main2_500main
|
|
||||||
}
|
|
||||||
GridLayout {
|
|
||||||
rows: 1
|
|
||||||
columns: mainItem.useVerticalLayout ? 1 : 2
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredWidth: parent.width
|
|
||||||
rowSpacing: (modelData.title.length > 0 || modelData.subTitle.length > 0 ? 20 : 0) * DefaultStyle.dp
|
|
||||||
columnSpacing: 47 * DefaultStyle.dp
|
|
||||||
ColumnLayout {
|
|
||||||
Layout.preferredWidth: 341 * DefaultStyle.dp
|
|
||||||
Layout.maximumWidth: 341 * DefaultStyle.dp
|
|
||||||
spacing: 3 * DefaultStyle.dp
|
|
||||||
Text {
|
|
||||||
text: modelData.title
|
|
||||||
visible: modelData.title.length > 0
|
|
||||||
font: Typography.h4
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
color: DefaultStyle.main2_600
|
|
||||||
Layout.preferredWidth: parent.width
|
|
||||||
}
|
|
||||||
Text {
|
|
||||||
text: modelData.subTitle
|
|
||||||
visible: modelData.subTitle.length > 0
|
|
||||||
font: Typography.p1s
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
color: DefaultStyle.main2_600
|
|
||||||
Layout.preferredWidth: parent.width
|
|
||||||
}
|
|
||||||
Item {
|
|
||||||
Layout.fillHeight: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
RowLayout {
|
}
|
||||||
Layout.topMargin: (modelData.hideTopMargin ? 0 : (mainItem.useVerticalLayout ? 10 : 21)) * DefaultStyle.dp
|
Text {
|
||||||
Layout.bottomMargin: 21 * DefaultStyle.dp
|
text: titleText
|
||||||
Layout.leftMargin: (mainItem.useVerticalLayout ? 0 : 17) * DefaultStyle.dp
|
color: DefaultStyle.main2_600
|
||||||
Layout.preferredWidth: (modelData.customWidth > 0 ? modelData.customWidth : 545) * DefaultStyle.dp
|
font: Typography.h3
|
||||||
Layout.alignment: Qt.AlignRight
|
}
|
||||||
Loader {
|
Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
sourceComponent: modelData.contentComponent
|
}
|
||||||
|
Loader {
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
sourceComponent: mainItem.topbarOptionalComponent
|
||||||
|
Layout.rightMargin: 34 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
MediumButton {
|
||||||
|
id: saveButton
|
||||||
|
style: ButtonStyle.main
|
||||||
|
text: qsTr("Enregistrer")
|
||||||
|
Layout.rightMargin: 6 * DefaultStyle.dp
|
||||||
|
visible: mainItem.saveButtonVisible
|
||||||
|
onClicked: {
|
||||||
|
mainItem.save()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Rectangle {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 1 * DefaultStyle.dp
|
||||||
|
color: DefaultStyle.main2_500main
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Control.ScrollView {
|
||||||
|
id: scrollView
|
||||||
|
Layout.topMargin: 16 * DefaultStyle.dp
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
leftPadding: 45 * DefaultStyle.dp
|
||||||
|
rightPadding: 45 * DefaultStyle.dp
|
||||||
|
Control.ScrollBar.vertical: ScrollBar {
|
||||||
|
active: scrollViewContent.implicitHeight > scrollView.height
|
||||||
|
visible: scrollViewContent.implicitHeight > scrollView.height
|
||||||
|
interactive: true
|
||||||
|
policy: Control.ScrollBar.AsNeeded
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: 15 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
Control.ScrollBar.horizontal: ScrollBar {
|
||||||
|
active: false
|
||||||
|
}
|
||||||
|
ColumnLayout {
|
||||||
|
id: scrollViewContent
|
||||||
|
width: scrollView.width - scrollView.leftPadding - scrollView.rightPadding
|
||||||
|
spacing: 10 * DefaultStyle.dp
|
||||||
|
Repeater {
|
||||||
|
id: contentRepeater
|
||||||
|
model: mainItem.contentModel
|
||||||
|
delegate: ColumnLayout {
|
||||||
|
Rectangle {
|
||||||
|
visible: index !== 0
|
||||||
|
Layout.topMargin: (modelData.hideTopSeparator ? 0 : 16) * DefaultStyle.dp
|
||||||
|
Layout.bottomMargin: 16 * DefaultStyle.dp
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 1 * DefaultStyle.dp
|
||||||
|
color: modelData.hideTopSeparator ? 'transparent' : DefaultStyle.main2_500main
|
||||||
|
}
|
||||||
|
GridLayout {
|
||||||
|
rows: 1
|
||||||
|
columns: mainItem.useVerticalLayout ? 1 : 2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredWidth: parent.width
|
||||||
|
rowSpacing: (modelData.title.length > 0 || modelData.subTitle.length > 0 ? 20 : 0) * DefaultStyle.dp
|
||||||
|
columnSpacing: 47 * DefaultStyle.dp
|
||||||
|
ColumnLayout {
|
||||||
|
Layout.preferredWidth: 341 * DefaultStyle.dp
|
||||||
|
Layout.maximumWidth: 341 * DefaultStyle.dp
|
||||||
|
spacing: 3 * DefaultStyle.dp
|
||||||
|
Text {
|
||||||
|
text: modelData.title
|
||||||
|
visible: modelData.title.length > 0
|
||||||
|
font: Typography.h4
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
color: DefaultStyle.main2_600
|
||||||
|
Layout.preferredWidth: parent.width
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
text: modelData.subTitle
|
||||||
|
visible: modelData.subTitle.length > 0
|
||||||
|
font: Typography.p1s
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
color: DefaultStyle.main2_600
|
||||||
|
Layout.preferredWidth: parent.width
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
Layout.fillHeight: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Item {
|
RowLayout {
|
||||||
Layout.preferredWidth: (modelData.customRightMargin > 0 ? modelData.customRightMargin : 17) * DefaultStyle.dp
|
Layout.topMargin: (modelData.hideTopMargin ? 0 : (mainItem.useVerticalLayout ? 10 : 21)) * DefaultStyle.dp
|
||||||
|
Layout.bottomMargin: 21 * DefaultStyle.dp
|
||||||
|
Layout.leftMargin: (mainItem.useVerticalLayout ? 0 : 17) * DefaultStyle.dp
|
||||||
|
Layout.preferredWidth: (modelData.customWidth > 0 ? modelData.customWidth : 545) * DefaultStyle.dp
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
Loader {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
sourceComponent: modelData.contentComponent
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
Layout.preferredWidth: (modelData.customRightMargin > 0 ? modelData.customRightMargin : 17) * DefaultStyle.dp
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue