2017-07-03 09:33:28 +02:00
|
|
|
import QtQuick 2.6
|
2017-07-03 09:30:10 +02:00
|
|
|
import QtQuick.Layouts 1.2
|
2017-07-03 09:33:28 +02:00
|
|
|
import QtQuick.Controls 2.0
|
2017-07-03 09:30:10 +02:00
|
|
|
|
2017-12-20 14:54:05 +01:00
|
|
|
import Governikus.Global 1.0
|
|
|
|
import Governikus.Provider 1.0
|
|
|
|
import Governikus.TitleBar 1.0
|
2017-07-03 09:30:10 +02:00
|
|
|
|
|
|
|
SectionPage {
|
|
|
|
id: baseItem
|
|
|
|
|
2017-12-20 14:54:05 +01:00
|
|
|
leftTitleBarAction: TitleBarAction { state: "back"; onClicked: firePop() }
|
2017-07-03 09:33:28 +02:00
|
|
|
headerTitleBarAction: TitleBarAction { text: provider.shortName }
|
|
|
|
titleBarColor: Category.displayColor(provider.category)
|
2017-07-03 09:30:10 +02:00
|
|
|
|
2017-07-03 09:33:28 +02:00
|
|
|
property alias providerModelItem: provider.modelItem
|
|
|
|
ProviderModelItem {
|
|
|
|
id: provider
|
|
|
|
}
|
2017-07-03 09:30:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
header: ProviderHeader {
|
2017-07-03 09:33:28 +02:00
|
|
|
id: ownHeader
|
2017-07-03 09:30:10 +02:00
|
|
|
width: baseItem.width
|
2017-07-03 09:33:28 +02:00
|
|
|
selectedProvider: provider
|
2017-07-03 09:30:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
content: Item {
|
2017-07-03 09:33:28 +02:00
|
|
|
height: swipeBar.height + swipeViewBackground.height + Constants.component_spacing
|
2017-07-03 09:30:10 +02:00
|
|
|
width: baseItem.width
|
|
|
|
|
2017-07-03 09:33:28 +02:00
|
|
|
TabBar {
|
2017-07-03 09:30:10 +02:00
|
|
|
id: swipeBar
|
2017-07-03 09:33:28 +02:00
|
|
|
height: firstButton.implicitHeight
|
2017-07-03 09:30:10 +02:00
|
|
|
anchors.top: parent.top
|
2017-07-03 09:33:28 +02:00
|
|
|
anchors.topMargin: Constants.component_spacing
|
2017-07-03 09:30:10 +02:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
|
|
|
currentIndex: swipeView.currentIndex
|
|
|
|
|
2017-07-03 09:33:28 +02:00
|
|
|
TabButton {
|
2017-07-03 09:30:10 +02:00
|
|
|
id: firstButton
|
|
|
|
padding: Utils.dp(10)
|
2017-07-03 09:33:28 +02:00
|
|
|
// TODO: Workaround, use contentItem when switching to Qt 5.7.1
|
|
|
|
// See https://bugreports.qt.io/browse/QTBUG-50992
|
2017-12-20 14:54:05 +01:00
|
|
|
text: qsTr("DESCRIPTION") + settingsModel.translationTrigger
|
2017-07-03 09:33:28 +02:00
|
|
|
|
|
|
|
/*
|
2017-07-03 09:30:10 +02:00
|
|
|
contentItem: Text {
|
2017-12-20 14:54:05 +01:00
|
|
|
text: qsTr("DESCRIPTION") + settingsModel.translationTrigger
|
2017-07-03 09:30:10 +02:00
|
|
|
font.pixelSize: Constants.normal_font_size
|
|
|
|
elide: Text.ElideRight
|
|
|
|
opacity: enabled ? 1 : 0.3
|
|
|
|
color: !parent.checked ? "black" : parent.pressed ? "black" : Constants.blue
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
2017-07-03 09:33:28 +02:00
|
|
|
*/
|
2017-07-03 09:30:10 +02:00
|
|
|
}
|
|
|
|
|
2017-07-03 09:33:28 +02:00
|
|
|
TabButton {
|
2017-07-03 09:30:10 +02:00
|
|
|
padding: Utils.dp(10)
|
2017-07-03 09:33:28 +02:00
|
|
|
// TODO: Workaround, use contentItem when switching to Qt 5.7.1
|
|
|
|
// See https://bugreports.qt.io/browse/QTBUG-50992
|
2017-12-20 14:54:05 +01:00
|
|
|
text: qsTr("CONTACT") + settingsModel.translationTrigger
|
2017-07-03 09:33:28 +02:00
|
|
|
|
|
|
|
/*
|
2017-07-03 09:30:10 +02:00
|
|
|
contentItem: Text {
|
2017-12-20 14:54:05 +01:00
|
|
|
text: qsTr("CONTACT") + settingsModel.translationTrigger
|
2017-07-03 09:30:10 +02:00
|
|
|
font.pixelSize: Constants.normal_font_size
|
|
|
|
elide: Text.ElideRight
|
|
|
|
opacity: enabled ? 1 : 0.3
|
|
|
|
color: !parent.checked ? "black" : parent.pressed ? "black" : Constants.blue
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
2017-07-03 09:33:28 +02:00
|
|
|
*/
|
2017-07-03 09:30:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
2017-07-03 09:33:28 +02:00
|
|
|
id: swipeViewBackground
|
2017-07-03 09:30:10 +02:00
|
|
|
anchors.top: swipeBar.bottom
|
2017-07-03 09:33:28 +02:00
|
|
|
anchors.horizontalCenter: swipeBar.horizontalCenter
|
|
|
|
height: swipeView.height + 2 * Constants.component_spacing
|
|
|
|
width: parent.width
|
2017-07-03 09:30:10 +02:00
|
|
|
|
2017-07-03 09:33:28 +02:00
|
|
|
SwipeView {
|
2017-07-03 09:30:10 +02:00
|
|
|
id: swipeView
|
2017-07-03 09:33:28 +02:00
|
|
|
height: Math.max(providerText.contentHeight, providerInfo.contentHeight)
|
|
|
|
anchors.margins: Constants.component_spacing
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
2017-07-03 09:30:10 +02:00
|
|
|
currentIndex: swipeBar.currentIndex
|
|
|
|
clip: true
|
|
|
|
|
|
|
|
Text {
|
2017-07-03 09:33:28 +02:00
|
|
|
id: providerText
|
2018-03-28 15:10:51 +02:00
|
|
|
color: Constants.secondary_text
|
2017-12-20 14:54:05 +01:00
|
|
|
text: (!!provider.longDescription ? provider.longDescription : qsTr("Description not available")) + settingsModel.translationTrigger
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
2017-07-03 09:30:10 +02:00
|
|
|
wrapMode: Text.WordWrap
|
2017-07-03 09:33:28 +02:00
|
|
|
font.pixelSize: Constants.normal_font_size
|
2017-07-03 09:30:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ProviderContactTab {
|
2017-07-03 09:33:28 +02:00
|
|
|
id: providerInfo
|
|
|
|
contactModel: provider.contactModel
|
2017-07-03 09:30:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|