Merge branch 'mobilecomponents' of github.com:sebasje/subsurface

This commit is contained in:
Dirk Hohndel 2015-11-29 19:58:29 -08:00
commit 9d62258316
14 changed files with 332 additions and 240 deletions

View file

@ -28,132 +28,146 @@ MobileComponents.Page {
qmlProfile.update() qmlProfile.update()
} }
Flickable { ScrollView {
id: flick
anchors.fill: parent anchors.fill: parent
contentHeight: content.height Flickable {
clip: true id: flick
Item { anchors.fill: parent
id: content contentHeight: content.height
width: flick.width clip: true
height: contentRect.height + MobileComponents.Units.smallSpacing * 2 Item {
id: content
width: flick.width
height: childrenRect.height + MobileComponents.Units.smallSpacing * 2
ColumnLayout { ColumnLayout {
anchors { anchors {
left: parent.left left: parent.left
right: parent.right right: parent.right
top: parent.top top: parent.top
margins: MobileComponents.Units.smallSpacing margins: MobileComponents.Units.smallSpacing
}
spacing: MobileComponents.Units.smallSpacing
GridLayout {
id: editorDetails
width: parent.width
columns: 2
MobileComponents.Heading {
Layout.columnSpan: 2
text: "Dive " + number + " (" + date + ")"
} }
spacing: MobileComponents.Units.smallSpacing
Item {
Layout.columnSpan: 2 GridLayout {
Layout.fillWidth: true id: editorDetails
Layout.preferredHeight: qmlProfile.visible ? qmlProfile.height : profileHideButton.height width: parent.width
QMLProfile { columns: 2
id: qmlProfile
height: MobileComponents.Units.gridUnit * 25 MobileComponents.Heading {
anchors { Layout.columnSpan: 2
top: parent.top text: "Dive " + number + " (" + date + ")"
left: parent.left
right: parent.right
}
//Rectangle { color: "green"; opacity: 0.4; anchors.fill: parent } // used for debugging the dive profile sizing, will be removed later
} }
Button {
id: profileHideButton Item {
anchors { Layout.columnSpan: 2
right: parent.right Layout.fillWidth: true
top: parent.top Layout.preferredHeight: qmlProfile.visible ? qmlProfile.height : profileHideButton.height
QMLProfile {
id: qmlProfile
height: MobileComponents.Units.gridUnit * 25
anchors {
top: parent.top
left: parent.left
right: parent.right
}
//Rectangle { color: "green"; opacity: 0.4; anchors.fill: parent } // used for debugging the dive profile sizing, will be removed later
} }
text: "Hide Dive Profile" Button {
onClicked: { id: profileHideButton
qmlProfile.visible = !qmlProfile.visible anchors {
if (qmlProfile.visible) { right: parent.right
text = "Hide Dive Profile" top: parent.top
} else { }
text = "Show Dive Profile" text: "Hide Dive Profile"
onClicked: {
qmlProfile.visible = !qmlProfile.visible
if (qmlProfile.visible) {
text = "Hide Dive Profile"
} else {
text = "Show Dive Profile"
}
} }
} }
} }
} MobileComponents.Label {
Label { Layout.alignment: Qt.AlignRight
text: "Location:" text: "Location:"
} }
TextField { TextField {
id: txtLocation; text: location; id: txtLocation; text: location;
Layout.fillWidth: true Layout.fillWidth: true
} }
Label { MobileComponents.Label {
text: "Air Temp:" Layout.alignment: Qt.AlignRight
} text: "Air Temp:"
TextField { }
id: txtAirTemp TextField {
text: airtemp id: txtAirTemp
Layout.fillWidth: true text: airtemp
} Layout.fillWidth: true
}
Label { MobileComponents.Label {
text: "Water Temp:" Layout.alignment: Qt.AlignRight
} text: "Water Temp:"
TextField { }
id: txtWaterTemp TextField {
text: watertemp id: txtWaterTemp
Layout.fillWidth: true text: watertemp
} Layout.fillWidth: true
}
Label { MobileComponents.Label {
text: "Suit:" Layout.alignment: Qt.AlignRight
text: "Suit:"
} }
TextField { TextField {
id: txtSuit id: txtSuit
text: suit text: suit
Layout.fillWidth: true Layout.fillWidth: true
} }
Label { MobileComponents.Label {
text: "Buddy:" Layout.alignment: Qt.AlignRight
} text: "Buddy:"
TextField { }
id: txtBuddy TextField {
text: buddy id: txtBuddy
Layout.fillWidth: true text: buddy
} Layout.fillWidth: true
}
Label { MobileComponents.Label {
text: "Dive Master:" Layout.alignment: Qt.AlignRight
} text: "Dive Master:"
TextField { }
id: txtDiveMaster TextField {
text: divemaster id: txtDiveMaster
Layout.fillWidth: true text: divemaster
} Layout.fillWidth: true
}
Label { MobileComponents.Label {
text: "Notes:" Layout.alignment: Qt.AlignRight
text: "Notes:"
}
TextArea {
id: txtNotes
text: notes
focus: true
Layout.fillWidth: true
Layout.fillHeight: true
selectByMouse: true
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
}
} }
TextEdit{ Item {
id: txtNotes height: MobileComponents.Units.gridUnit * 3
text: notes width: height // just to make sure the spacer doesn't produce scrollbars, but also isn't null
focus: true
Layout.fillWidth: true
Layout.fillHeight: true
selectByMouse: true
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
} }
} }
} }

View file

@ -39,22 +39,14 @@ MobileComponents.Page {
stackView.push(detailsWindow) stackView.push(detailsWindow)
} }
//Layout of the page: (mini profile, dive no, date at the top
//And other details at the bottom.
Item { Item {
x: MobileComponents.Units.smallSpacing
width: parent.width - MobileComponents.Units.smallSpacing * 2 width: parent.width - MobileComponents.Units.smallSpacing * 2
height: childrenRect.height + MobileComponents.Units.smallSpacing * 2 height: childrenRect.height - MobileComponents.Units.smallSpacing
//spacing: MobileComponents.Units.smallSpacing / 2
anchors.margins: MobileComponents.Units.smallSpacing
Text { MobileComponents.Label {
id: locationText id: locationText
text: location text: location
color: MobileComponents.Theme.textColor font.weight: Font.Light
//font.pointSize: Math.round(MobileComponents.Units.fontMetrics.pointSize * 1.2) // why this doesn't work is a mystery to me, so ...
scale: 1.2 // Let's see how this works, otherwise, we'll need the default point size somewhere
transformOrigin: Item.TopLeft
elide: Text.ElideRight elide: Text.ElideRight
maximumLineCount: 1 // needed for elide to work at all maximumLineCount: 1 // needed for elide to work at all
anchors { anchors {
@ -63,16 +55,14 @@ MobileComponents.Page {
right: dateLabel.left right: dateLabel.left
} }
} }
Text { MobileComponents.Label {
id: dateLabel id: dateLabel
text: date text: date
opacity: 0.6 opacity: 0.6
color: MobileComponents.Theme.textColor
font.pointSize: subsurfaceTheme.smallPointSize font.pointSize: subsurfaceTheme.smallPointSize
anchors { anchors {
right: parent.right right: parent.right
top: parent.top top: parent.top
bottomMargin: MobileComponents.Units.smallSpacing / 2
} }
} }
Row { Row {
@ -82,36 +72,34 @@ MobileComponents.Page {
right: parent.right right: parent.right
bottom: numberText.bottom bottom: numberText.bottom
} }
Text { MobileComponents.Label {
text: 'Depth: ' text: 'Depth: '
opacity: 0.6 opacity: 0.6
color: MobileComponents.Theme.textColor font.pointSize: subsurfaceTheme.smallPointSize
} }
Text { MobileComponents.Label {
text: depth text: depth
width: Math.max(MobileComponents.Units.gridUnit * 3, paintedWidth) // helps vertical alignment throughout listview width: Math.max(MobileComponents.Units.gridUnit * 3, paintedWidth) // helps vertical alignment throughout listview
color: MobileComponents.Theme.textColor font.pointSize: subsurfaceTheme.smallPointSize
} }
Text { MobileComponents.Label {
text: 'Duration: ' text: 'Duration: '
opacity: 0.6 opacity: 0.6
color: MobileComponents.Theme.textColor font.pointSize: subsurfaceTheme.smallPointSize
} }
Text { MobileComponents.Label {
text: duration text: duration
color: MobileComponents.Theme.textColor font.pointSize: subsurfaceTheme.smallPointSize
} }
} }
Text { MobileComponents.Label {
id: numberText id: numberText
text: "#" + diveNumber text: "#" + diveNumber
color: MobileComponents.Theme.textColor color: MobileComponents.Theme.textColor
scale: 1.2 font.pointSize: subsurfaceTheme.smallPointSize
transformOrigin: Item.BottomRight opacity: 0.6
opacity: 0.4
anchors { anchors {
right: parent.right right: parent.right
topMargin: MobileComponents.Units.smallSpacing
top: locationText.bottom top: locationText.bottom
} }
} }

View file

@ -20,10 +20,9 @@ Item {
anchors.fill: parent anchors.fill: parent
anchors.margins: MobileComponents.Units.gridUnit anchors.margins: MobileComponents.Units.gridUnit
Label { MobileComponents.Heading {
text: "Cloud credentials" text: "Cloud credentials"
Layout.bottomMargin: MobileComponents.Units.largeSpacing Layout.bottomMargin: MobileComponents.Units.largeSpacing / 2
font.pointSize: subsurfaceTheme.titlePointSize
Layout.columnSpan: 2 Layout.columnSpan: 2
} }
@ -73,10 +72,10 @@ Item {
id: savePassword id: savePassword
} }
Label { MobileComponents.Heading {
text: "Subsurface GPS data webservice" text: "Subsurface GPS data webservice"
Layout.bottomMargin: MobileComponents.Units.largeSpacing Layout.topMargin: MobileComponents.Units.largeSpacing
font.pointSize: subsurfaceTheme.titlePointSize Layout.bottomMargin: MobileComponents.Units.largeSpacing / 2
Layout.columnSpan: 2 Layout.columnSpan: 2
} }

View file

@ -14,29 +14,31 @@ Rectangle {
property bool goBack: (stackView.depth > 1) property bool goBack: (stackView.depth > 1)
color: subsurfaceTheme.accentColor color: subsurfaceTheme.accentColor
Layout.minimumHeight: MobileComponents.Units.gridUnit * 2 + MobileComponents.Units.largeSpacing Layout.minimumHeight: MobileComponents.Units.gridUnit * 2
Layout.fillWidth: true Layout.fillWidth: true
Layout.margins: 0 Layout.margins: 0
RowLayout { RowLayout {
anchors.bottom: topPart.bottom anchors.bottom: topPart.bottom
anchors.bottomMargin: MobileComponents.Units.largeSpacing / 2 anchors.bottomMargin: MobileComponents.Units.smallSpacing
anchors.left: topPart.left anchors.left: topPart.left
anchors.leftMargin: MobileComponents.Units.largeSpacing / 2 anchors.leftMargin: MobileComponents.Units.smallSpacing
anchors.right: topPart.right anchors.right: topPart.right
anchors.rightMargin: MobileComponents.Units.largeSpacing / 2 anchors.rightMargin: MobileComponents.Units.smallSpacing
Item { Item {
Layout.preferredHeight: subsurfaceLogo.height Layout.preferredHeight: subsurfaceLogo.height
Rectangle { color: "green"; anchors.fill: parent; }
Image { Image {
id: subsurfaceLogo id: subsurfaceLogo
source: "qrc:/qml/subsurface-mobile-icon.png" source: "qrc:/qml/subsurface-mobile-icon.png"
anchors { anchors {
top: parent.top top: parent.top
topMargin: MobileComponents.Units.smallSpacing * -1
left: parent.left left: parent.left
} }
width: MobileComponents.Units.gridUnit * 2 width: MobileComponents.Units.gridUnit
height: width height: width
} }
Text { MobileComponents.Label {
text: qsTr("Subsurface") text: qsTr("Subsurface")
height: subsurfaceLogo.height height: subsurfaceLogo.height
anchors { anchors {
@ -44,7 +46,7 @@ Rectangle {
bottom: subsurfaceLogo.bottom bottom: subsurfaceLogo.bottom
leftMargin: MobileComponents.Units.gridUnit / 2 leftMargin: MobileComponents.Units.gridUnit / 2
} }
font.pointSize: MobileComponents.Units.fontMetrics.font.pointSize * 1.5 font.weight: Font.Light
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
Layout.fillWidth: false Layout.fillWidth: false
color: subsurfaceTheme.accentTextColor color: subsurfaceTheme.accentTextColor
@ -53,37 +55,5 @@ Rectangle {
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true
} }
Button {
id: prefsButton
// Display back arrow or menu button
text: topPart.goBack ? "\u2190" : "\u22ee"
anchors.right: parent.right
Layout.preferredWidth: MobileComponents.Units.gridUnit * 2
Layout.preferredHeight: parent.height
style: ButtonStyle {
background: Rectangle {
implicitWidth: MobileComponents.Units.gridUnit * 2
color: subsurfaceTheme.accentColor
}
label: Text {
id: txt
color: subsurfaceTheme.accentTextColor
font.pointSize: MobileComponents.Units.fontMetrics.font.pointSize * 2
font.bold: true
text: control.text
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
onClicked: {
if (topPart.goBack) {
stackView.pop()
} else {
prefsMenu.popup()
}
}
}
} }
} }

View file

@ -1,6 +0,0 @@
import QtQuick 2.5
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
Text {
color: MobileComponents.Theme.textColor
}

View file

@ -11,7 +11,6 @@ import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
MobileComponents.ApplicationWindow { MobileComponents.ApplicationWindow {
title: qsTr("Subsurface mobile") title: qsTr("Subsurface mobile")
property bool fullscreen: true property bool fullscreen: true
property alias messageText: message.text
FontMetrics { FontMetrics {
id: fontMetrics id: fontMetrics
@ -107,12 +106,41 @@ MobileComponents.ApplicationWindow {
} }
} }
] ]
MouseArea {
height: childrenRect.height
width: MobileComponents.Units.gridUnit * 10
CheckBox {
//text: "Run location service"
id: locationCheckbox
anchors {
left: parent.left
top: parent.top
}
checked: manager.locationServiceEnabled
onCheckedChanged: {
manager.locationServiceEnabled = checked;
}
}
MobileComponents.Label {
x: MobileComponents.Units.gridUnit * 1.5
anchors {
left: locationCheckbox.right
//leftMargin: units.smallSpacing
verticalCenter: locationCheckbox.verticalCenter
}
text: "Run location service"
}
onClicked: {
print("Click.")
locationCheckbox.checked = !locationCheckbox.checked
}
}
} }
QtObject { QtObject {
id: subsurfaceTheme id: subsurfaceTheme
property int titlePointSize: Math.round(fontMetrics.font.pointSize * 1.5) property int titlePointSize: Math.round(fontMetrics.font.pointSize * 1.5)
property int smallPointSize: Math.round(fontMetrics.font.pointSize * 0.7) property int smallPointSize: Math.round(fontMetrics.font.pointSize * 0.8)
property color accentColor: "#2d5b9a" property color accentColor: "#2d5b9a"
property color accentTextColor: "#ececec" property color accentTextColor: "#ececec"
} }
@ -208,43 +236,9 @@ MobileComponents.ApplicationWindow {
} }
property Item stackView: pageStack property Item stackView: pageStack
initialPage: Item { initialPage: DiveList {
width: parent.width anchors.fill: detailsPage
height: parent.height id: diveDetails
ColumnLayout {
id: awLayout
anchors.fill: parent
spacing: MobileComponents.Units.gridUnit / 2
Rectangle {
id: detailsPage
Layout.fillHeight: true
Layout.fillWidth: true
DiveList {
anchors.fill: detailsPage
id: diveDetails
color: MobileComponents.Theme.backgroundColor
}
}
Rectangle {
id: messageArea
height: childrenRect.height
Layout.fillWidth: true
color: MobileComponents.Theme.backgroundColor
Text {
id: message
color: MobileComponents.Theme.textColor
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
styleColor: MobileComponents.Theme.textColor
font.pointSize: MobileComponents.Units.smallPointSize
}
}
}
} }
QMLManager { QMLManager {

View file

@ -11,7 +11,6 @@
<file>ThemeTest.qml</file> <file>ThemeTest.qml</file>
<file>StartPage.qml</file> <file>StartPage.qml</file>
<file>dive.jpg</file> <file>dive.jpg</file>
<file alias="Label.qml">components/Label.qml</file>
<file alias="subsurface-mobile-icon.png">../../icons/subsurface-mobile-icon.png</file> <file alias="subsurface-mobile-icon.png">../../icons/subsurface-mobile-icon.png</file>
</qresource> </qresource>
<qresource prefix="/imports"> <qresource prefix="/imports">
@ -35,5 +34,6 @@
<file alias="org/kde/plasma/mobilecomponents/private/qmldir">mobilecomponents/private/qmldir</file> <file alias="org/kde/plasma/mobilecomponents/private/qmldir">mobilecomponents/private/qmldir</file>
<file alias="org/kde/plasma/mobilecomponents/icons/go-next.svg">mobilecomponents/icons/go-next.svg</file> <file alias="org/kde/plasma/mobilecomponents/icons/go-next.svg">mobilecomponents/icons/go-next.svg</file>
<file alias="org/kde/plasma/mobilecomponents/icons/go-previous.svg">mobilecomponents/icons/go-previous.svg</file> <file alias="org/kde/plasma/mobilecomponents/icons/go-previous.svg">mobilecomponents/icons/go-previous.svg</file>
<file alias="org/kde/plasma/mobilecomponents/icons/distribute-horizontal-x.svg">mobilecomponents/icons/distribute-horizontal-x.svg</file>
</qresource> </qresource>
</RCC> </RCC>

View file

@ -20,6 +20,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.3 import QtQuick.Controls 1.3
import "private" import "private"
import org.kde.plasma.mobilecomponents 0.2
/** /**
* A window that provides some basic features needed for all apps * A window that provides some basic features needed for all apps
@ -73,6 +74,9 @@ ApplicationWindow {
contextDrawer.parent = contentItem.parent; contextDrawer.parent = contentItem.parent;
} }
width: Units.gridUnit * 25
height: Units.gridUnit * 30
property alias actionButton: __actionButton property alias actionButton: __actionButton
ActionButton { ActionButton {
id: __actionButton id: __actionButton

View file

@ -18,6 +18,7 @@
*/ */
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Layouts 1.2
import QtQuick.Controls 1.0 as QtControls import QtQuick.Controls 1.0 as QtControls
import org.kde.plasma.mobilecomponents 0.2 import org.kde.plasma.mobilecomponents 0.2
@ -63,7 +64,8 @@ OverlayDrawer {
} }
delegate: ListItem { delegate: ListItem {
enabled: true enabled: true
Row { RowLayout {
height: implicitHeight + Units.smallSpacing * 2
anchors { anchors {
left: parent.left left: parent.left
margins: Units.largeSpacing margins: Units.largeSpacing

View file

@ -49,6 +49,7 @@ OverlayDrawer {
Layout.minimumHeight: Math.max(headingIcon.height, heading.height) + Units.smallSpacing*2 Layout.minimumHeight: Math.max(headingIcon.height, heading.height) + Units.smallSpacing*2
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
asynchronous: true
anchors { anchors {
left: parent.left left: parent.left
@ -83,7 +84,7 @@ OverlayDrawer {
anchors { anchors {
left: parent.left left: parent.left
top: parent.top top: parent.top
margins: Units.smallSpacing margins: Units.smallSpacing * 2
} }
Icon { Icon {
id: headingIcon id: headingIcon
@ -123,6 +124,7 @@ OverlayDrawer {
Layout.maximumWidth: Layout.minimumWidth Layout.maximumWidth: Layout.minimumWidth
Layout.fillWidth: false Layout.fillWidth: false
Layout.fillHeight: true Layout.fillHeight: true
visible: children.length > 0
} }
Item { Item {
Layout.minimumWidth: Units.smallSpacing Layout.minimumWidth: Units.smallSpacing
@ -138,22 +140,26 @@ OverlayDrawer {
model: actions model: actions
property int level: 0 property int level: 0
interactive: contentHeight > height
footer: ListItem { footer: ListItem {
visible: level > 0 visible: level > 0
enabled: true enabled: true
RowLayout { RowLayout {
height: implicitHeight + Units.smallSpacing * 2
anchors { anchors {
left: parent.left left: parent.left
} }
Icon { Icon {
Layout.maximumWidth: height Layout.minimumWidth: height
Layout.maximumWidth: Layout.minimumWidth
Layout.fillHeight: true Layout.fillHeight: true
source: "go-previous" source: "go-previous"
} }
Label { Label {
// Weird, this doesn't work // Weird, this doesn't work
//text: (typeof(i18n) != undefined) ? i18n("Back") : "Back" //text: (typeof(i18n) != undefined) ? i18n("Back") : "Back"
text: "Back" text: "Back"
} }
} }
onClicked: pageRow.pop() onClicked: pageRow.pop()
@ -161,6 +167,7 @@ OverlayDrawer {
delegate: ListItem { delegate: ListItem {
enabled: true enabled: true
RowLayout { RowLayout {
height: implicitHeight + Units.smallSpacing*2
anchors { anchors {
left: parent.left left: parent.left
right: parent.right right: parent.right
@ -175,7 +182,8 @@ OverlayDrawer {
text: modelData.text text: modelData.text
} }
Icon { Icon {
Layout.maximumWidth: height Layout.minimumWidth: height
Layout.maximumWidth: Layout.minimumWidth
Layout.fillHeight: true Layout.fillHeight: true
source: "go-next" source: "go-next"
visible: modelData.children != undefined visible: modelData.children != undefined

View file

@ -19,6 +19,7 @@
import QtQuick 2.0 import QtQuick 2.0
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import org.kde.plasma.mobilecomponents 0.2
Item { Item {
id: root id: root
@ -26,13 +27,13 @@ Item {
property alias smooth: image.smooth property alias smooth: image.smooth
property bool active: false property bool active: false
property bool valid: image.status == Image.Ready property bool valid: image.status == Image.Ready
implicitWidth: image.sourceSize.width implicitWidth: Math.min(image.sourceSize.width, Units.iconSizes.medium)
implicitHeight: image.sourceSize.height implicitHeight: Math.min(image.sourceSize.height, Units.iconSizes.medium)
Image { Image {
id: image id: image
anchors.fill: parent anchors.fill: parent
source: root.source != "" ? "icons/" + root.source + ".svg" : root.source source: root.source != "" ? (root.source.indexOf(".") === -1 ? "icons/" + root.source + ".svg" : root.source) : root.source
} }
GammaAdjust { GammaAdjust {
anchors.fill: image anchors.fill: image

View file

@ -41,12 +41,12 @@ QtObject {
property color visitedLinkColor: "#2196F3" property color visitedLinkColor: "#2196F3"
property color buttonTextColor: Qt.rgba(0,0,0, 0.54) property color buttonTextColor: Qt.rgba(0,0,0, 0.54)
property color buttonBackgroundColor: "#f3f3f3" property color buttonBackgroundColor: "#eff0f1"
property color buttonHoverColor: "#2196F3" property color buttonHoverColor: "#2196F3"
property color buttonFocusColor: "#2196F3" property color buttonFocusColor: "#2196F3"
property color viewTextColor: Qt.rgba(0,0,0, 0.54) property color viewTextColor: Qt.rgba(0,0,0, 0.54)
property color viewBackgroundColor: "#f3f3f3" property color viewBackgroundColor: "#fcfcfc"
property color viewHoverColor: "#2196F3" property color viewHoverColor: "#2196F3"
property color viewFocusColor: "#2196F3" property color viewFocusColor: "#2196F3"

View file

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="22"
height="22"
id="svg3813"
version="1.1"
inkscape:version="0.48+devel r"
sodipodi:docname="distribute-horizontal-x.svg">
<defs
id="defs3815" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="26.930216"
inkscape:cx="9.6140302"
inkscape:cy="11.263762"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1366"
inkscape:window-height="668"
inkscape:window-x="-2"
inkscape:window-y="23"
inkscape:window-maximized="1"
inkscape:showpageshadow="false">
<inkscape:grid
type="xygrid"
id="grid4109" />
<sodipodi:guide
position="2.0000072,19.999993"
orientation="18,0"
id="guide4115" />
<sodipodi:guide
position="2.0000072,1.9999929"
orientation="0,18"
id="guide4117" />
<sodipodi:guide
position="20.000007,1.9999929"
orientation="-18,0"
id="guide4119" />
<sodipodi:guide
position="20.000007,19.999993"
orientation="0,-18"
id="guide4121" />
<sodipodi:guide
position="3.0000072,18.999993"
orientation="16,0"
id="guide4123" />
<sodipodi:guide
position="3.0000072,2.9999929"
orientation="0,16"
id="guide4125" />
<sodipodi:guide
position="19.000007,2.9999929"
orientation="-16,0"
id="guide4127" />
<sodipodi:guide
position="19.000007,18.999993"
orientation="0,-16"
id="guide4129" />
</sodipodi:namedview>
<metadata
id="metadata3818">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Capa 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-378.85714,-540.07647)">
<path
style="opacity:1;fill:#4d4d4d;fill-opacity:1;stroke:none"
d="M 3 7 L 3 15 L 8 15 L 8 7 L 3 7 z M 14 7 L 14 15 L 19 15 L 19 7 L 14 7 z M 4 8 L 7 8 L 7 14 L 4 14 L 4 8 z M 15 8 L 18 8 L 18 14 L 15 14 L 15 8 z M 9 9 L 9 13 L 10 13 L 10 12 L 12 12 L 12 13 L 13 13 L 13 9 L 12 9 L 12 10 L 10 10 L 10 9 L 9 9 z "
transform="translate(378.85714,540.07647)"
id="rect4109" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -35,6 +35,15 @@ MouseArea {
minimumX: contextDrawer ? 0 : parent.width/2 - width/2 minimumX: contextDrawer ? 0 : parent.width/2 - width/2
maximumX: globalDrawer ? parent.width : parent.width/2 - width/2 maximumX: globalDrawer ? parent.width : parent.width/2 - width/2
} }
function toggle() {
showAnimation.running = false;
if (transform[0].y < button.height) {
showAnimation.to = button.height;
} else {
showAnimation.to = 0;
}
showAnimation.running = true;
}
transform: Translate {} transform: Translate {}
onReleased: { onReleased: {
@ -88,6 +97,13 @@ MouseArea {
} }
} }
NumberAnimation {
id: showAnimation
target: button.transform[0]
properties: "y"
duration: Units.longDuration
easing.type: Easing.InOutQuad
}
Item { Item {
id: background id: background
anchors { anchors {
@ -140,8 +156,8 @@ MouseArea {
DropShadow { DropShadow {
anchors.fill: background anchors.fill: background
horizontalOffset: 0 horizontalOffset: 0
verticalOffset: Units.smallSpacing/2 verticalOffset: Units.smallSpacing/3
radius: Units.gridUnit / 2.4 radius: Units.gridUnit / 3.5
samples: 16 samples: 16
color: button.pressed ? "transparent" : Qt.rgba(0, 0, 0, 0.5) color: button.pressed ? "transparent" : Qt.rgba(0, 0, 0, 0.5)
source: background source: background