Skip to content

Commit

Permalink
Merge pull request #2965 from MerginMaps/componentstoapp
Browse files Browse the repository at this point in the history
integrate components to main app
  • Loading branch information
PeterPetrik authored Dec 18, 2023
2 parents 8f869c9 + 46b8930 commit 35a0aa8
Show file tree
Hide file tree
Showing 18 changed files with 78 additions and 238 deletions.
4 changes: 3 additions & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ set(MM_HDRS
variablesmanager.h
workspacesmodel.h
workspacesproxymodel.h
mmstyle.h
)

if (HAVE_BLUETOOTH)
Expand Down Expand Up @@ -259,6 +260,7 @@ endif ()
qt_add_resources(
MM_SRCS
img/pics.qrc
icons/icons.qrc # TODO merge with pics.qrc?
i18n/input_i18n.qrc
fonts/fonts.qrc
)
Expand Down Expand Up @@ -542,7 +544,7 @@ endif ()

add_subdirectory(qml)

# register Singleton
# register Singleton TODO REMOVE!
set_source_files_properties(qml/InputStyle.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE)

# make sure the QML files are not prefixed with "qml/" in the qmldir
Expand Down
File renamed without changes.
File renamed without changes.
Binary file removed app/fonts/Lato-Bold.ttf
Binary file not shown.
Binary file removed app/fonts/Lato-Regular.ttf
Binary file not shown.
72 changes: 0 additions & 72 deletions app/fonts/README.txt

This file was deleted.

4 changes: 2 additions & 2 deletions app/fonts/fonts.qrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<RCC>
<qresource prefix="/">
<file>Lato-Regular.ttf</file>
<file>Lato-Bold.ttf</file>
<file>Inter-Regular.ttf</file>
<file>Inter-SemiBold.ttf</file>
</qresource>
</RCC>
File renamed without changes
2 changes: 1 addition & 1 deletion app/icons/icons.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<file>More.svg</file>
<file>MorePhotos.svg</file>
<file>Mouth.svg</file>
<file>Natural Resources.svg</file>
<file>NaturalResources.svg</file>
<file>Other.svg</file>
<file>Others.svg</file>
<file>ProjectButtonMore.svg</file>
Expand Down
16 changes: 9 additions & 7 deletions app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#include "qgscoordinatetransformcontext.h"
#include "qgsvectorlayer.h"
#include "qgsunittypes.h"
#include "mmstyle.h"

#include "rememberattributescontroller.h"
#include "attributecontroller.h"
Expand Down Expand Up @@ -589,8 +590,9 @@ int main( int argc, char *argv[] )

// we ship our fonts because they do not need to be installed on the target platform
QStringList fonts;
fonts << ":/Lato-Regular.ttf"
<< ":/Lato-Bold.ttf";
fonts << ":/Inter-Regular.ttf"
<< ":/Inter-SemiBold.ttf";

