-
-
Save kimmoli/1286171768835306ec6a to your computer and use it in GitHub Desktop.
.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
import QtMultimedia 5.0 | |
import Sailfish.Silica 1.0 | |
Dialog { | |
id: soundDialog; | |
allowedOrientations: Orientation.Portrait | Orientation.Landscape; | |
//canAccept: false; | |
property bool vibrate: false; | |
property bool sound: true; | |
SilicaFlickable { | |
anchors.fill: parent | |
contentHeight: column.height | |
DialogHeader { | |
id: header; | |
} | |
Column { | |
id: column; | |
anchors.top: header.bottom | |
width: soundDialog.width; | |
spacing: Theme.paddingLarge; | |
TextSwitch { | |
id: noSound; | |
checked: !sound; | |
leftMargin: Theme.paddingMedium; | |
text: qsTr('Disable sound'); | |
onCheckedChanged: { | |
console.log('NoSound', checked) | |
sound = !checked; | |
} | |
onClicked: { | |
console.log('NoSound tapped', automaticCheck) | |
} | |
} | |
TextSwitch { | |
id: doVibrate; | |
checked: vibrate; | |
leftMargin: Theme.paddingMedium; | |
text: qsTr('Vibrate'); | |
description: 'Since <code>QtFeedback</code> is not yet allowed, this does nothing.'; | |
onCheckedChanged: { | |
console.log('Vibrate', checked) | |
vibrate = checked; | |
} | |
} | |
BackgroundItem { | |
//enabled: sound; | |
height: Theme.itemSizeLarge | |
width: parent.width; | |
Row { | |
spacing: theme.paddingMedium | |
anchors.verticalCenter: parent.verticalCenter | |
Image { | |
source: "image://theme/icon-l-music" | |
anchors.verticalCenter: parent.verticalCenter | |
} | |
Label { | |
textFormat: Text.StyledText; | |
text: qsTr('Select music file'); | |
anchors.verticalCenter: parent.verticalCenter | |
} | |
} | |
onClicked: { | |
console.log('Select file', checked) | |
pageStack.push(Qt.resolvedUrl('SoundSelectDialog.qml')); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment