<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 18 July 2017 at 22:10, Rick Walsh <span dir="ltr"><<a href="mailto:rickmwalsh@gmail.com" target="_blank">rickmwalsh@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Dirk and Jocke (especially),<br></div>I can see you've done a lot over the past few weeks to make the mobile UI much more attracted.  Have you considered using a custom Subsurface style (falling back to Material) to make it more efficient to theme the QML controls?  It would be easier to customize the controls in one place, and have the change made consistently throughout, following the guidance in:<br></div><a href="https://doc.qt.io/qt-5/qtquickcontrols2-customize.html#creating-a-custom-style" target="_blank">https://doc.qt.io/qt-5/<wbr>qtquickcontrols2-customize.<wbr>html#creating-a-custom-style</a></div></div></div></div></div></div></blockquote><div><br></div><div>The thing is that we are not just dealing with the material theme here, Kirigami has it own theme as well. </div><div>And the interaction between these two are in some cases a bit special as there are parts where the material theme decides what the user sees and other parts where the Kirigami decides how things will look.</div><div>Right now we just tell the app that for material light theme to set a few parameters to our own colors, the rest is actually handled by the Kirigami theme.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><br><br></div>In the attached patch I have done that for the button controls (only used on DownloadFromDiveComputer.qml) moving the styling into SubsurfaceStyle/Button.qml, but it would not be hard to do it for the other controls.  Using the Button as an example, we could then add code to make the button depress and change colour when down, and only have to add the code in one place.<br><br></div>The big problem now, is that the only way I've been able to use the custom style is to select it from the command line (testing on desktop):<br>./subsurface-mobile -style /home/rick/src/subsurface/<wbr>mobile-widgets/qml/<wbr>SubsurfaceStyle<br></div>Clearly that is useless for the mobile app.  I believe we should also be able to use QQuickStyle::SetStyle to set it from within the app (see <a href="https://doc.qt.io/qt-5/qquickstyle.html" target="_blank">https://doc.qt.io/qt-5/<wbr>qquickstyle.html</a>), but the following doesn't work for me, either with or with setting the fallback style.  Maybe the problem is that I'm using Qt5.7, but I'm not sure.<br><br>diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp<br>index 68dd228b..cd1df6c6 100644<br>--- a/subsurface-mobile-helper.cpp<br>+++ b/subsurface-mobile-helper.cpp<br>@@ -14,6 +14,7 @@<br> <br> #include <QQuickWindow><br> #include <QScreen><br>+#include <QQuickStyle><br> #include <QQmlApplicationEngine><br> #include <QQmlContext><br> #include <QSortFilterProxyModel><br>@@ -43,6 +44,10 @@ void run_ui()<br>        qmlRegisterType<<wbr>DownloadThread>("org.<wbr>subsurfacedivelog.mobile", 1, 0, "DCDownloadThread");<br>        qmlRegisterType<<wbr>DiveImportedModel>("org.<wbr>subsurfacedivelog.mobile", 1, 0, "DCImportModel");<br> <br>+       // set style for custom constrols<br>+       QQuickStyle::setStyle(":/<wbr>SubsurfaceStyle");<br>+       QQuickStyle::setFallbackStyle(<wbr>"Material");<br>+<br>        QQmlApplicationEngine engine;<br>        KirigamiPlugin::getInstance().<wbr>registerTypes();<br> #if __APPLE__<br><br></div>Cheers,<br><br></div>Rick<br></div>
<br>______________________________<wbr>_________________<br>
subsurface mailing list<br>
<a href="mailto:subsurface@subsurface-divelog.org">subsurface@subsurface-divelog.<wbr>org</a><br>
<a href="http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface" rel="noreferrer" target="_blank">http://lists.subsurface-<wbr>divelog.org/cgi-bin/mailman/<wbr>listinfo/subsurface</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><br></div><div dir="ltr">Jocke</div></div>
</div></div>