Skip to content

Commit

Permalink
Merge pull request #3125 from MerginMaps/smallfixes5
Browse files Browse the repository at this point in the history
WIP: Smallfixes5
  • Loading branch information
PeterPetrik committed Mar 8, 2024
2 parents ab42370 + 9aa4bba commit fa951de
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 25 deletions.
4 changes: 3 additions & 1 deletion app/mmstyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ class MMStyle: public QObject
Q_PROPERTY( double margin4 READ margin4 CONSTANT )
Q_PROPERTY( double margin6 READ margin6 CONSTANT )
Q_PROPERTY( double margin8 READ margin8 CONSTANT )
Q_PROPERTY( double margin10 READ margin10 CONSTANT )
Q_PROPERTY( double margin12 READ margin12 CONSTANT )
Q_PROPERTY( double margin16 READ margin16 CONSTANT )
Q_PROPERTY( double margin20 READ margin20 CONSTANT )
Expand Down Expand Up @@ -476,7 +477,7 @@ class MMStyle: public QObject
double icon24() {return 24 * mDp;}
double icon32() {return 32 * mDp;}

double mapItemHeight() {return 60 * mDp;}
double mapItemHeight() {return 50 * mDp;}
double toolbarHeight()
{
if ( mSafeAreaBottom > 2 )
Expand All @@ -500,6 +501,7 @@ class MMStyle: public QObject
double margin4() {return 4 * mDp;}
double margin6() {return 6 * mDp;}
double margin8() {return 8 * mDp;}
double margin10() {return 10 * mDp;}
double margin12() {return 12 * mDp;}
double margin16() {return 16 * mDp;}
double margin20() {return 20 * mDp;}
Expand Down
40 changes: 18 additions & 22 deletions app/qml/components/MMToolbarLongButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import QtQuick.Controls
import QtQuick.Controls.Basic

Item {
id: control
id: root

signal clicked

Expand All @@ -21,22 +21,16 @@ Item {

required property string text

readonly property double toolbarLongButtonWidth: 48 * __dp
readonly property double minimumToolbarLongButtonWidth: 200 * __dp
readonly property double maximumToolbarLongButtonWidth: 500 * __dp

height: __style.toolbarHeight

Button {
width: {
var w = parent.width
if(w < control.minimumToolbarLongButtonWidth)
return control.minimumToolbarLongButtonWidth
else if(w > control.maximumToolbarLongButtonWidth)
return control.maximumToolbarLongButtonWidth
return w
}
height: control.toolbarLongButtonWidth
id: button

readonly property double maximumToolbarLongButtonWidth: 353 * __dp

width: parent.width - 2 * __style.pageMargins < maximumToolbarLongButtonWidth ? parent.width - 2 * __style.pageMargins : maximumToolbarLongButtonWidth
height: root.height - 2 * __style.margin10

anchors.centerIn: parent

contentItem: Item {
Expand All @@ -46,24 +40,26 @@ Item {
Row {
id: row

spacing: 5 * __dp
spacing: __style.margin6
height: parent.height
anchors.centerIn: parent

MMIcon {
source: control.iconSource
color: control.iconColor
id: icon

source: root.iconSource
color: root.iconColor
anchors.verticalCenter: parent.verticalCenter
}

Text {
id: text

text: control.text
visible: button.width > 130 * __dp
text: root.text
color: __style.forestColor
font: __style.t3
verticalAlignment: Text.AlignVCenter
topPadding: 9 * __dp
bottomPadding: 9 * __dp
anchors.verticalCenter: parent.verticalCenter
}
}
}
Expand All @@ -73,6 +69,6 @@ Item {
radius: height / 2
}

onClicked: control.clicked()
onClicked: root.clicked()
}
}
3 changes: 1 addition & 2 deletions gallery/qml/pages/MapPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ Page {
width: parent.width - 40
sourceItem: map
text: "Mark the geometry on the map and click record"

Component.onCompleted: show()
visible: true
}

Rectangle {
Expand Down

1 comment on commit fa951de

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 24.03.552411 just submitted!

Please sign in to comment.