Skip to content

Commit d90b2c1

Browse files
kaustuvpokharelgabriel-bolbotina
authored andcommitted
fixed suggestions
1 parent bb81009 commit d90b2c1

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

app/qml/components/MMListDelegate.qml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Item {
2424
property string text
2525
property string secondaryText
2626

27-
readonly property int scrollSpace: (ListView.view && ListView.view.scrollSpace) ? ListView.view.scrollSpace : 0
2827
property alias leftContent: leftContentGroup.children
2928
property alias rightContent: rightContentGroup.children
3029

@@ -44,7 +43,7 @@ Item {
4443
implicitWidth: ListView?.view?.width ?? 0 // in case ListView is injected as attached property (usually it is)
4544
implicitHeight: contentLayout.implicitHeight
4645
height: visible ? implicitHeight : 0.1 // hide invisible items, for some reason setting 0 does not work ¯\_(ツ)_/¯
47-
width: implicitWidth - ListView.view.scrollSpace
46+
width: implicitWidth - ( ListView?.view?.scrollSpace ?? 0 )
4847

4948
MouseArea {
5049
anchors.fill: contentLayout

app/qml/components/MMListView.qml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import QtQuick
1111
import QtQuick.Controls
12+
import QtQml
1213

1314
//
1415
// Hot-fix for hotfix https://github.com/MerginMaps/mobile/issues/3417
@@ -29,10 +30,6 @@ ListView {
2930
visible: !isMobile && (root.contentHeight > root.height)
3031
opacity: (pressed || root.moving) ? 0.7 : 0.4
3132

32-
anchors.right: root.right
33-
34-
implicitHeight: root.height
35-
3633
contentItem: Rectangle {
3734
implicitWidth: 5
3835
radius: width / 2

app/qml/components/MMScrollView.qml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import QtQuick
1111
import QtQuick.Controls
12+
import QtQml
1213

1314
// Convenient class to use as a pageContent or drawerContent
1415
// base element to make the content scroll
@@ -19,26 +20,22 @@ ScrollView {
1920
readonly property bool isMobile: (Qt.platform.os === "android" || Qt.platform.os === "ios")
2021
property int scrollSpace: !isMobile ? 10 : 0
2122

22-
contentWidth: availableWidth - scrollSpace // to only scroll vertically
23-
24-
ScrollBar.horizontal: null
23+
contentWidth: availableWidth - scrollSpace
2524

25+
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
2626
ScrollBar.vertical: ScrollBar {
2727
id: verticalScrollBar
2828

29-
policy: ScrollBar.AsNeeded
29+
policy: ScrollBar.AlwaysOn
3030
visible: !isMobile && (root.contentHeight > root.height)
3131
opacity: (pressed || root.moving) ? 0.7 : 0.4
32-
33-
anchors.right: root.right
34-
3532
implicitHeight: root.height
33+
anchors.right: parent.right
3634

3735
contentItem: Rectangle {
3836
implicitWidth: 5
3937
radius: width / 2
4038
color: __style.darkGreenColor
4139
}
4240
}
43-
4441
}

app/qml/form/MMPreviewDrawer.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ Item {
198198
model: root.controller.fieldModel
199199

200200
delegate: Item {
201-
width: ListView.view.width - ListView.view.width
201+
width: ListView.view.width - ListView.view.scrollSpace
202202
height: childrenRect.height
203203

204204
Column {

app/qml/layers/MMFeaturesListPage.qml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import QtQuick
1111
import QtQuick.Controls
1212
import QtQuick.Layouts
13-
import QtQml
1413

1514
import mm 1.0 as MM
1615

app/qml/project/MMProjectWizardPage.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ MMComponents.MMPage {
7070
delegate: MMProjectComponents.MMProjectWizardDelegate {
7171
id: fieldDelegate
7272

73-
width: ListView.view.width - ListView.view.width
73+
width: ListView.view.width - ListView.view.scrollSpace
7474

7575
// find current index in the model
7676
comboboxField.comboboxModel: typesmodel

app/qml/settings/MMLogPage.qml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,15 @@ MMPage {
5353
width: parent.width
5454
}
5555

56-
ScrollBar.vertical: ScrollBar { }
56+
ScrollBar.vertical: ScrollBar {
57+
opacity: (root.pressed || root.moving) ? 0.7 : 0.4
58+
59+
contentItem: Rectangle {
60+
implicitWidth: 5
61+
radius: width / 2
62+
color: __style.darkGreenColor
63+
}
64+
}
5765
}
5866

5967
MMButton {

0 commit comments

Comments
 (0)