for ( QString font : fonts )
{
if ( QFontDatabase::addApplicationFont( font ) == -1 )
Expand All @@ -610,6 +612,7 @@ int main( int argc, char *argv[] )
// and properly close connection after writting changes to gpkg.
qputenv( "OGR_SQLITE_JOURNAL", "DELETE" );


// Register to QQmlEngine
engine.rootContext()->setContextProperty( "__androidUtils", &au );
engine.rootContext()->setContextProperty( "__iosUtils", &iosUtils );
Expand Down Expand Up @@ -657,12 +660,11 @@ int main( int argc, char *argv[] )
// there are screens that need a "little help", because system DPR has different value than the
// one we calculated. In these scenarios we use a ratio between real (our) DPR and DPR reported by QT.
// Use `value * __dp` for each pixel value in QML
engine.rootContext()->setContextProperty( "__dp", InputUtils::calculateDpRatio() );
qreal dp = InputUtils::calculateDpRatio();
engine.rootContext()->setContextProperty( "__dp", dp );

// due to https://bugreports.qt.io/browse/QTBUG-113751, the right DPI is set when app is created (after this pool)
#if (defined ANDROID && QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) )
QTimer::singleShot( 100, [&engine]() { engine.rootContext()->setContextProperty( "__dp", InputUtils::calculateDpRatio() );} );
#endif
MMStyle mmstyle( dp );
engine.rootContext()->setContextProperty( "__style", &mmstyle );

// Set simulated position for desktop builds
#ifdef DESKTOP_OS
Expand Down
2 changes: 1 addition & 1 deletion app/mmstyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class MMStyle: public QObject
QUrl moreIcon() {return QUrl( "qrc:/More.svg" );}
QUrl morePhotosIcon() {return QUrl( "qrc:/MorePhotos.svg" );}
QUrl mouthIcon() {return QUrl( "qrc:/Mouth.svg" );}
QUrl naturalResourcesIcon() {return QUrl( "qrc:/Natural Resources.svg" );}
QUrl naturalResourcesIcon() {return QUrl( "qrc:/NaturalResources.svg" );}
QUrl otherIcon() {return QUrl( "qrc:/Other.svg" );}
QUrl othersIcon() {return QUrl( "qrc:/Others.svg" );}
QUrl projectButtonMoreIcon() {return QUrl( "qrc:/ProjectButtonMore.svg" );}
Expand Down
49 changes: 49 additions & 0 deletions app/qml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,50 @@ set(MM_QML
components/TextRowWithTitle.qml
components/TextWithIcon.qml
components/ToolbarButton.qml
components/MMBackButton.qml
components/MMButton.qml
components/MMButtonInput.qml
components/MMComboBox.qml
components/MMComponent_reachedDataLimit.qml
components/MMDrawer.qml
components/MMHeader.qml
components/MMHlineText.qml
components/MMIcon.qml
components/MMIconCheckBoxHorizontal.qml
components/MMIconCheckBoxVertical.qml
components/MMInput.qml
components/MMLink.qml
components/MMLinkButton.qml
components/MMListDrawer.qml
components/MMListDrawerItem.qml
components/MMMapButton.qml
components/MMMapLabel.qml
components/MMMenuDrawer.qml
components/MMMorePhoto.qml
components/MMNotification.qml
components/MMNotificationView.qml
components/MMPasswordInput.qml
components/MMPhoto.qml
components/MMPhotoGallery.qml
components/MMProgressBar.qml
components/MMProjectItem.qml
components/MMRadioButton.qml
components/MMRoundButton.qml
components/MMRoundLinkButton.qml
components/MMShadow.qml
components/MMSwitch.qml
components/MMTextArea.qml
components/MMTextBubble.qml
components/MMToolbar.qml
components/MMToolbarButton.qml
components/MMToolbarLongButton.qml
components/MMToolbarMenuButton.qml
onboarding/MMAcceptInvitation.qml
onboarding/MMCreateWorkspace.qml
onboarding/MMHowYouFoundUs.qml
onboarding/MMLogin.qml
onboarding/MMSignUp.qml
onboarding/MMWhichIndustry.qml
dialogs/MigrateToMerginDialog.qml
dialogs/MissingAuthDialog.qml
dialogs/NoPermissionsDialog.qml
Expand All @@ -57,6 +101,11 @@ set(MM_QML
editor/inputvaluerelationcombobox.qml
editor/inputvaluerelationpage.qml
editor/inputspacer.qml
inputs/MMAbstractEditor.qml
inputs/MMCheckBox.qml
inputs/MMInputEditor.qml
inputs/MMPasswordEditor.qml
inputs/MMSliderEditor.qml
form/FeatureForm.qml
form/FeatureFormPage.qml
form/FeatureFormStyling.qml
Expand Down
10 changes: 9 additions & 1 deletion app/qml/onboarding/MMLogin.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ Page {
signal changeServerClicked
signal forgotPasswordClicked

property string apiRoot
/**
* Suppose to be true if auth request is pending. Then busy indicator is running and
* the login button is disabled.
*/
//TODO!!
property bool pending: false

readonly property real hPadding: width < __style.maxPageWidth
? 20 * __dp
: (20 + (width - __style.maxPageWidth) / 2) * __dp
Expand Down Expand Up @@ -131,7 +139,7 @@ Page {
width: parent.width
height: 50 * __dp
anchors.bottom: parent.bottom
text: "https://app.merginmaps.com/"
text: root.apiRoot
leftIcon: __style.globeIcon

onClicked: changeServerDrawer.visible = true
Expand Down
142 changes: 0 additions & 142 deletions app/qml/onboarding/MMOnboarding.qml

This file was deleted.

Loading

1 comment on commit 35a0aa8

@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 23.12.499211 just submitted!

Please sign in to comment.