Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/inpututils.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class InputUtils: public QObject

/** InputApp platform */
static QString appPlatform();
static bool isMobilePlatform();
Q_INVOKABLE static bool isMobilePlatform();

static QString appDataDir();

Expand Down
8 changes: 5 additions & 3 deletions app/qml/account/MMHowYouFoundUsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ MMPage {
width: parent.width
height: parent.height

MMListView {
id: listView

MMScrollView {
width: parent.width
height: parent.height

MMListView {
id: listView

spacing: __style.spacing12

topMargin: __style.margin40
Expand Down Expand Up @@ -160,6 +161,7 @@ MMPage {
}
}
}
}

MMButton {
id: footerButton
Expand Down
8 changes: 5 additions & 3 deletions app/qml/components/MMListDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,18 @@ MMDrawer {
}
}

MMScrollView {
width: parent.width
height: Math.min( root.drawerContentAvailableHeight, listViewComponent.contentHeight )

MMListView {
id: listViewComponent

width: parent.width
height: Math.min( root.drawerContentAvailableHeight, contentHeight )

interactive: contentHeight > height

clip: true
maximumFlickVelocity: __androidUtils.isAndroid ? __style.scrollVelocityAndroid : maximumFlickVelocity
}
}
}
}
11 changes: 7 additions & 4 deletions app/qml/components/MMListMultiselectDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ MMDrawer {
sourceComponent: defaultEmptyStateComponent
}

MMScrollView {
width: parent.width
height: Math.min( listViewComponent.contentHeight, root.drawerContentAvailableHeight - internal.searchBarVerticalSpace )

visible: listViewComponent.count > 0

MMListView {
id: listViewComponent

width: parent.width
height: Math.min( contentHeight, root.drawerContentAvailableHeight - internal.searchBarVerticalSpace )

visible: count > 0
interactive: contentHeight > height

clip: true
Expand Down Expand Up @@ -122,6 +124,7 @@ MMDrawer {

footer: MMListSpacer { height: __style.safeAreaBottom + __style.margin8 + ( root.multiSelect ? confirmButton.height : 0 ) }
}
}
}
}

