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/qml/components/MMListDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Item {

property real verticalSpacing: root.secondaryText ? __style.margin8 : __style.margin20

implicitWidth: ListView?.view?.width ?? 0 // in case ListView is injected as attached property (usually it is)
implicitWidth: ListView?.view?.width - ListView?.view?.scrollBarWidth ?? 0 // in case ListView is injected as attached property (usually it is)
implicitHeight: contentLayout.implicitHeight
height: visible ? implicitHeight : 0.1 // hide invisible items, for some reason setting 0 does not work ¯\_(ツ)_/¯

Expand Down
14 changes: 14 additions & 0 deletions app/qml/components/MMListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,27 @@
***************************************************************************/

import QtQuick
import QtQuick.Controls
import QtQml

//
// Hot-fix for hotfix https://github.com/MerginMaps/mobile/issues/3417
// Seems like there is some issue with cache in ListView
//

ListView {
id: root

cacheBuffer: 0
readonly property bool isMobile: (Qt.platform.os === "android" || Qt.platform.os === "ios")
readonly property int scrollBarWidth: !isMobile ? __style.margin10 : 0
property alias showScrollBar: verticalScrollBar.policy

ScrollBar.vertical: ScrollBar{
id: verticalScrollBar

policy: isMobile ? ScrollBar.AlwaysOff : ScrollBar.AlwaysOn
visible: contentHeight > availableHeight ? true : false
opacity: active ? 0.7 : 0.4
}
}
23 changes: 15 additions & 8 deletions app/qml/components/MMScrollView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,25 @@
* (at your option) any later version. *
* *
***************************************************************************/

import QtQuick
import QtQuick.Controls

// Convenient class to use as a pageContent or drawerContent
// base element to make the content scroll
import QtQml

ScrollView {
id: root
id: root

readonly property bool isMobile: (Qt.platform.os === "android"
|| Qt.platform.os === "ios")
readonly property int scrollBarWidth: !isMobile ? __style.margin10 : 0
property bool showScrollBar: root.ScrollBar.vertical.policy


contentWidth: availableWidth - scrollBarWidth

contentWidth: availableWidth // to only scroll vertically
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff

ScrollBar.vertical.policy: ScrollBar.AlwaysOff
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
// vertical scroll bar should appear only when needed
ScrollBar.vertical.policy: isMobile ? ScrollBar.AlwaysOff : ScrollBar.AlwaysOn
ScrollBar.vertical.visible: contentHeight > availableHeight ? true : false
ScrollBar.vertical.opacity: active ? 0.7 : 0.4
}
2 changes: 2 additions & 0 deletions app/qml/components/MMToolbar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
***************************************************************************/

import QtQuick
import QtQuick.Controls

import "./private"

Expand Down Expand Up @@ -43,6 +44,7 @@ Rectangle {

MMListView {
id: toolbar
showScrollBar : ScrollBar.AlwaysOff

onWidthChanged: root.recalculate()
model: toolbarModel
Expand Down
2 changes: 1 addition & 1 deletion app/qml/form/MMFormPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ Page {

Item {

width: ListView.view.width
width: ListView.view.width - ListView.view.scrollBarWidth
implicitHeight: childrenRect.height

// In future, better to filter such fields in the field proxy model instead
Expand Down
2 changes: 1 addition & 1 deletion app/qml/form/MMPreviewDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Item {
height: contentHeight

spacing: __style.margin8
interactive: false
showScrollBar: ScrollBar.AsNeeded

model: root.controller.fieldModel

Expand Down
2 changes: 0 additions & 2 deletions app/qml/layers/MMLayerDetailPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ Page {
wrapMode: Text.WordWrap
text: __inputUtils.layerAttribution(layerDetailData.mapLayer)
}

ScrollBar.vertical: ScrollBar {}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/qml/project/MMProjectList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Item {
delegate: MMProjectComponents.MMProjectDelegate {
id: projectDelegate

width: ListView.view.width
width: ListView.view.width - ListView.view.scrollBarWidth
height: visible ? implicitHeight : 0

projectDisplayName: root.projectModelType === MM.ProjectsModel.WorkspaceProjectsModel ? model.ProjectName : model.ProjectFullName
Expand Down Expand Up @@ -202,7 +202,7 @@ Item {

topPadding: noLocalProjectsMessageContainer.visible ? noLocalProjectsMessageContainer.height + __style.margin40 : 0

width: ListView.view.width
width: ListView.view.width - ListView.view.scrollBarWidth

Item {
width: parent.width
Expand Down
2 changes: 1 addition & 1 deletion app/qml/project/MMProjectWizardPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ MMComponents.MMPage {
delegate: MMProjectComponents.MMProjectWizardDelegate {
id: fieldDelegate

width: ListView.view.width
width: ListView.view.width - ListView.view.scrollBarWidth

// find current index in the model
comboboxField.comboboxModel: typesmodel
Expand Down
1 change: 1 addition & 0 deletions app/qml/project/components/MMProjectDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Control {
signal showChangesRequested()

height: implicitHeight
width: ListView.view.width - ListView.view.scrollBarWidth

topPadding: __style.margin20
rightPadding: __style.margin20
Expand Down
10 changes: 9 additions & 1 deletion app/qml/settings/MMLogPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,15 @@ MMPage {
width: parent.width
}

ScrollBar.vertical: ScrollBar { }
ScrollBar.vertical: ScrollBar {
opacity: active ? 0.7 : 0.4

contentItem: Rectangle {
implicitWidth: 5
radius: width / 2
color: __style.darkGreenColor
}
}
}

MMButton {
Expand Down
Loading