Skip to content

Commit de09c4b

Browse files
Modified MMButton extraSmall size to match the design
Simplified Filter banner component Added banner in the linked features corrected position according to figma design
1 parent 009355e commit de09c4b

4 files changed

Lines changed: 55 additions & 68 deletions

File tree

app/qml/components/MMButton.qml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,37 +162,42 @@ Button {
162162

163163
state: "default"
164164

165-
implicitHeight: root.type === MMButton.Types.Tertiary ? buttonContent.height : buttonContent.height + topPadding + bottomPadding
165+
implicitHeight: {
166+
if ( root.type === MMButton.Types.Tertiary && root.size !== MMButton.Sizes.ExtraSmall )
167+
return buttonContent.height
168+
else
169+
return buttonContent.height + topPadding + bottomPadding
170+
}
166171
implicitWidth: {
167-
if ( root.size === MMButton.Sizes.ExtraSmall ) return row.paintedChildrenWidth + 2 * __style.margin12
172+
if ( root.size === MMButton.Sizes.ExtraSmall ) return row.paintedChildrenWidth + 2 * __style.margin8
168173
return row.paintedChildrenWidth + 2 * ( root.size === MMButton.Sizes.Small ? __style.margin16 : __style.margin20 )
169174
}
170175

171176
topPadding: {
172-
if ( root.type === MMButton.Types.Tertiary ) {
177+
if ( root.size === MMButton.Sizes.ExtraSmall ) {
178+
return __style.margin2;
179+
}
180+
else if ( root.type === MMButton.Types.Tertiary ) {
173181
return 0;
174182
}
175183
else if ( root.size === MMButton.Sizes.Small ) {
176184
return 7 * __dp;
177185
}
178-
else if ( root.size === MMButton.Sizes.ExtraSmall ) {
179-
return 2 * __dp;
180-
}
181186
else {
182187
return 11 * __dp;
183188
}
184189
}
185190

186191
bottomPadding: {
187-
if ( root.type === MMButton.Types.Tertiary ) {
192+
if ( root.size === MMButton.Sizes.ExtraSmall ) {
193+
return __style.margin2;
194+
}
195+
else if ( root.type === MMButton.Types.Tertiary ) {
188196
return 0;
189197
}
190198
else if ( root.size === MMButton.Sizes.Small ) {
191199
return 7 * __dp;
192200
}
193-
else if ( root.size === MMButton.Sizes.ExtraSmall ) {
194-
return 2 * __dp;
195-
}
196201
else {
197202
return 11 * __dp;
198203
}
@@ -210,7 +215,7 @@ Button {
210215

211216
property real paintedChildrenWidth: buttonIconLeft.paintedWidth + buttonContent.implicitWidth + buttonIconRight.paintedWidth + spacing
212217
property real maxWidth: {
213-
if ( root.size === MMButton.Sizes.ExtraSmall ) return parent.width - 2 * __style.margin12
218+
if ( root.size === MMButton.Sizes.ExtraSmall ) return parent.width - 2 * __style.margin8
214219
return parent.width - 2 * ( root.size === MMButton.Sizes.Small ? __style.margin16 : __style.margin20 )
215220
}
216221

@@ -278,7 +283,7 @@ Button {
278283
background: Rectangle {
279284
id: buttonBackground
280285

281-
radius: root.size === MMButton.Sizes.ExtraSmall ? __style.radius12 : __style.radius30
286+
radius: root.size === MMButton.Sizes.ExtraSmall ? __style.radius40 : __style.radius30
282287

283288
border.width: 2 * __dp
284289
}

app/qml/filters/components/MMFilterBanner.qml

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,21 @@ Rectangle {
1515
id: root
1616

1717
property string text
18-
property bool showIcon: false
1918
property string actionText: ""
20-
property bool showClose: false
2119

2220
signal actionClicked()
23-
signal closeClicked()
2421

2522
color: __style.informativeColor
2623
radius: __style.radius8
27-
implicitHeight: bannerText.implicitHeight + 2 * __style.margin12
28-
29-
MMComponents.MMIcon {
30-
id: infoIcon
31-
32-
visible: root.showIcon
33-
34-
anchors.left: parent.left
35-
anchors.leftMargin: __style.margin12
36-
anchors.verticalCenter: parent.verticalCenter
37-
38-
source: __style.infoIcon
39-
color: __style.deepOceanColor
40-
size: __style.icon24
41-
}
24+
implicitHeight: bannerText.implicitHeight + 2 * __style.margin8
4225

4326
MMComponents.MMText {
4427
id: bannerText
4528

46-
anchors.left: infoIcon.visible ? infoIcon.right : parent.left
47-
anchors.leftMargin: infoIcon.visible ? __style.spacing8 : __style.margin12
48-
anchors.right: actionButton.visible ? actionButton.left : ( closeButton.visible ? closeButton.left : parent.right )
49-
anchors.rightMargin: ( actionButton.visible || closeButton.visible ) ? __style.spacing8 : __style.margin12
29+
anchors.left: parent.left
30+
anchors.leftMargin: __style.margin12
31+
anchors.right: actionButton.visible ? actionButton.left : parent.right
32+
anchors.rightMargin: actionButton.visible ? __style.spacing8 : __style.margin12
5033
anchors.verticalCenter: parent.verticalCenter
5134

5235
text: root.text
@@ -68,26 +51,9 @@ Rectangle {
6851
bgndColor: __style.deepOceanColor
6952

7053
anchors.right: parent.right
71-
anchors.rightMargin: __style.margin12
54+
anchors.rightMargin: __style.margin8
7255
anchors.verticalCenter: parent.verticalCenter
7356

7457
onClicked: root.actionClicked()
7558
}
76-
77-
MMComponents.MMRoundButton {
78-
id: closeButton
79-
80-
visible: root.showClose
81-
82-
iconSource: __style.closeIcon
83-
iconColor: __style.deepOceanColor
84-
bgndColor: __style.transparentColor
85-
bgndHoverColor: __style.transparentColor
86-
87-
anchors.right: parent.right
88-
anchors.rightMargin: __style.margin4
89-
anchors.verticalCenter: parent.verticalCenter
90-
91-
onClicked: root.closeClicked()
92-
}
9359
}

app/qml/form/components/MMFeaturesListPageDrawer.qml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import QtQuick.Controls
1212

1313
import "../../inputs" as MMInputs
1414
import "../../components" as MMComponents
15+
import "../../filters/components" as MMFilters
1516

1617
//
1718
// Special type of drawer/page -> looks like page, but it is actually Drawer
@@ -75,11 +76,26 @@ Drawer {
7576

7677
MMComponents.MMListSpacer { height: __style.spacing20 }
7778

79+
MMFilters.MMFilterBanner {
80+
id: filterBanner
81+
82+
visible: globalFilterController.hasActiveFilters
83+
84+
width: parent.width
85+
text: qsTr( "Some features may be hidden by active filters" )
86+
}
87+
88+
MMComponents.MMListSpacer {
89+
visible: filterBanner.visible
90+
height: __style.spacing10
91+
}
92+
7893
MMComponents.MMListView {
7994
id: listView
8095

8196
width: parent.width
8297
height: parent.height - 2 * __style.spacing20 - searchBar.height
98+
- ( filterBanner.visible ? filterBanner.height + __style.spacing10 : 0 )
8399

84100
clip: true
85101

app/qml/layers/MMFeaturesListPage.qml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,26 @@ MMComponents.MMPage {
3434
width: parent.width
3535
height: parent.height
3636

37-
MMFilterComponents.MMFilterBanner {
38-
id: filterNotification
37+
MMSearchInput {
38+
id: searchBar
3939

4040
anchors.top: parent.top
4141
anchors.topMargin: __style.spacing20
4242

4343
width: parent.width
4444

45+
delayedSearch: true
46+
onSearchTextChanged: featuresModel.searchExpression = searchBar.text
47+
}
48+
49+
MMFilterComponents.MMFilterBanner {
50+
id: filterBanner
51+
52+
anchors.top: searchBar.bottom
53+
anchors.topMargin: __style.spacing20
54+
55+
width: parent.width
56+
4557
visible: root.selectedLayer && globalFilterController.filteredLayerIds.indexOf(root.selectedLayer.id) >= 0
4658

4759
text: qsTr("Active filters applied")
@@ -54,27 +66,15 @@ MMComponents.MMPage {
5466
}
5567
}
5668

57-
MMSearchInput {
58-
id: searchBar
59-
60-
anchors.top: filterNotification.visible ? filterNotification.bottom : parent.top
61-
anchors.topMargin: __style.spacing20
62-
63-
width: parent.width
64-
65-
delayedSearch: true
66-
onSearchTextChanged: featuresModel.searchExpression = searchBar.text
67-
}
68-
6969
MMComponents.MMListView {
7070
id: listView
7171

7272
width: parent.width
7373

7474
anchors {
75-
top: searchBar.bottom
75+
top: filterBanner.visible ? filterBanner.bottom : searchBar.bottom
7676
bottom: parent.bottom
77-
topMargin: __style.spacing20
77+
topMargin: filterBanner.visible ? __style.spacing10 : __style.spacing20
7878
}
7979

8080
model: MM.LayerFeaturesModel {

0 commit comments

Comments
 (0)