diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7aac06f6b..dea200c36 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -238,12 +238,16 @@ if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "MobileExecutable")
else()
add_executable(${SUBSURFACE_TARGET} MACOSX_BUNDLE WIN32 ${SUBSURFACE_PKG} ${MOBILE_SRC} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES})
endif()
+ ADD_LIBRARY(kirigami_static_library STATIC IMPORTED)
+ SET_TARGET_PROPERTIES(kirigami_static_library PROPERTIES
+ IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/mobile-widgets/qml/kirigami/build/src/libkirigamiplugin.a)
target_link_libraries(
${SUBSURFACE_TARGET}
subsurface_profile
subsurface_models
subsurface_corelib
${SUBSURFACE_LINK_LIBRARIES}
+ kirigami_static_library
)
elseif(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "DesktopExecutable")
set(SUBSURFACE_APP
diff --git a/mobile-widgets/qml/mobile-resources.qrc b/mobile-widgets/qml/mobile-resources.qrc
index 698353323..b95ce4134 100644
--- a/mobile-widgets/qml/mobile-resources.qrc
+++ b/mobile-widgets/qml/mobile-resources.qrc
@@ -23,50 +23,18 @@
icons/menu-back.png
icons/nocloud.svg
-
- kirigami/qmldir
- kirigami/Action.qml
- kirigami/ApplicationWindow.qml
- kirigami/BasicListItem.qml
- kirigami/GlobalDrawer.qml
- kirigami/ContextDrawer.qml
- kirigami/Page.qml
- kirigami/ScrollablePage.qml
- kirigami/Icon.qml
- kirigami/Heading.qml
- kirigami/OverlaySheet.qml
- kirigami/ApplicationHeader.qml
- kirigami/AbstractApplicationHeader.qml
- kirigami/AbstractApplicationWindow.qml
- kirigami/private/PageRow.qml
- kirigami/Label.qml
- kirigami/AbstractListItem.qml
- kirigami/SwipeListItem.qml
- kirigami/OverlayDrawer.qml
- kirigami/Theme.qml
- kirigami/Units.qml
- kirigami/private/AbstractDrawer.qml
- kirigami/private/ActionButton.qml
- kirigami/private/BackButton.qml
- kirigami/private/ContextIcon.qml
- kirigami/private/CornerShadow.qml
- kirigami/private/DefaultListItemBackground.qml
- kirigami/private/EdgeShadow.qml
- kirigami/private/MenuIcon.qml
- kirigami/private/PageActionPropertyGroup.qml
- kirigami/private/PassiveNotification.qml
- kirigami/private/RefreshableScrollView.qml
- kirigami/icons/go-next.svg
- kirigami/icons/go-previous.svg
- kirigami/icons/handle-left.svg
- kirigami/icons/distribute-horizontal-x.svg
- kirigami/icons/document-edit.svg
- kirigami/icons/document-save.svg
- kirigami/icons/view-readermode.svg
- kirigami/icons/dialog-cancel.svg
- kirigami/icons/application-menu.svg
- kirigami/icons/gps.svg
- kirigami/icons/trash-empty.svg
- kirigami/icons/list-add.svg
+
+ kirigami/icons/go-next.svg
+ kirigami/icons/go-previous.svg
+ kirigami/icons/handle-left.svg
+ kirigami/icons/distribute-horizontal-x.svg
+ kirigami/icons/document-edit.svg
+ kirigami/icons/document-save.svg
+ kirigami/icons/view-readermode.svg
+ kirigami/icons/dialog-cancel.svg
+ kirigami/icons/application-menu.svg
+ kirigami/icons/gps.svg
+ kirigami/icons/trash-empty.svg
+ kirigami/icons/list-add.svg
diff --git a/packaging/android/build.sh b/packaging/android/build.sh
index 408a5467d..5319c4d46 100644
--- a/packaging/android/build.sh
+++ b/packaging/android/build.sh
@@ -316,6 +316,13 @@ if [ "$SUBSURFACE_MOBILE" = "ON" ] ; then
pushd $SUBSURFACE_SOURCE
bash ./scripts/mobilecomponents.sh
popd
+
+ cd $SUBSURFACE_SOURCE/mobile-widgets/qml/kirigami/
+ mkdir -p build
+ cd build
+ cmake .. -DSTATIC_LIBRARY=ON
+ make -j4
+ make install
fi
if [ ! -z "$SUBSURFACE_MOBILE" ] ; then
diff --git a/scripts/build.sh b/scripts/build.sh
index 014d2d32b..635f1b155 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -211,6 +211,9 @@ if [ "$BUILDGRANTLEE" = "1" ] ; then
make install
fi
+
+
+
# finally, build Subsurface
if [ $PLATFORM = Darwin ] ; then
@@ -229,6 +232,13 @@ for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do
if [ "$SUBSURFACE_EXECUTABLE" = "MobileExecutable" ] ; then
cd $SRC/subsurface
bash ./scripts/mobilecomponents.sh
+
+ cd $SRC/subsurface/mobile-widgets/qml/kirigami/
+ mkdir -p build
+ cd build
+ cmake .. -DSTATIC_LIBRARY=ON
+ make -j4
+ make install
fi
mkdir -p $SRC/subsurface/$BUILDDIR
diff --git a/scripts/mobilecomponents.sh b/scripts/mobilecomponents.sh
index ec1e97f97..4072bf413 100755
--- a/scripts/mobilecomponents.sh
+++ b/scripts/mobilecomponents.sh
@@ -44,16 +44,12 @@ fi
# now copy the components and a couple of icons into plae
MC=$SRC/subsurface/mobile-widgets/qml/kirigami
-PMMC=kirigami/src/qml
+PMMC=kirigami
BREEZE=breeze-icons
rm -rf $MC
mkdir -p $MC/icons
cp -R $PMMC/* $MC/
-cp $PMMC/../fallbacktheme/*qml $MC/
-
-# fix plugin requirement
-sed -i -e 's/^plugin kirigamiplugin/# plugin kirigamiplugin/' $MC/qmldir
cp $BREEZE/icons/actions/24/dialog-cancel.svg $MC/icons
cp $BREEZE/icons/actions/24/distribute-horizontal-x.svg $MC/icons
diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp
index 2093af9f4..d038336c4 100644
--- a/subsurface-mobile-helper.cpp
+++ b/subsurface-mobile-helper.cpp
@@ -21,6 +21,9 @@
#include "qt-models/gpslistmodel.h"
#include "mobile-widgets/qmlprofile.h"
+#define KIRIGAMI_BUILD_TYPE_STATIC
+#include "mobile-widgets/qml/kirigami/src/kirigamiplugin.h"
+
QObject *qqWindowObject = NULL;
void init_ui()
@@ -32,7 +35,9 @@ void run_ui()
{
qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "QMLManager");
qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "QMLProfile");
+
QQmlApplicationEngine engine;
+ KirigamiPlugin::getInstance().registerTypes();
#if __APPLE__
// when running the QML UI on a Mac the deployment of the QML Components seems
// to fail and the search path for the components is rather odd - simply the