Browse Source

use scrollview everywhere

partially untested for datasync
pull/2/head
Skycoder42 7 years ago
parent
commit
bb00d47b21
No known key found for this signature in database GPG Key ID: 8E01AD9EF0578D2B
  1. 94
      src/imports/mvvmdatasyncquick/ChangeRemoteView.qml
  2. 133
      src/imports/mvvmdatasyncquick/DataSyncView.qml
  3. 56
      src/imports/mvvmdatasyncquick/NetworkExchangeView.qml
  4. 9
      src/imports/mvvmquick/ListSection.qml
  5. 12
      src/imports/mvvmquick/SettingsView.qml

94
src/imports/mvvmdatasyncquick/ChangeRemoteView.qml

@ -143,67 +143,69 @@ Page {
Label {
text: qsTr("Extra Headers:")
Layout.fillWidth: true
color: _headerList.focus ? _accessKeyEdit.selectionColor : palette.text
opacity: _headerList.focus ? 1 : 0.5
color: _headerScrollView.focus ? _accessKeyEdit.selectionColor : palette.text
opacity: _headerScrollView.focus ? 1 : 0.5
}
ListView {
id: _headerList
ScrollView {
id: _headerScrollView
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
model: viewModel.headerModel
ListView {
id: _headerList
ScrollBar.vertical: ScrollBar {}
model: viewModel.headerModel
delegate: ItemDelegate {
width: parent.width
text: qsTr("%1: %2").arg(key).arg(value)
delegate: ItemDelegate {
width: _headerScrollView.width
text: qsTr("%1: %2").arg(key).arg(value)
Button {
id: _rmButton
flat: true
icon.width: 24
icon.height: 24
icon.name: "user-trash"
icon.source: "qrc:/de/skycoder42/qtmvvm/quick/icons/ic_delete_forever.svg"
anchors.right: parent.right
implicitHeight: parent.height
implicitWidth: implicitHeight
Button {
id: _rmButton
flat: true
icon.width: 24
icon.height: 24
icon.name: "user-trash"
icon.source: "qrc:/de/skycoder42/qtmvvm/quick/icons/ic_delete_forever.svg"
anchors.right: parent.right
implicitHeight: parent.height
implicitWidth: implicitHeight
onClicked: viewModel.removeHeaderConfig(index)
onClicked: viewModel.removeHeaderConfig(index)
}
}
}
footer: RowLayout {
width: parent.width
footer: RowLayout {
width: _headerScrollView.width
TextField {
id: _keyEdit
placeholderText: qsTr("Key")
Layout.fillWidth: true
}
TextField {
id: _keyEdit
placeholderText: qsTr("Key")
Layout.fillWidth: true
}
TextField {
id: _valueEdit
placeholderText: qsTr("Value")
Layout.fillWidth: true
}
TextField {
id: _valueEdit
placeholderText: qsTr("Value")
Layout.fillWidth: true
}
Button {
id: _addButton
flat: true
enabled: _keyEdit.text !== ""
icon.width: 24
icon.height: 24
icon.name: "list-add"
icon.source: "qrc:/de/skycoder42/qtmvvm/quick/icons/ic_add.svg"
onClicked: {
viewModel.addHeaderConfig(_keyEdit.text, _valueEdit.text);
_keyEdit.clear();
_valueEdit.clear();
Button {
id: _addButton
flat: true
enabled: _keyEdit.text !== ""
icon.width: 24
icon.height: 24
icon.name: "list-add"
icon.source: "qrc:/de/skycoder42/qtmvvm/quick/icons/ic_add.svg"
onClicked: {
viewModel.addHeaderConfig(_keyEdit.text, _valueEdit.text);
_keyEdit.clear();
_valueEdit.clear();
}
}
}
}

133
src/imports/mvvmdatasyncquick/DataSyncView.qml

@ -161,87 +161,90 @@ Page {
text: qsTr("Other Devices:")
}
ListView {
id: _devicesList
ScrollView {
id: _devicesScrollView
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
model: viewModel.sortedModel
ScrollBar.vertical: ScrollBar {}
ListView {
id: _devicesList
delegate: SwipeDelegate {
id: _swipeDelegate
width: parent.width
model: viewModel.sortedModel
delegate: SwipeDelegate {
id: _swipeDelegate
width: _devicesScrollView.width
contentItem: ColumnLayout {
id: _delegateLayout
spacing: 8
contentItem: ColumnLayout {
id: _delegateLayout
spacing: 8
Label {
id: _nameLabel
Layout.fillWidth: true
text: name
}
Label {
id: _nameLabel
Layout.fillWidth: true
text: name
}
Label {
id: _fpLabel
font.pointSize: _nameLabel.font.pointSize * 0.8
Layout.fillWidth: true
Layout.leftMargin: 8
text: fingerPrint
elide: Text.ElideMiddle
opacity: 0.75
Label {
id: _fpLabel
font.pointSize: _nameLabel.font.pointSize * 0.8
Layout.fillWidth: true
Layout.leftMargin: 8
text: fingerPrint
elide: Text.ElideMiddle
opacity: 0.75
}
}
}
ListView.onRemove: SequentialAnimation {
PropertyAction {
target: _swipeDelegate
property: "ListView.delayRemove"
value: true
}
NumberAnimation {
target: _swipeDelegate
property: "height"
to: 0
easing.type: Easing.InOutQuad
}
PropertyAction {
target: _swipeDelegate
property: "ListView.delayRemove"
value: false
ListView.onRemove: SequentialAnimation {
PropertyAction {
target: _swipeDelegate
property: "ListView.delayRemove"
value: true
}
NumberAnimation {
target: _swipeDelegate
property: "height"
to: 0
easing.type: Easing.InOutQuad
}
PropertyAction {
target: _swipeDelegate
property: "ListView.delayRemove"
value: false
}
}
}
swipe.right: Rectangle {
height: parent.height
width: height
anchors.right: parent.right
color: {
if(QuickPresenter.currentStyle === "Material")
return Material.color(Material.Red);
else if(QuickPresenter.currentStyle === "Universal")
return Universal.color(Universal.Red);
else
return "#FF0000";
}
swipe.right: Rectangle {
height: _devicesScrollView.height
width: height
anchors.right: parent.right
color: {
if(QuickPresenter.currentStyle === "Material")
return Material.color(Material.Red);
else if(QuickPresenter.currentStyle === "Universal")
return Universal.color(Universal.Red);
else
return "#FF0000";
}
ActionButton {
anchors.centerIn: parent
implicitHeight: parent.height
implicitWidth: parent.width
ActionButton {
anchors.centerIn: parent
implicitHeight: parent.height
implicitWidth: parent.width
icon.name: "user-trash"
icon.source: "qrc:/de/skycoder42/qtmvvm/quick/icons/ic_delete_forever.svg"
text: qsTr("Remove Device")
icon.name: "user-trash"
icon.source: "qrc:/de/skycoder42/qtmvvm/quick/icons/ic_delete_forever.svg"
text: qsTr("Remove Device")
Material.foreground: "white"
Universal.foreground: "white"
Material.foreground: "white"
Universal.foreground: "white"
onClicked: {
_swipeDelegate.swipe.close();
viewModel.removeDevice(index)
onClicked: {
_swipeDelegate.swipe.close();
viewModel.removeDevice(index)
}
}
}
}

56
src/imports/mvvmdatasyncquick/NetworkExchangeView.qml

@ -114,40 +114,42 @@ Page {
}
}
ListView {
id: _exchangeList
ScrollView {
id: _exchangeScrollView
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
model: viewModel.sortedModel
ScrollBar.vertical: ScrollBar {}
delegate: ItemDelegate {
width: parent.width
contentItem: ColumnLayout {
id: _delegateLayout
spacing: 8
Label {
id: _nameLabel
Layout.fillWidth: true
text: name
ListView {
id: _exchangeList
model: viewModel.sortedModel
delegate: ItemDelegate {
width: _exchangeScrollView.width
contentItem: ColumnLayout {
id: _delegateLayout
spacing: 8
Label {
id: _nameLabel
Layout.fillWidth: true
text: name
}
Label {
id: _addressLabel
font.pointSize: _nameLabel.font.pointSize * 0.8
Layout.fillWidth: true
Layout.leftMargin: 8
text: address
opacity: 0.75
}
}
Label {
id: _addressLabel
font.pointSize: _nameLabel.font.pointSize * 0.8
Layout.fillWidth: true
Layout.leftMargin: 8
text: address
opacity: 0.75
}
onClicked: viewModel.exportTo(index)
}
onClicked: viewModel.exportTo(index)
}
}
}

9
src/imports/mvvmquick/ListSection.qml

@ -16,14 +16,7 @@ Label {
background: Rectangle {
anchors.fill: parent
color: {
if(QuickPresenter.currentStyle === "Material")
return Material.background;
else if(QuickPresenter.currentStyle === "Universal")
return Universal.background;
else
return "white";
}
color: "transparent"
Rectangle {
anchors.left: parent.left

12
src/imports/mvvmquick/SettingsView.qml

@ -231,17 +231,17 @@ Page {
id: _overviewComponent
ScrollView {
id: __ovScrollView
property alias model: __ovListView.model
property alias showSections: __ovListView.showSections
anchors.fill: parent
clip: true
OverviewListView {
id: __ovListView
builder: _builder
Component.onCompleted: _settingsStack.push(__ovListView)
}
Component.onCompleted: _settingsStack.push(__ovScrollView)
}
}
@ -249,16 +249,16 @@ Page {
id: _sectionViewComponent
ScrollView {
id: __secScrollView
property alias model: __secListView.model
anchors.fill: parent
clip: true
SectionListView {
id: __secListView
builder: _builder
Component.onCompleted: _settingsStack.push(__secListView)
}
Component.onCompleted: _settingsStack.push(__secScrollView)
}
}

Loading…
Cancel
Save