Merge branch 'MobileUI' of git://github.com/jbygdell/subsurface

This commit is contained in:
Dirk Hohndel 2017-07-17 07:39:48 -07:00
commit c7e284369a
6 changed files with 72 additions and 4 deletions

View file

@ -70,6 +70,7 @@ Item {
Kirigami.Label { Kirigami.Label {
id: buttonText id: buttonText
text: qsTr("Map it") text: qsTr("Map it")
visible: dive.gps !== ""
color: subsurfaceTheme.darkerPrimaryTextColor color: subsurfaceTheme.darkerPrimaryTextColor
anchors { anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter

View file

@ -36,6 +36,26 @@ Kirigami.AbstractListItem {
checked: innerListItem.selected; checked: innerListItem.selected;
width: childrenRect.heigh - Kirigami.Units.smallSpacing; width: childrenRect.heigh - Kirigami.Units.smallSpacing;
height: childrenRect.heigh - Kirigami.Units.smallSpacing; height: childrenRect.heigh - Kirigami.Units.smallSpacing;
indicator: Rectangle {
visible: diveIsSelected
implicitWidth: 20
implicitHeight: 20
x: isBluetooth.leftPadding
y: parent.height / 2 - height / 2
radius: 4
border.color: diveIsSelected.down ? subsurfaceTheme.PrimaryColor : subsurfaceTheme.darkerPrimaryColor
color: subsurfaceTheme.backgroundColor
Rectangle {
width: 12
height: 12
x: 4
y: 4
radius: 3
color: diveIsSelected.down ? subsurfaceTheme.PrimaryColor : subsurfaceTheme.darkerPrimaryColor
visible: diveIsSelected && diveIsSelected.checked
}
}
} }
Item { Item {
id: diveListEntry id: diveListEntry

View file

@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
import QtQuick 2.3 import QtQuick 2.6
import QtQuick.Controls 2.0
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
@ -26,40 +27,48 @@ Kirigami.ScrollablePage {
width: parent.width width: parent.width
Kirigami.Label { Kirigami.Label {
text: qsTr('Date: ') text: qsTr('Date: ')
color: subsurfaceTheme.textColor
opacity: 0.6 opacity: 0.6
font.pointSize: subsurfaceTheme.smallPointSize font.pointSize: subsurfaceTheme.smallPointSize
} }
Kirigami.Label { Kirigami.Label {
text: date text: date
color: subsurfaceTheme.textColor
Layout.preferredWidth: Math.max(parent.width / 5, paintedWidth) Layout.preferredWidth: Math.max(parent.width / 5, paintedWidth)
font.pointSize: subsurfaceTheme.smallPointSize font.pointSize: subsurfaceTheme.smallPointSize
} }
Kirigami.Label { Kirigami.Label {
text: qsTr('Name: ') text: qsTr('Name: ')
color: subsurfaceTheme.textColor
opacity: 0.6 opacity: 0.6
font.pointSize: subsurfaceTheme.smallPointSize font.pointSize: subsurfaceTheme.smallPointSize
} }
Kirigami.Label { Kirigami.Label {
text: name text: name
color: subsurfaceTheme.textColor
Layout.preferredWidth: Math.max(parent.width / 5, paintedWidth) Layout.preferredWidth: Math.max(parent.width / 5, paintedWidth)
font.pointSize: subsurfaceTheme.smallPointSize font.pointSize: subsurfaceTheme.smallPointSize
} }
Kirigami.Label { Kirigami.Label {
text: qsTr('Latitude: ') text: qsTr('Latitude: ')
color: subsurfaceTheme.textColor
opacity: 0.6 opacity: 0.6
font.pointSize: subsurfaceTheme.smallPointSize font.pointSize: subsurfaceTheme.smallPointSize
} }
Kirigami.Label { Kirigami.Label {
text: latitude text: latitude
color: subsurfaceTheme.textColor
font.pointSize: subsurfaceTheme.smallPointSize font.pointSize: subsurfaceTheme.smallPointSize
} }
Kirigami.Label { Kirigami.Label {
text: qsTr('Longitude: ') text: qsTr('Longitude: ')
color: subsurfaceTheme.textColor
opacity: 0.6 opacity: 0.6
font.pointSize: subsurfaceTheme.smallPointSize font.pointSize: subsurfaceTheme.smallPointSize
} }
Kirigami.Label { Kirigami.Label {
text: longitude text: longitude
color: subsurfaceTheme.textColor
font.pointSize: subsurfaceTheme.smallPointSize font.pointSize: subsurfaceTheme.smallPointSize
} }
} }

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
import QtQuick 2.4 import QtQuick 2.4
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Controls.Material 2.1
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
@ -287,6 +288,25 @@ if you have network connectivity and want to sync your data to cloud storage."),
onCheckedChanged: { onCheckedChanged: {
manager.locationServiceEnabled = checked; manager.locationServiceEnabled = checked;
} }
indicator: Rectangle {
implicitWidth: 20
implicitHeight: 20
x: locationCheckbox.leftPadding
y: parent.height / 2 - height / 2
radius: 4
border.color: locationCheckbox.down ? subsurfaceTheme.PrimaryColor : subsurfaceTheme.darkerPrimaryColor
color: subsurfaceTheme.drawerColor
Rectangle {
width: 12
height: 12
x: 4
y: 4
radius: 3
color: locationCheckbox.down ? subsurfaceTheme.PrimaryColor : subsurfaceTheme.darkerPrimaryColor
visible: locationCheckbox && locationCheckbox.checked
}
}
} }
Kirigami.Label { Kirigami.Label {
x: Kirigami.Units.gridUnit * 1.5 x: Kirigami.Units.gridUnit * 1.5
@ -305,6 +325,8 @@ if you have network connectivity and want to sync your data to cloud storage."),
} }
function blueTheme() { function blueTheme() {
Material.theme = Material.Light
Material.accent = subsurfaceTheme.blueDarkerPrimaryColor
subsurfaceTheme.currentTheme = "Blue" subsurfaceTheme.currentTheme = "Blue"
subsurfaceTheme.darkerPrimaryColor = subsurfaceTheme.blueDarkerPrimaryColor subsurfaceTheme.darkerPrimaryColor = subsurfaceTheme.blueDarkerPrimaryColor
subsurfaceTheme.darkerPrimaryTextColor= subsurfaceTheme.blueDarkerPrimaryTextColor subsurfaceTheme.darkerPrimaryTextColor= subsurfaceTheme.blueDarkerPrimaryTextColor
@ -316,9 +338,12 @@ if you have network connectivity and want to sync your data to cloud storage."),
subsurfaceTheme.textColor = subsurfaceTheme.blueTextColor subsurfaceTheme.textColor = subsurfaceTheme.blueTextColor
subsurfaceTheme.secondaryTextColor = subsurfaceTheme.blueSecondaryTextColor subsurfaceTheme.secondaryTextColor = subsurfaceTheme.blueSecondaryTextColor
manager.setStatusbarColor(subsurfaceTheme.darkerPrimaryColor) manager.setStatusbarColor(subsurfaceTheme.darkerPrimaryColor)
subsurfaceTheme.drawerColor = subsurfaceTheme.lightDrawerColor
} }
function pinkTheme() { function pinkTheme() {
Material.theme = Material.Light
Material.accent = subsurfaceTheme.pinkDarkerPrimaryColor
subsurfaceTheme.currentTheme = "Pink" subsurfaceTheme.currentTheme = "Pink"
subsurfaceTheme.darkerPrimaryColor = subsurfaceTheme.pinkDarkerPrimaryColor subsurfaceTheme.darkerPrimaryColor = subsurfaceTheme.pinkDarkerPrimaryColor
subsurfaceTheme.darkerPrimaryTextColor = subsurfaceTheme.pinkDarkerPrimaryTextColor subsurfaceTheme.darkerPrimaryTextColor = subsurfaceTheme.pinkDarkerPrimaryTextColor
@ -330,9 +355,12 @@ if you have network connectivity and want to sync your data to cloud storage."),
subsurfaceTheme.textColor = subsurfaceTheme.pinkTextColor subsurfaceTheme.textColor = subsurfaceTheme.pinkTextColor
subsurfaceTheme.secondaryTextColor = subsurfaceTheme.pinkSecondaryTextColor subsurfaceTheme.secondaryTextColor = subsurfaceTheme.pinkSecondaryTextColor
manager.setStatusbarColor(subsurfaceTheme.darkerPrimaryColor) manager.setStatusbarColor(subsurfaceTheme.darkerPrimaryColor)
subsurfaceTheme.drawerColor = subsurfaceTheme.lightDrawerColor
} }
function darkTheme() { function darkTheme() {
Material.theme = Material.Dark
Material.accent = subsurfaceTheme.darkDarkerPrimaryColor
subsurfaceTheme.currentTheme = "Dark" subsurfaceTheme.currentTheme = "Dark"
subsurfaceTheme.darkerPrimaryColor = subsurfaceTheme.darkDarkerPrimaryColor subsurfaceTheme.darkerPrimaryColor = subsurfaceTheme.darkDarkerPrimaryColor
subsurfaceTheme.darkerPrimaryTextColor= subsurfaceTheme.darkDarkerPrimaryTextColor subsurfaceTheme.darkerPrimaryTextColor= subsurfaceTheme.darkDarkerPrimaryTextColor
@ -344,6 +372,7 @@ if you have network connectivity and want to sync your data to cloud storage."),
subsurfaceTheme.textColor = subsurfaceTheme.darkTextColor subsurfaceTheme.textColor = subsurfaceTheme.darkTextColor
subsurfaceTheme.secondaryTextColor = subsurfaceTheme.darkSecondaryTextColor subsurfaceTheme.secondaryTextColor = subsurfaceTheme.darkSecondaryTextColor
manager.setStatusbarColor(subsurfaceTheme.darkerPrimaryColor) manager.setStatusbarColor(subsurfaceTheme.darkerPrimaryColor)
subsurfaceTheme.drawerColor = subsurfaceTheme.darkDrawerColor
} }
QtObject { QtObject {
@ -362,6 +391,7 @@ if you have network connectivity and want to sync your data to cloud storage."),
property color backgroundColor property color backgroundColor
property color textColor property color textColor
property color secondaryTextColor property color secondaryTextColor
property color drawerColor
// colors for the blue theme // colors for the blue theme
property color blueDarkerPrimaryColor: "#303F9f" property color blueDarkerPrimaryColor: "#303F9f"
@ -375,7 +405,7 @@ if you have network connectivity and want to sync your data to cloud storage."),
property color blueSecondaryTextColor: "#757575" property color blueSecondaryTextColor: "#757575"
// colors for the pink theme // colors for the pink theme
property color pinkDarkerPrimaryColor: "#FF1493" property color pinkDarkerPrimaryColor: "#C2185B"
property color pinkDarkerPrimaryTextColor: "#ECECEC" property color pinkDarkerPrimaryTextColor: "#ECECEC"
property color pinkPrimaryColor: "#FF69B4" property color pinkPrimaryColor: "#FF69B4"
property color pinkPrimaryTextColor: "#212121" property color pinkPrimaryTextColor: "#212121"
@ -392,19 +422,25 @@ if you have network connectivity and want to sync your data to cloud storage."),
property color darkPrimaryTextColor: "#ECECEC" property color darkPrimaryTextColor: "#ECECEC"
property color darkLightPrimaryColor: "#C5CAE9" property color darkLightPrimaryColor: "#C5CAE9"
property color darkLightPrimaryTextColor: "#212121" property color darkLightPrimaryTextColor: "#212121"
property color darkBackgroundColor: "#000000" property color darkBackgroundColor: "#303030"
property color darkTextColor: darkPrimaryTextColor property color darkTextColor: darkPrimaryTextColor
property color darkSecondaryTextColor: "#757575" property color darkSecondaryTextColor: "#757575"
property color contrastAccentColor: "#FF5722" // used for delete button property color contrastAccentColor: "#FF5722" // used for delete button
property color lightDrawerColor: "#FFFFFF"
property color darkDrawerColor: "#424242"
property int columnWidth: Math.round(rootItem.width/(Kirigami.Units.gridUnit*28)) > 0 ? Math.round(rootItem.width / Math.round(rootItem.width/(Kirigami.Units.gridUnit*28))) : rootItem.width property int columnWidth: Math.round(rootItem.width/(Kirigami.Units.gridUnit*28)) > 0 ? Math.round(rootItem.width / Math.round(rootItem.width/(Kirigami.Units.gridUnit*28))) : rootItem.width
Component.onCompleted: { Component.onCompleted: {
Kirigami.Theme.highlightColor = Qt.binding(function() { return darkerPrimaryColor }) Kirigami.Theme.highlightColor = Qt.binding(function() { return darkerPrimaryColor })
Kirigami.Theme.highlighedTextColor = Qt.binding(function() { return darkerPrimaryTextColor }) Kirigami.Theme.highlightedTextColor = Qt.binding(function() { return darkerPrimaryTextColor })
Kirigami.Theme.backgroundColor = Qt.binding(function() { return backgroundColor }) Kirigami.Theme.backgroundColor = Qt.binding(function() { return backgroundColor })
Kirigami.Theme.textColor = Qt.binding(function() { return textColor }) Kirigami.Theme.textColor = Qt.binding(function() { return textColor })
Kirigami.Theme.buttonHoverColor = Qt.binding(function() { return darkerPrimaryColor }) Kirigami.Theme.buttonHoverColor = Qt.binding(function() { return darkerPrimaryColor })
Kirigami.Theme.viewBackgroundColor = Qt.binding(function() { return drawerColor })
Kirigami.Theme.viewTextColor = Qt.binding(function() { return textColor })
Kirigami.Theme.buttonBackgroundColor = Qt.binding(function() { return darkerPrimaryColor })
Kirigami.Theme.buttonTextColor = Qt.binding(function() { return textColor })
// this needs to pick the theme from persistent preference settings // this needs to pick the theme from persistent preference settings
var theme = manager.theme var theme = manager.theme

View file

@ -29,6 +29,7 @@
<file alias="icons/go-previous.svg">kirigami/icons/go-previous.svg</file> <file alias="icons/go-previous.svg">kirigami/icons/go-previous.svg</file>
<file alias="icons/go-up.svg">kirigami/icons/go-up.svg</file> <file alias="icons/go-up.svg">kirigami/icons/go-up.svg</file>
<file alias="icons/handle-left.svg">kirigami/icons/handle-left.svg</file> <file alias="icons/handle-left.svg">kirigami/icons/handle-left.svg</file>
<file alias="icons/handle-right.svg">kirigami/icons/handle-right.svg</file>
<file alias="icons/distribute-horizontal-x.svg">kirigami/icons/distribute-horizontal-x.svg</file> <file alias="icons/distribute-horizontal-x.svg">kirigami/icons/distribute-horizontal-x.svg</file>
<file alias="icons/document-edit.svg">kirigami/icons/document-edit.svg</file> <file alias="icons/document-edit.svg">kirigami/icons/document-edit.svg</file>
<file alias="icons/document-save.svg">kirigami/icons/document-save.svg</file> <file alias="icons/document-save.svg">kirigami/icons/document-save.svg</file>

View file

@ -67,6 +67,7 @@ cp $BREEZE/icons/actions/22/gps.svg $MC/icons
cp $BREEZE/icons/actions/24/trash-empty.svg $MC/icons cp $BREEZE/icons/actions/24/trash-empty.svg $MC/icons
cp $BREEZE/icons/actions/24/list-add.svg $MC/icons cp $BREEZE/icons/actions/24/list-add.svg $MC/icons
cp $BREEZE/icons/actions/22/handle-left.svg $MC/icons cp $BREEZE/icons/actions/22/handle-left.svg $MC/icons
cp $BREEZE/icons/actions/22/handle-right.svg $MC/icons
# kirigami now needs the breeze-icons internally as well # kirigami now needs the breeze-icons internally as well
pushd $MC pushd $MC