table view
[mdictionary] / src / mdictionary / qml / TranslationView.qml
index d020be1..c0a546a 100644 (file)
@@ -2,46 +2,56 @@ import Qt 4.7
 import QtWebKit 1.0
 
 Rectangle {
-    id: rectangle1
+    id: webBrowser
     width: 500
     height: 500
 
+    SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
+    color: myPalette.window
 
+    function setUrl(string){
+        webView.url = "file:///home/jakub/test.html";
+        webView.url = string;
+    }
+
+    FlickableWebView {
+        id: webView
+        width:parent.width
+        height:parent.height
+        anchors { top: headerSpace.bottom; left: parent.left; right: parent.right; bottom: parent.bottom }
+    }
 
-    WebView {
-        id: web_view1
-        anchors.fill: parent
-        url: "http://kokos.pl/"
+    Item { id: headerSpace; width: parent.width; height: 1}
+
+    ScrollBar {
+        scrollArea: webView;
+        width: 8
+        anchors { right: parent.right; top: parent.bottom; bottom: parent.bottom }
+    }
 
-        onDoubleClick: {
-            console.log(clickX,clickY);
-            heuristicZoom(clickX,clickY,2)
-        }
-       /* onZoomTo: {
-            console.log(zoom);
-            scale=zoom;x=width/2-centerX;
-            y=height/2-centerY
-       }
-       */
+    ScrollBar {
+        scrollArea: webView;
+        height: 8; orientation: Qt.Horizontal
+        anchors { right: parent.right; rightMargin: 8; left: parent.left; bottom: parent.bottom }
     }
 
     Button {
         id: button1
-        textInButton: "test"
-        width: 200;
-        height: 30;
-        x: 41
-        y: 28
-        onClicked: web_view1.scale=web_view1.scale*1.05;
+        textInButton: "+"
+        width: 20;
+        height: 20;
+        anchors.right: parent.right
+        anchors.bottom: button2.top
+        onClicked: webView.doZoom(1.05);
     }
 
     Button {
         id: button2
-        textInButton: "test2"
-        width: 200;
-        height: 30;
-        x: 41
-        y: 68
-        onClicked: web_view1.scale=web_view1.scale*.95;
+        textInButton: "-"
+        width: 20;
+        height: 20;
+        anchors.right: parent.right
+        anchors.bottom: parent.bottom
+        onClicked: webView.doZoom(.95);
     }
 }