Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade of inputs and form editors #3318

Merged
merged 44 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
276f0df
Add MMBaseInput component
tomasMizera Apr 15, 2024
9980137
Add new negative colors
tomasMizera Apr 15, 2024
ac8c6cd
[WIP] Add MMBaseTextInput
tomasMizera Apr 15, 2024
58f725e
Enhanced mouse area for checkbox
tomasMizera Apr 16, 2024
f985507
Add MMBaseTextInput
tomasMizera Apr 16, 2024
89b2e7a
Update MMTextInput component
tomasMizera Apr 17, 2024
66a9e2c
Fix predictive text on Android
tomasMizera Apr 17, 2024
67f3d69
Rename MMBaseTextInput to MMBaseSingleLineInput
tomasMizera Apr 17, 2024
a22fece
Update MMFormTextEditor
tomasMizera Apr 17, 2024
e0a7c73
Update MMFormNumberEditor (#3327)
tomasMizera Apr 18, 2024
88eb2b6
Bind left/right content mouse areas to enabled state by default (#3328)
tomasMizera Apr 18, 2024
e93e480
Update MMFormCalendarEditor.qml (#3329)
tomasMizera Apr 18, 2024
189d28e
Update MMFormValueMapEditor and MMFormValueRelationEditor (#3330)
tomasMizera Apr 18, 2024
60144ed
MMSwitchInput, MMSwitchFormEditor (#3331)
uclaros Apr 18, 2024
a208175
Rework multiline form editor
tomasMizera Apr 18, 2024
cf8a14f
Rework MMFormSliderEditor
tomasMizera Apr 18, 2024
cc4e928
Merge pull request #3334 from MerginMaps/rework-multiline-editor
tomasMizera Apr 18, 2024
5db2912
Merge pull request #3335 from MerginMaps/rework-slider-editor
tomasMizera Apr 18, 2024
508541e
Rework MMPasswordInput (#3333)
uclaros Apr 18, 2024
d0c50e4
Fix binding loop on implicitWidth in MMBaseSingleLineInput
tomasMizera Apr 18, 2024
54624d9
rework combobox
uclaros Apr 18, 2024
0d7cf6d
Rework MMSearchInput (#3336)
uclaros Apr 18, 2024
d6efc81
Merge pull request #3338 from MerginMaps/rework-base-input-fix-bindin…
tomasMizera Apr 18, 2024
be2b6be
Merge pull request #3339 from MerginMaps/rework-combobox
tomasMizera Apr 18, 2024
f40b7a5
Rework MMFormPhotoEditor (#3332)
tomasMizera Apr 18, 2024
bfb8587
fix setting the background for a MMSearchInput (#3340)
uclaros Apr 18, 2024
7b9aed9
Fix console warnings with import (#3342)
tomasMizera Apr 18, 2024
3328417
Rework MMFromRelationEditor (#3341)
tomasMizera Apr 18, 2024
b2c51f4
Rework MMRelationReferenceEditor (#3337)
tomasMizera Apr 18, 2024
4d3df5e
rework MMFormScannerEditor
uclaros Apr 19, 2024
33fdada
Merge pull request #3343 from MerginMaps/rework-qr
tomasMizera Apr 19, 2024
32d857c
Rework MMFormGalleryEditor
tomasMizera Apr 19, 2024
7b935ab
rework MMFormRichTextViewer
uclaros Apr 19, 2024
fb35c85
Merge pull request #3345 from MerginMaps/rework-rich-text
tomasMizera Apr 19, 2024
6ebad83
Merge pull request #3344 from MerginMaps/rework-gallery-editor
tomasMizera Apr 19, 2024
6fa0846
don't open combobox if disabled
uclaros Apr 19, 2024
cfc28ce
Merge pull request #3346 from MerginMaps/fix-disabled
tomasMizera Apr 19, 2024
3e61fdf
don't open calendar when disabled
uclaros Apr 19, 2024
cfa7645
Remove old base input and unused input with button
tomasMizera Apr 19, 2024
70dfb48
Merge pull request #3347 from MerginMaps/fix-disabled
tomasMizera Apr 19, 2024
833f6fa
Merge pull request #3348 from MerginMaps/rework-remove-unused-code
tomasMizera Apr 19, 2024
adf1b8c
Merge master into rework-base-input
uclaros Apr 19, 2024
14d8e79
Fix colors for input and editor icons
tomasMizera Apr 19, 2024
56cddd0
Merge pull request #3349 from MerginMaps/rework-fix-colors
tomasMizera Apr 19, 2024
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
5 changes: 5 additions & 0 deletions app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@ int main( int argc, char *argv[] )

init_qgis( appBundleDir );

#ifdef ANDROID
// See https://bugreports.qt.io/browse/QTBUG-86982 -> fix to make the predictive text disabled on Android
qputenv( "QT_ANDROID_ENABLE_WORKAROUND_TO_DISABLE_PREDICTIVE_TEXT", "1" );
#endif

// AppSettings has to be initialized after QGIS app init (because of correct reading/writing QSettings).
AppSettings as;

Expand Down
11 changes: 7 additions & 4 deletions app/mmstyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ class MMStyle: public QObject
Q_PROPERTY( QColor informativeColor READ informativeColor CONSTANT )

// Colors - others
Q_PROPERTY( QColor nightAlphaColor READ nightAlphaColor CONSTANT ) // placeholder input color
Q_PROPERTY( QColor errorBgInputColor READ errorBgInputColor CONSTANT ) // error bg input color
Q_PROPERTY( QColor shadowColor READ shadowColor CONSTANT )
Q_PROPERTY( QColor snappingColor READ snappingColor CONSTANT )

Expand Down Expand Up @@ -286,6 +284,7 @@ class MMStyle: public QObject

// Other
Q_PROPERTY( double row1 READ number1 CONSTANT )
Q_PROPERTY( double row4 READ number4 CONSTANT )
Q_PROPERTY( double row24 READ number24 CONSTANT )
Q_PROPERTY( double row36 READ number36 CONSTANT )
Q_PROPERTY( double row40 READ number40 CONSTANT )
Expand All @@ -297,13 +296,18 @@ class MMStyle: public QObject
Q_PROPERTY( double row67 READ number67 CONSTANT )
Q_PROPERTY( double row80 READ number80 CONSTANT )
Q_PROPERTY( double row114 READ number114 CONSTANT )
Q_PROPERTY( double row120 READ number120 CONSTANT )
Q_PROPERTY( double row160 READ number160 CONSTANT )
Q_PROPERTY( double radius2 READ number2 CONSTANT )
Q_PROPERTY( double radius6 READ number6 CONSTANT )
Q_PROPERTY( double radius8 READ number8 CONSTANT )
Q_PROPERTY( double radius12 READ number12 CONSTANT )
Q_PROPERTY( double radius16 READ number16 CONSTANT )
Q_PROPERTY( double radius20 READ number20 CONSTANT )
Q_PROPERTY( double radius30 READ number30 CONSTANT )
Q_PROPERTY( double radius40 READ number40 CONSTANT )
Q_PROPERTY( double width1 READ number1 CONSTANT )
Q_PROPERTY( double width2 READ number2 CONSTANT )
Q_PROPERTY( double scrollVelocityAndroid READ scrollVelocityAndroid CONSTANT ) // [px/s] scrolling on Android devices is too slow by default

// Breakpoint we use in some screens to differentiate mobile landscape
Expand Down Expand Up @@ -366,8 +370,6 @@ class MMStyle: public QObject
QColor informativeColor() {return QColor::fromString( "#BEDAF0" );}
QColor snappingColor() {return QColor::fromString( "#BD74FF" );}

QColor nightAlphaColor() {return QColor::fromString( "#AA12181F" );}
QColor errorBgInputColor() {return QColor::fromString( "#FEFAF9" );}
QColor shadowColor() {return QColor::fromString( "#66777777" );}

QUrl splitGeometryIcon() {return QUrl( "qrc:/SplitGeometry.svg" );}
Expand Down Expand Up @@ -675,6 +677,7 @@ class MMStyle: public QObject
double number148() {return 148 * mDp;}
double number149() {return 149 * mDp;}
double number150() {return 150 * mDp;}
double number160() {return 160 * mDp;}
double number250() {return 250 * mDp;}
double number400() {return 400 * mDp;}
double number720() {return 720 * mDp;}
Expand Down
9 changes: 4 additions & 5 deletions app/qml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,12 @@ set(MM_QML
components/MMListSpacer.qml
components/MMBusyIndicator.qml
components/MMMessage.qml
components/MMMorePhoto.qml
components/MMNotification.qml
components/MMNotificationView.qml
components/MMPage.qml
components/MMPageHeader.qml
components/MMPopup.qml
components/MMPhoto.qml
components/MMPhotoAttachment.qml
components/MMPhotoPreview.qml
components/MMProgressBar.qml
components/MMRadioButton.qml
components/MMRoundButton.qml
Expand All @@ -52,6 +49,8 @@ set(MM_QML
components/MMText.qml
components/MMToolbar.qml
components/MMToolbarButton.qml
components/private/MMBaseInput.qml
components/private/MMBaseSingleLineInput.qml
components/private/MMToolbarLongButton.qml
components/private/MMToolbarShortButton.qml
dialogs/MMCloseAccountDialog.qml
Expand Down Expand Up @@ -91,6 +90,8 @@ set(MM_QML
form/components/calendar/MMMonthGrid.qml
form/components/calendar/MMTimeTumbler.qml
form/components/calendar/MMTumbler.qml
form/components/photo/MMPhotoAttachment.qml
form/components/photo/MMPhotoPreview.qml
form/editors/MMFormCalendarEditor.qml
form/editors/MMFormComboboxBaseEditor.qml
form/editors/MMFormGalleryEditor.qml
Expand All @@ -114,12 +115,10 @@ set(MM_QML
gps/MMPositionProviderPage.qml
gps/MMStakeoutDrawer.qml
gps/components/MMGpsDataText.qml
inputs/MMBaseInput.qml
inputs/MMComboboxInput.qml
inputs/MMPasswordInput.qml
inputs/MMSearchInput.qml
inputs/MMTextInput.qml
inputs/MMTextWithButtonInput.qml
inputs/MMSwitchInput.qml
layers/MMFeaturesListPage.qml
layers/MMLayerDetailPage.qml
Expand Down
2 changes: 1 addition & 1 deletion app/qml/account/MMHowYouFoundUsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ MMPage {

onTextChanged: root.selectedText = text

Component.onCompleted: textFieldComponent.forceActiveFocus()
Component.onCompleted: textField.forceActiveFocus()
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions app/qml/account/MMLoginPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ MMPage {
width: parent.width

title: qsTr( "Email or username" )
textFieldComponent.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase
textField.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase | Qt.ImhEmailCharactersOnly
}

MMPasswordInput {
Expand Down Expand Up @@ -200,10 +200,10 @@ MMPage {

title: qsTr( "Server address" )

bgColor: __style.lightGreenColor
textFieldBackground.color: __style.lightGreenColor

text: root.apiRoot
textFieldComponent.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase
textField.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase | Qt.ImhUrlCharactersOnly
}

MMListSpacer { height: __style.spacing40 }
Expand Down
4 changes: 2 additions & 2 deletions app/qml/account/MMSignUpPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ MMPage {
width: parent.width

title: qsTr( "Username" )
textFieldComponent.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase
textField.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase
}

MMTextInput {
Expand All @@ -81,7 +81,7 @@ MMPage {
width: parent.width

title: qsTr( "Email" )
textFieldComponent.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase
textField.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase | Qt.ImhEmailCharactersOnly
}

MMPasswordInput {
Expand Down
2 changes: 1 addition & 1 deletion app/qml/account/MMSwitchWorkspacePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ MMComponents.MMPage {

placeholderText: qsTr( "Search" ) + "..."

onSearchTextChanged: function( searchText ) { root.searchTextChanged( searchText ) }
onSearchTextChanged: root.searchTextChanged( searchBar.searchText )
}

MMComponents.MMScrollView {
Expand Down
4 changes: 2 additions & 2 deletions app/qml/account/MMWhichIndustryPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ MMPage {
title: qsTr( "Industry" )
placeholderText: internal.specifyIndustryText

onTextChanged: root.selectedText = text
onTextEdited: ( text ) => root.selectedText = text

Component.onCompleted: textFieldComponent.forceActiveFocus()
Component.onCompleted: textField.forceActiveFocus()
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion app/qml/components/MMCheckBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ CheckBox {

property bool hasError: false

property color emptyStateColor: __style.transparentColor

implicitHeight: Math.max( textContent.implicitHeight, indicatorContent.height )

topPadding: __style.margin4
Expand All @@ -35,7 +37,7 @@ CheckBox {

radius: __style.radius6

color: ( root.checked && root.enabled ) ? __style.grassColor: __style.transparentColor
color: ( root.checked && root.enabled ) ? __style.grassColor : emptyStateColor

border.color: {
if ( enabled ) {
Expand Down
5 changes: 3 additions & 2 deletions app/qml/components/MMListMultiselectDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ MMDrawer {

placeholderText: qsTr( "Search" )

bgColor: __style.lightGreenColor
textFieldBackground.color: __style.lightGreenColor

visible: root.withSearch

onSearchTextChanged: ( text ) => root.searchTextChanged( text )
onSearchTextChanged: root.searchTextChanged( searchBar.searchText )
}

MMListSpacer { id: searchBarSpacer; height: __style.spacing20; visible: root.withSearch }
Expand Down
110 changes: 0 additions & 110 deletions app/qml/components/MMMorePhoto.qml

This file was deleted.

10 changes: 4 additions & 6 deletions app/qml/components/MMSwitch.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ import QtQuick.Controls
Switch {
id: root

property color checkedBgColor: enabled ? __style.grassColor : __style.mediumGreenColor
property color uncheckedBgColor: __style.polarColor
property color checkedBgColor: __style.grassColor
property color disabledFgColor: __style.mediumGreenColor
property color enabledFgColor: __style.forestColor
property color handleColor: enabled ? __style.forestColor : __style.mediumGreyColor

topPadding: 0
rightPadding: 0
Expand All @@ -26,7 +25,7 @@ Switch {
contentItem: Text {
text: root.text
font: __style.p5
color: root.enabled ? root.enabledFgColor : root.disabledFgColor
color: root.handleColor
verticalAlignment: Text.AlignVCenter
leftPadding: root.indicator.width + ( text ? root.spacing : 0 )
}
Expand All @@ -37,7 +36,6 @@ Switch {
implicitWidth: 48 * __dp
implicitHeight: 28 * __dp
x: root.leftPadding
y: parent.height / 2 - height / 2
radius: implicitHeight / 2
color: root.checked ? root.checkedBgColor : root.uncheckedBgColor

Expand All @@ -46,7 +44,7 @@ Switch {
width: 20 * __dp
height: width
radius: width / 2
color: root.enabled ? root.enabledFgColor : root.disabledFgColor
color: root.handleColor
anchors.verticalCenter: parent.verticalCenter
}
}
Expand Down
Loading
Loading