Expand Down
1 change: 1 addition & 0 deletions app/qml/components/MMListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import QtQuick
ListView {

id: root

// when flicking up really fast, we should go back to the first item
onVerticalOvershootChanged: {
if (verticalOvershoot < -200) {
Expand Down
4 changes: 3 additions & 1 deletion app/qml/components/MMScrollView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ import QtQuick.Controls
ScrollView {
id: root

rightPadding: ScrollBar.vertical.visible ? ScrollBar.vertical.width * 2 : 0

contentWidth: availableWidth // to only scroll vertically

ScrollBar.vertical.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: !__inputUtils.isMobilePlatform() && root.contentHeight > root.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
}
7 changes: 6 additions & 1 deletion app/qml/components/MMToolbar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,22 @@ Rectangle {
// center the content
x: __style.safeAreaLeft

MMScrollView {
anchors.fill: parent

contentWidth: toolbar.contentWidth

MMListView {
id: toolbar

onWidthChanged: root.recalculate()
model: toolbarModel
delegate: ( model.count === 1 ) && ( menuModel.count === 0 ) ? longBtnComp : shortBtnComp
anchors.fill: parent
orientation: ListView.Horizontal
interactive: false
Component.onCompleted: root.initialize()
}
}
}

// buttons shown inside main toolbar
Expand Down
6 changes: 4 additions & 2 deletions app/qml/form/MMFormPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,15 @@ Page {

property int tabIndex: model.TabIndex // from the repeater

MMComponents.MMListView {

MMComponents.MMScrollView {
anchors {
fill: parent
leftMargin: __style.pageMargins
rightMargin: __style.pageMargins
}

MMComponents.MMListView {

model: swipeViewRepeater.model.attributeFormProxyModel( pageDelegate.tabIndex )

clip: true
Expand All @@ -206,6 +207,7 @@ Page {
height: 20 * __dp
}
}
}
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions app/qml/form/MMPreviewDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,12 @@ Item {

visible: internal.showFields

MMComponents.MMListView {
MMComponents.MMScrollView {
width: parent.width
height: contentHeight
height: listView.contentHeight

MMComponents.MMListView {
id: listView

spacing: __style.margin8
interactive: false
Expand Down Expand Up @@ -238,6 +241,7 @@ Item {
}
}
}
}
}

// HTML
Expand Down
8 changes: 5 additions & 3 deletions app/qml/form/components/MMFeaturesListPageDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ Drawer {
Layout.preferredHeight: __style.spacing20
}

MMComponents.MMListView {
id: listView

MMComponents.MMScrollView {
Layout.fillWidth: true
Layout.fillHeight: true

MMComponents.MMListView {
id: listView

clip: true

delegate: MMComponents.MMListDelegate {
Expand All @@ -114,6 +115,7 @@ Drawer {

footer: MMComponents.MMListSpacer { height: __style.safeAreaBottom + __style.margin8 + ( primarybtn.visible ? primarybtn.height : 0 ) }
}
}
}

MMComponents.MMButton {
Expand Down
63 changes: 36 additions & 27 deletions app/qml/form/components/MMFormTabBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,58 @@ import QtQuick
import QtQuick.Controls
import "../../components" as MMComponents

MMComponents.MMListView {
MMComponents.MMScrollView {
id: root

implicitHeight: __style.row45

spacing: 0
property alias model: tabList.model
property alias currentIndex: tabList.currentIndex

clip: true
orientation: ListView.Horizontal
contentWidth: tabList.contentWidth

interactive: contentWidth > width
MMComponents.MMListView {
id: tabList

header: MMComponents.MMListSpacer { width: __style.margin20 }
footer: MMComponents.MMListSpacer { width: __style.margin20 }
spacing: 0

delegate: Control {
id: tabDelegate
clip: true
orientation: ListView.Horizontal

property bool isSelected: ListView.isCurrentItem
interactive: contentWidth > width

height: __style.row45
width: contentItem.implicitWidth
header: MMComponents.MMListSpacer { width: __style.margin20 }
footer: MMComponents.MMListSpacer { width: __style.margin20 }

focusPolicy: Qt.NoFocus
delegate: Control {
id: tabDelegate

background: Rectangle {
visible: tabDelegate.isSelected
color: __style.grassColor
radius: __style.radius30
}
property bool isSelected: ListView.isCurrentItem

contentItem: MMComponents.MMText {
text: model.Name
height: __style.row45
width: contentItem.implicitWidth

font: __style.t4
focusPolicy: Qt.NoFocus

leftPadding: __style.margin20
rightPadding: __style.margin20
}
background: Rectangle {
visible: tabDelegate.isSelected
color: __style.grassColor
radius: __style.radius30
}

contentItem: MMComponents.MMText {
text: model.Name

font: __style.t4

leftPadding: __style.margin20
rightPadding: __style.margin20
}

MouseArea {
anchors.fill: parent
onClicked: root.currentIndex = index
MouseArea {
anchors.fill: parent
onClicked: root.currentIndex = index
}
}
}
}
Expand Down
10 changes: 7 additions & 3 deletions app/qml/form/editors/MMFormGalleryEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ MMPrivateComponents.MMBaseInput {
? qsTr( "Some features may be hidden by active filters" )
: ""

inputContent: MMComponents.MMListView {
id: rowView

inputContent: MMComponents.MMScrollView {
width: parent.width
height: __style.row120

contentWidth: rowView.contentWidth

MMComponents.MMListView {
id: rowView

clip: true
spacing: __style.spacing12
orientation: ListView.Horizontal
Expand Down Expand Up @@ -77,6 +80,7 @@ MMPrivateComponents.MMBaseInput {

header: __activeProject.projectRole !== "reader" ? addFeatureComponent : null
}
}

Component {
id: addFeatureComponent
Expand Down
8 changes: 5 additions & 3 deletions app/qml/gps/MMPositionProviderPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ MMComponents.MMPage {
width: parent.width
height: parent.height

MMComponents.MMListView {
id: listview

MMComponents.MMScrollView {
width: parent.width
height: parent.height

MMComponents.MMListView {
id: listview

clip: true

model: PositionProvidersModel {
Expand Down Expand Up @@ -118,6 +119,7 @@ MMComponents.MMPage {
height: __style.safeAreaBottom + __style.margin8 + connectNewReceiverButton.height
}
}
}

MMComponents.MMButton {
id: connectNewReceiverButton
Expand Down
12 changes: 7 additions & 5 deletions app/qml/layers/MMFeaturesListPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,18 @@ MMComponents.MMPage {
}
}

MMComponents.MMListView {
id: listView

width: parent.width

MMComponents.MMScrollView {
anchors {
top: filterBanner.visible ? filterBanner.bottom : searchBar.bottom
bottom: parent.bottom
left: parent.left
right: parent.right
topMargin: filterBanner.visible ? __style.spacing10 : __style.spacing20
}

MMComponents.MMListView {
id: listView

model: MM.LayerFeaturesModel {
id: featuresModel

Expand All @@ -97,6 +98,7 @@ MMComponents.MMPage {
height: __style.margin20 + ( root.hasToolbar ? 0 : __style.safeAreaBottom ) + ( addButton.visible ? addButton.height : 0 )
}
}
}

MMComponents.MMBusyIndicator {
anchors.centerIn: parent
Expand Down
Loading
Loading