[PATCH 1/2] QML UI: use Material default switches

Joakim Bygdell j.bygdell at gmail.com
Sat Jul 22 22:26:09 PDT 2017


On 23 July 2017 at 05:30, Rick Walsh <rickmwalsh at gmail.com> wrote:

> The Material theme's default switch is nicer than our own.
>
> Signed-off-by: Rick Walsh <rickmwalsh at gmail.com>
> ---
>  mobile-widgets/qml/CloudCredentials.qml | 21 -----------
>  mobile-widgets/qml/Settings.qml         | 63
> ---------------------------------
>  2 files changed, 84 deletions(-)
>
> diff --git a/mobile-widgets/qml/CloudCredentials.qml b/mobile-widgets/qml/
> CloudCredentials.qml
> index 72a5ccb1..c1f38434 100644
> --- a/mobile-widgets/qml/CloudCredentials.qml
> +++ b/mobile-widgets/qml/CloudCredentials.qml
> @@ -105,27 +105,6 @@ Item {
>                                                 password.text = "" //
> don't show a hidden password
>                                         password.echoMode = checked ?
> TextInput.Normal : TextInput.Password
>                                 }
> -                               indicator: Rectangle {
> -                                       implicitWidth:
> Kirigami.Units.largeSpacing * 3
> -                                       implicitHeight:
> Kirigami.Units.largeSpacing
> -                                       x: showPassword.leftPadding
> -                                       y: parent.height / 2 - height / 2
> -                                       radius:
> Kirigami.Units.largeSpacing * 0.5
> -                                       color: showPassword.checked ?
> -                                               subsurfaceTheme.lightPrimaryColor
> : subsurfaceTheme.backgroundColor
> -                                       border.color: subsurfaceTheme.
> darkerPrimaryColor
> -
> -                                       Rectangle {
> -                                               x: showPassword.checked ?
> parent.width - width : 0
> -                                               y: parent.height / 2 -
> height / 2
> -                                               width:
> Kirigami.Units.largeSpacing * 1.5
> -                                               height:
> Kirigami.Units.largeSpacing * 1.5
> -                                               radius: height / 2
> -                                               color: showPassword.down
> || showPassword.checked ?
> -
>  subsurfaceTheme.primaryColor : subsurfaceTheme.lightPrimaryColor
> -                                               border.color:
> subsurfaceTheme.darkerPrimaryColor
> -                                       }
> -                               }
>                         }
>                 }
>
> diff --git a/mobile-widgets/qml/Settings.qml
> b/mobile-widgets/qml/Settings.qml
> index 8669c3bb..06554ceb 100644
> --- a/mobile-widgets/qml/Settings.qml
> +++ b/mobile-widgets/qml/Settings.qml
> @@ -321,27 +321,6 @@ Kirigami.ScrollablePage {
>                                 onClicked: {
>                                         manager.locationServiceEnabled =
> checked
>                                 }
> -                               indicator: Rectangle {
> -                                       implicitWidth:
> Kirigami.Units.largeSpacing * 3
> -                                       implicitHeight:
> Kirigami.Units.largeSpacing
> -                                       x: locationButton.leftPadding
> -                                       y: parent.height / 2 - height / 2
> -                                       radius:
> Kirigami.Units.largeSpacing * 0.5
> -                                       color: locationButton.checked ?
> -                                               subsurfaceTheme.lightPrimaryColor
> : subsurfaceTheme.backgroundColor
> -                                       border.color: subsurfaceTheme.
> darkerPrimaryColor
> -
> -                                       Rectangle {
> -                                               x: locationButton.checked
> ? parent.width - width : 0
> -                                               y: parent.height / 2 -
> height / 2
> -                                               width:
> Kirigami.Units.largeSpacing * 1.5
> -                                               height:
> Kirigami.Units.largeSpacing * 1.5
> -                                               radius: height / 2
> -                                               color: locationButton.down
> || locationButton.checked ?
> -
>  subsurfaceTheme.primaryColor : subsurfaceTheme.lightPrimaryColor
> -                                               border.color:
> subsurfaceTheme.darkerPrimaryColor
> -                                       }
> -                               }
>                         }
>                 }
>                 Rectangle {
> @@ -374,27 +353,6 @@ Kirigami.ScrollablePage {
>                                 onClicked: {
>                                         manager.libdcLog = checked
>                                 }
> -                               indicator: Rectangle {
> -                                       implicitWidth:
> Kirigami.Units.largeSpacing * 3
> -                                       implicitHeight:
> Kirigami.Units.largeSpacing
> -                                       x: libdclogButton.leftPadding
> -                                       y: parent.height / 2 - height / 2
> -                                       radius:
> Kirigami.Units.largeSpacing * 0.5
> -                                       color: libdclogButton.checked ?
> -                                               subsurfaceTheme.lightPrimaryColor
> : subsurfaceTheme.backgroundColor
> -                                       border.color: subsurfaceTheme.
> darkerPrimaryColor
> -
> -                                       Rectangle {
> -                                               x: libdclogButton.checked
> ? parent.width - width : 0
> -                                               y: parent.height / 2 -
> height / 2
> -                                               width:
> Kirigami.Units.largeSpacing * 1.5
> -                                               height:
> Kirigami.Units.largeSpacing * 1.5
> -                                               radius: height / 2
> -                                               color: libdclogButton.down
> || libdclogButton.checked ?
> -
>  subsurfaceTheme.primaryColor : subsurfaceTheme.lightPrimaryColor
> -                                               border.color:
> subsurfaceTheme.darkerPrimaryColor
> -                                       }
> -                               }
>                         }
>                 }
>                 Rectangle {
> @@ -427,27 +385,6 @@ Kirigami.ScrollablePage {
>                                 onClicked: {
>                                         manager.developer = checked
>                                 }
> -                               indicator: Rectangle {
> -                                       implicitWidth:
> Kirigami.Units.largeSpacing * 3
> -                                       implicitHeight:
> Kirigami.Units.largeSpacing
> -                                       x: developerButton.leftPadding
> -                                       y: parent.height / 2 - height / 2
> -                                       radius:
> Kirigami.Units.largeSpacing * 0.5
> -                                       color: developerButton.checked ?
> -                                               subsurfaceTheme.lightPrimaryColor
> : subsurfaceTheme.backgroundColor
> -                                       border.color: subsurfaceTheme.
> darkerPrimaryColor
> -
> -                                       Rectangle {
> -                                               x: developerButton.checked
> ? parent.width - width : 0
> -                                               y: parent.height / 2 -
> height / 2
> -                                               width:
> Kirigami.Units.largeSpacing * 1.5
> -                                               height:
> Kirigami.Units.largeSpacing * 1.5
> -                                               radius: height / 2
> -                                               color:
> developerButton.down || developerButton.checked ?
> -
>  subsurfaceTheme.primaryColor : subsurfaceTheme.lightPrimaryColor
> -                                               border.color:
> subsurfaceTheme.darkerPrimaryColor
> -                                       }
> -                               }
>                         }
>                 }
>                 Item {
> --
> 2.13.3
>
> _______________________________________________
> subsurface mailing list
> subsurface at subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>


In which way does a white button on a white background look better??

There is no styling what so ever on that button meaning that it will be
white
even when the dark theme is in use.

-- 
Jocke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20170723/f33ccdab/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: switch.png
Type: image/png
Size: 57138 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20170723/f33ccdab/attachment-0001.png>


More information about the subsurface mailing list