github.com/jonasnick/go-ethereum@v0.7.12-0.20150216215225-22176f05d387/cmd/mist/assets/qml/muted.qml (about)

     1  import QtQuick 2.0
     2  import QtWebKit 3.0
     3  import QtWebKit.experimental 1.0
     4  import QtQuick.Controls 1.0;
     5  import QtQuick.Layouts 1.0;
     6  import QtQuick.Window 2.1;
     7  import Ethereum 1.0
     8  
     9  ApplicationWindow {
    10      id: window
    11      title: "muted"
    12      width: 900
    13      height: 600
    14      minimumHeight: 300
    15  
    16      property alias url: webView.url
    17      property alias webView: webView
    18  
    19  
    20      Item {
    21          id: root
    22          anchors.fill: parent
    23          WebView {
    24              objectName: "webView"
    25              id: webView
    26              anchors {
    27                  top: root.top
    28                  right: root.right
    29                  left: root.left
    30                  bottom: root.bottom
    31                  //bottom: sizeGrip.top
    32              }
    33  
    34              experimental.preferences.javascriptEnabled: true
    35              experimental.preferences.navigatorQtObjectEnabled: true
    36              experimental.onMessageReceived: {
    37                  var data = JSON.parse(message.data)
    38  
    39                  switch(data.call) {
    40                  case "log":
    41                      console.log.apply(this, data.args)
    42                      break;
    43                  }
    44              }
    45              function postData(seed, data) {
    46                  webview.experimental.postMessage(JSON.stringify({data: data, _seed: seed}))
    47              }
    48              function postEvent(event, data) {
    49                  webview.experimental.postMessage(JSON.stringify({data: data, _event: event}))
    50              }
    51          }
    52  
    53          /*
    54          Rectangle {
    55              id: sizeGrip
    56              color: "gray"
    57              height: 5
    58              anchors {
    59                  left: root.left
    60                  right: root.right
    61              }
    62              y: Math.round(root.height * 2 / 3)
    63  
    64              MouseArea {
    65                  anchors.fill: parent
    66                  drag.target: sizeGrip
    67                  drag.minimumY: 0
    68                  drag.maximumY: root.height - sizeGrip.height
    69                  drag.axis: Drag.YAxis
    70              }
    71          }
    72          */
    73      }
    74  }