Advertisement
Guest User

kitchentimerthangus

a guest
Jun 10th, 2015
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 2.38 KB | None | 0 0
  1. import QtQuick 2.0
  2. import QtMultimedia 5.0
  3. import Sailfish.Silica 1.0
  4.  
  5. Dialog {
  6.     id: soundDialog;
  7.     allowedOrientations: Orientation.Portrait | Orientation.Landscape;
  8.  
  9.     //canAccept: false;
  10.  
  11.     property bool vibrate: false;
  12.     property bool sound: true;
  13.  
  14.  
  15. //    SilicaFlickable {
  16. //        y: header.height + Theme.paddingMedium;
  17. //        height: parent.height - (header.height + Theme.paddingMedium);
  18. //        anchors.leftMargin: Theme.paddingLarge;
  19. //        anchors.rightMargin: Theme.paddingLarge;
  20.  
  21.         Column {
  22.             id: column;
  23. //            anchors.fill: parent;
  24.  
  25.             width: soundDialog.width;
  26.             spacing: Theme.paddingLarge;
  27.  
  28.             DialogHeader {
  29.                 id: header;
  30.                 dialog: soundDialog;
  31.                 title: qsTr('Sound');
  32.             }
  33.             TextSwitch {
  34.                 id: noSound;
  35. //                anchors.top: parent.top;
  36.                 checked: !sound;
  37. //                leftMargin: Theme.paddingMedium;
  38.                 text: qsTr('Disable sound');
  39.                 onCheckedChanged: {
  40.                     console.log('NoSound', checked)
  41. //                    sound = !checked;
  42.                 }
  43.                 onClicked: {
  44.                     console.log('NoSound tapped', automaticCheck)
  45.                 }
  46.             }
  47.  
  48.             TextSwitch {
  49.                 id: doVibrate;
  50. //                anchors.top: noSound.bottom;
  51.                 checked: vibrate;
  52. //                leftMargin: Theme.paddingMedium;
  53.                 text: qsTr('Vibrate');
  54.                 description: 'Since <code>QtFeedback</code> is not yet allowed, this does nothing.';
  55.                 onCheckedChanged: {
  56.                     console.log('Vibrate', checked)
  57. //                    vibrate = checked;
  58.                 }
  59.             }
  60.  
  61.             BackgroundItem {
  62.                 //enabled: sound;
  63. //                anchors.top: doVibrate.bottom;
  64. //                width: parent.width;
  65.                 Label {
  66.                     textFormat: Text.StyledText;
  67.                     text: '<img src="image://theme/icon-l-music" />&nbsp;' + qsTr('Select music file');
  68.                 }
  69.                 onClicked: {
  70.                     console.log('Select file', checked)
  71.                     pageStack.push(Qt.resolvedUrl('SoundSelectDialog.qml'));
  72.                 }
  73.             }
  74.         }
  75. //    }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement