summaryrefslogtreecommitdiff
path: root/demos/declarative/webbrowser/content
diff options
context:
space:
mode:
Diffstat (limited to 'demos/declarative/webbrowser/content')
-rw-r--r--demos/declarative/webbrowser/content/Button.qml65
-rw-r--r--demos/declarative/webbrowser/content/FlickableWebView.qml85
-rw-r--r--demos/declarative/webbrowser/content/Header.qml128
-rw-r--r--demos/declarative/webbrowser/content/RectSoftShadow.qml32
-rw-r--r--demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml113
-rw-r--r--demos/declarative/webbrowser/content/ScrollBar.qml107
-rw-r--r--demos/declarative/webbrowser/content/UrlInput.qml96
-rw-r--r--demos/declarative/webbrowser/content/fieldtext/FieldText.qml157
-rw-r--r--demos/declarative/webbrowser/content/fieldtext/pics/cancel.pngbin1038 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/fieldtext/pics/ok.pngbin655 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/addressbar-filled.pngbin694 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/addressbar-filled.sci6
-rw-r--r--demos/declarative/webbrowser/content/pics/addressbar.pngbin467 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/addressbar.sci6
-rw-r--r--demos/declarative/webbrowser/content/pics/back-disabled.pngbin475 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/back.pngbin707 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/display.pngbin0 -> 998 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/edit-delete.pngbin0 -> 1333 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/footer.pngbin200 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/footer.sci6
-rw-r--r--demos/declarative/webbrowser/content/pics/forward-disabled.pngbin471 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/forward.pngbin682 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/go-jump-locationbar.pngbin0 -> 714 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/go-next-view.pngbin0 -> 1187 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/go-previous-view.pngbin0 -> 1226 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/header.pngbin193 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/reload.pngbin1283 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/scrollbar.pngbin0 -> 161 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/softshadow-bottom.pngbin186 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/softshadow-left.pngbin598 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/softshadow-left.sci5
-rw-r--r--demos/declarative/webbrowser/content/pics/softshadow-right.pngbin636 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/softshadow-right.sci5
-rw-r--r--demos/declarative/webbrowser/content/pics/softshadow-top.pngbin186 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/titlebar-bg.pngbin0 -> 213 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/view-refresh.pngbin0 -> 2182 bytes
36 files changed, 455 insertions, 356 deletions
diff --git a/demos/declarative/webbrowser/content/Button.qml b/demos/declarative/webbrowser/content/Button.qml
new file mode 100644
index 0000000000..2a2e7ef50e
--- /dev/null
+++ b/demos/declarative/webbrowser/content/Button.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt 4.7
+
+Item {
+ property alias image: icon.source
+ property variant action
+
+ signal clicked
+
+ width: 40; height: parent.height
+
+ Image {
+ id: icon; anchors.centerIn: parent
+ opacity: if (action != undefined) { action.enabled ? 1.0 : 0.4 } else 1
+ }
+
+ MouseArea {
+ anchors { fill: parent; topMargin: -10; bottomMargin: -10 }
+ onClicked: {
+ if (action != undefined)
+ action.trigger()
+ parent.clicked()
+ }
+ }
+}
diff --git a/demos/declarative/webbrowser/content/FlickableWebView.qml b/demos/declarative/webbrowser/content/FlickableWebView.qml
index 46f45e09b4..62da2ea147 100644
--- a/demos/declarative/webbrowser/content/FlickableWebView.qml
+++ b/demos/declarative/webbrowser/content/FlickableWebView.qml
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
import Qt 4.7
import org.webkit 1.0
@@ -7,22 +48,28 @@ Flickable {
property alias progress: webView.progress
property alias url: webView.url
property alias back: webView.back
+ property alias stop: webView.stop
property alias reload: webView.reload
property alias forward: webView.forward
id: flickable
width: parent.width
- contentWidth: Math.max(parent.width,webView.width*webView.scale)
- contentHeight: Math.max(parent.height,webView.height*webView.scale)
+ contentWidth: Math.max(parent.width,webView.width)
+ contentHeight: Math.max(parent.height,webView.height)
anchors.top: headerSpace.bottom
- anchors.bottom: footer.top
+ anchors.bottom: parent.top
anchors.left: parent.left
anchors.right: parent.right
pressDelay: 200
+ onWidthChanged : {
+ // Expand (but not above 1:1) if otherwise would be smaller that available width.
+ if (width > webView.width*webView.contentsScale && webView.contentsScale < 1.0)
+ webView.contentsScale = width / webView.width * webView.contentsScale;
+ }
+
WebView {
id: webView
- pixelCacheSize: 4000000
transformOrigin: Item.TopLeft
function fixUrl(url)
@@ -42,8 +89,6 @@ Flickable {
url: fixUrl(webBrowser.urlString)
smooth: false // We don't want smooth scaling, since we only scale during (fast) transitions
- smoothCache: true // We do want smooth rendering
- fillColor: "white"
focus: true
zoomFactor: 1
@@ -52,7 +97,7 @@ Flickable {
function doZoom(zoom,centerX,centerY)
{
if (centerX) {
- var sc = zoom/contentsScale;
+ var sc = zoom*contentsScale;
scaleAnim.to = sc;
flickVX.from = flickable.contentX
flickVX.to = Math.max(0,Math.min(centerX-flickable.width/2,webView.width*sc-flickable.width))
@@ -60,7 +105,6 @@ Flickable {
flickVY.from = flickable.contentY
flickVY.to = Math.max(0,Math.min(centerY-flickable.height/2,webView.height*sc-flickable.height))
finalY.value = flickVY.to
- finalZoom.value = zoom
quickZoom.start()
}
}
@@ -68,8 +112,8 @@ Flickable {
Keys.onLeftPressed: webView.contentsScale -= 0.1
Keys.onRightPressed: webView.contentsScale += 0.1
- preferredWidth: flickable.width*zoomFactor
- preferredHeight: flickable.height*zoomFactor
+ preferredWidth: flickable.width
+ preferredHeight: flickable.height
contentsScale: 1/zoomFactor
onContentsSizeChanged: {
// zoom out
@@ -102,17 +146,16 @@ Flickable {
NumberAnimation {
id: scaleAnim
target: webView
- property: "scale"
- from: 1
- to: 0 // set before calling
- easing.type: "Linear"
+ property: "contentsScale"
+ // the to property is set before calling
+ easing.type: Easing.Linear
duration: 200
}
NumberAnimation {
id: flickVX
target: flickable
property: "contentX"
- easing.type: "Linear"
+ easing.type: Easing.Linear
duration: 200
from: 0 // set before calling
to: 0 // set before calling
@@ -121,22 +164,12 @@ Flickable {
id: flickVY
target: flickable
property: "contentY"
- easing.type: "Linear"
+ easing.type: Easing.Linear
duration: 200
from: 0 // set before calling
to: 0 // set before calling
}
}
- PropertyAction {
- id: finalZoom
- target: webView
- property: "contentsScale"
- }
- PropertyAction {
- target: webView
- property: "scale"
- value: 1.0
- }
// Have to set the contentXY, since the above 2
// size changes may have started a correction if
// contentsScale < 1.0.
diff --git a/demos/declarative/webbrowser/content/Header.qml b/demos/declarative/webbrowser/content/Header.qml
new file mode 100644
index 0000000000..5abf440535
--- /dev/null
+++ b/demos/declarative/webbrowser/content/Header.qml
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt 4.7
+
+Image {
+ id: header
+
+ property alias editUrl: urlInput.url
+ property bool urlChanged: false
+
+ source: "pics/titlebar-bg.png"; fillMode: Image.TileHorizontally
+
+ x: webView.contentX < 0 ? -webView.contentX : webView.contentX > webView.contentWidth-webView.width
+ ? -webView.contentX+webView.contentWidth-webView.width : 0
+
+ y: {
+ if (webView.progress < 1.0)
+ return 0;
+ else {
+ webView.contentY < 0 ? -webView.contentY : webView.contentY > height ? -height : -webView.contentY
+ }
+ }
+
+ Column {
+ width: parent.width
+
+ Item {
+ width: parent.width; height: 20
+ Text {
+ anchors.centerIn: parent
+ text: webView.title; font.pixelSize: 14; font.bold: true
+ color: "white"; styleColor: "black"; style: Text.Sunken
+ }
+ }
+
+ Item {
+ width: parent.width; height: 40
+
+ Button {
+ id: backButton
+ action: webView.back; image: "pics/go-previous-view.png"
+ anchors { left: parent.left; bottom: parent.bottom }
+ }
+
+ Button {
+ id: nextButton
+ anchors.left: backButton.right
+ action: webView.forward; image: "pics/go-next-view.png"
+ }
+
+ UrlInput {
+ id: urlInput
+ anchors { left: nextButton.right; right: reloadButton.left }
+ image: "pics/display.png"
+ onUrlEntered: {
+ webBrowser.urlString = url
+ webBrowser.focus = true
+ header.urlChanged = false
+ }
+ onUrlChanged: header.urlChanged = true
+ }
+
+ Button {
+ id: reloadButton
+ anchors { right: parent.right; rightMargin: 4 }
+ action: webView.reload; image: "pics/view-refresh.png"
+ visible: webView.progress == 1.0 && !header.urlChanged
+ }
+
+ Button {
+ id: stopButton
+ anchors { right: parent.right; rightMargin: 4 }
+ action: webView.stop; image: "pics/edit-delete.png"
+ visible: webView.progress < 1.0 && !header.urlChanged
+ }
+
+ Button {
+ id: goButton
+ anchors { right: parent.right; rightMargin: 4 }
+ onClicked: {
+ webBrowser.urlString = urlInput.url
+ webBrowser.focus = true
+ header.urlChanged = false
+ }
+ image: "pics/go-jump-locationbar.png"; visible: header.urlChanged
+ }
+ }
+ }
+}
diff --git a/demos/declarative/webbrowser/content/RectSoftShadow.qml b/demos/declarative/webbrowser/content/RectSoftShadow.qml
deleted file mode 100644
index 53d098ca05..0000000000
--- a/demos/declarative/webbrowser/content/RectSoftShadow.qml
+++ /dev/null
@@ -1,32 +0,0 @@
-import Qt 4.7
-
-Item {
- BorderImage {
- source: "pics/softshadow-left.sci"
- x: -16
- y: -16
- width: 16
- height: parent.height+32
- }
- BorderImage {
- source: "pics/softshadow-right.sci"
- x: parent.width
- y: -16
- width: 16
- height: parent.height+32
- }
- Image {
- source: "pics/softshadow-top.png"
- x: 0
- y: -16
- width: parent.width
- height: 16
- }
- Image {
- source: "pics/softshadow-bottom.png"
- x: 0
- y: parent.height
- width: parent.width
- height: 16
- }
-}
diff --git a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml b/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml
deleted file mode 100644
index f5bfadff4a..0000000000
--- a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml
+++ /dev/null
@@ -1,113 +0,0 @@
-import Qt 4.7
-
-import "fieldtext"
-
-Image {
- property alias editUrl: editUrl.text
-
- id: header
- source: "pics/header.png"
- width: parent.width
- height: 60
- x: webView.contentX < 0 ? -webView.contentX : webView.contentX > webView.contentWidth-webView.width
- ? -webView.contentX+webView.contentWidth-webView.width : 0
- y: webView.contentY < 0 ? -webView.contentY : progressOff*
- (webView.contentY>height?-height:-webView.contentY)
- Row {
- id: headerTitle
-
- anchors.top: header.top
- anchors.topMargin: 4
- x: parent.width > headerIcon.width+headerText.width+6 ? (parent.width-headerIcon.width-headerText.width-6)/2 : 0
- spacing: 6
-
- Image {
- id: headerIcon
- pixmap: webView.icon
- }
-
- Text {
- id: headerText
-
- text: webView.title!='' || webView.progress == 1.0 ? webView.title : 'Loading...'
-
- color: "white"
- styleColor: "black"
- style: Text.Raised
-
- font.family: "Helvetica"
- font.pointSize: 10
- font.bold: true
-
- horizontalAlignment: Text.AlignHCenter
- }
- }
- Item {
- width: parent.width
- anchors.top: headerTitle.bottom
- anchors.topMargin: 2
- anchors.bottom: parent.bottom
-
- Item {
- id: urlBox
- height: 31
- anchors.left: parent.left
- anchors.leftMargin: 12
- anchors.right: parent.right
- anchors.rightMargin: 12
- anchors.top: parent.top
- clip: true
- property bool mouseGrabbed: false
-
- BorderImage {
- source: "pics/addressbar.sci"
- anchors.fill: urlBox
- }
-
- BorderImage {
- id: urlBoxhl
- source: "pics/addressbar-filled.sci"
- width: parent.width*webView.progress
- height: parent.height
- opacity: 1-header.progressOff
- clip: true
- }
-
- FieldText {
- id: editUrl
- mouseGrabbed: parent.mouseGrabbed
-
- text: webBrowser.urlString
- label: "url:"
- onConfirmed: { webBrowser.urlString = editUrl.text; webView.focus=true }
- onCancelled: { webView.focus=true }
- onStartEdit: { webView.focus=false }
-
- anchors.left: urlBox.left
- anchors.right: urlBox.right
- anchors.leftMargin: 6
- anchors.verticalCenter: urlBox.verticalCenter
- anchors.verticalCenterOffset: 1
- }
- }
- }
-
- property real progressOff : 1
- states: [
- State {
- name: "ProgressShown"
- when: webView.progress < 1.0
- PropertyChanges { target: header; progressOff: 0; }
- }
- ]
- transitions: [
- Transition {
- NumberAnimation {
- targets: header
- properties: "progressOff"
- easing.type: "InOutQuad"
- duration: 300
- }
- }
- ]
-}
diff --git a/demos/declarative/webbrowser/content/ScrollBar.qml b/demos/declarative/webbrowser/content/ScrollBar.qml
new file mode 100644
index 0000000000..d3f272cf19
--- /dev/null
+++ b/demos/declarative/webbrowser/content/ScrollBar.qml
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt 4.7
+
+Item {
+ id: container
+
+ property variant scrollArea
+ property variant orientation: Qt.Vertical
+
+ opacity: 0
+
+ function position()
+ {
+ var ny = 0;
+ if (container.orientation == Qt.Vertical)
+ ny = scrollArea.visibleArea.yPosition * container.height;
+ else
+ ny = scrollArea.visibleArea.xPosition * container.width;
+ if (ny > 2) return ny; else return 2;
+ }
+
+ function size()
+ {
+ var nh, ny;
+
+ if (container.orientation == Qt.Vertical)
+ nh = scrollArea.visibleArea.heightRatio * container.height;
+ else
+ nh = scrollArea.visibleArea.widthRatio * container.width;
+
+ if (container.orientation == Qt.Vertical)
+ ny = scrollArea.visibleArea.yPosition * container.height;
+ else
+ ny = scrollArea.visibleArea.xPosition * container.width;
+
+ if (ny > 3) {
+ var t;
+ if (container.orientation == Qt.Vertical)
+ t = Math.ceil(container.height - 3 - ny);
+ else
+ t = Math.ceil(container.width - 3 - ny);
+ if (nh > t) return t; else return nh;
+ } else return nh + ny;
+ }
+
+ Rectangle { anchors.fill: parent; color: "Black"; opacity: 0.5 }
+
+ BorderImage {
+ source: "pics/scrollbar.png"
+ border { left: 1; right: 1; top: 1; bottom: 1 }
+ x: container.orientation == Qt.Vertical ? 2 : position()
+ width: container.orientation == Qt.Vertical ? container.width - 4 : size()
+ y: container.orientation == Qt.Vertical ? position() : 2
+ height: container.orientation == Qt.Vertical ? size() : container.height - 4
+ }
+
+ states: State {
+ name: "visible"
+ when: container.orientation == Qt.Vertical ? scrollArea.movingVertically : scrollArea.movingHorizontally
+ PropertyChanges { target: container; opacity: 1.0 }
+ }
+
+ transitions: Transition {
+ from: "visible"; to: ""
+ NumberAnimation { properties: "opacity"; duration: 600 }
+ }
+}
diff --git a/demos/declarative/webbrowser/content/UrlInput.qml b/demos/declarative/webbrowser/content/UrlInput.qml
new file mode 100644
index 0000000000..9992456be4
--- /dev/null
+++ b/demos/declarative/webbrowser/content/UrlInput.qml
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt 4.7
+
+Item {
+ id: container
+
+ property alias image: bg.source
+ property alias url: urlText.text
+
+ signal urlEntered(string url)
+ signal urlChanged
+
+ width: parent.height; height: parent.height
+
+ BorderImage {
+ id: bg; rotation: 180
+ x: 8; width: parent.width - 16; height: 30;
+ anchors.verticalCenter: parent.verticalCenter
+ border { left: 10; top: 10; right: 10; bottom: 10 }
+ }
+
+ Rectangle {
+ anchors.bottom: bg.bottom
+ x: 18; height: 4; color: "#63b1ed"
+ width: (bg.width - 20) * webView.progress
+ opacity: webView.progress == 1.0 ? 0.0 : 1.0
+ }
+
+ TextInput {
+ id: urlText
+ horizontalAlignment: TextEdit.AlignLeft
+ font.pixelSize: 14; focusOnPress: true
+
+ onTextChanged: container.urlChanged()
+
+ Keys.onEscapePressed: {
+ urlText.text = webView.url
+ webView.focus = true
+ }
+
+ Keys.onEnterPressed: {
+ container.urlEntered(urlText.text)
+ webView.focus = true
+ }
+
+ Keys.onReturnPressed: {
+ container.urlEntered(urlText.text)
+ webView.focus = true
+ }
+
+ anchors {
+ left: parent.left; right: parent.right; leftMargin: 18; rightMargin: 18
+ verticalCenter: parent.verticalCenter
+ }
+ }
+}
diff --git a/demos/declarative/webbrowser/content/fieldtext/FieldText.qml b/demos/declarative/webbrowser/content/fieldtext/FieldText.qml
deleted file mode 100644
index d1d003f8e2..0000000000
--- a/demos/declarative/webbrowser/content/fieldtext/FieldText.qml
+++ /dev/null
@@ -1,157 +0,0 @@
-import Qt 4.7
-
-Item {
- id: fieldText
- height: 30
- property string text: ""
- property string label: ""
- property bool mouseGrabbed: false
- signal confirmed
- signal cancelled
- signal startEdit
-
- function edit() {
- if (!mouseGrabbed) {
- fieldText.startEdit();
- fieldText.state='editing';
- mouseGrabbed=true;
- }
- }
-
- function confirm() {
- fieldText.state='';
- fieldText.text = textEdit.text;
- mouseGrabbed=false;
- fieldText.confirmed();
- }
-
- function reset() {
- textEdit.text = fieldText.text;
- fieldText.state='';
- mouseGrabbed=false;
- fieldText.cancelled();
- }
-
- Image {
- id: cancelIcon
- width: 22
- height: 22
- anchors.right: parent.right
- anchors.rightMargin: 4
- anchors.verticalCenter: parent.verticalCenter
- source: "pics/cancel.png"
- opacity: 0
- }
-
- Image {
- id: confirmIcon
- width: 22
- height: 22
- anchors.left: parent.left
- anchors.leftMargin: 4
- anchors.verticalCenter: parent.verticalCenter
- source: "pics/ok.png"
- opacity: 0
- }
-
- TextInput {
- id: textEdit
- text: fieldText.text
- focus: false
- anchors.left: parent.left
- anchors.leftMargin: 0
- anchors.right: parent.right
- anchors.rightMargin: 0
- anchors.verticalCenter: parent.verticalCenter
- color: "black"
- font.bold: true
- readOnly: true
- onAccepted: confirm()
- Keys.onEscapePressed: reset()
- }
-
- Text {
- id: textLabel
- x: 5
- width: parent.width-10
- anchors.verticalCenter: parent.verticalCenter
- horizontalAlignment: Text.AlignHCenter
- color: fieldText.state == "editing" ? "#505050" : "#AAAAAA"
- font.italic: true
- font.bold: true
- text: label
- opacity: textEdit.text == '' ? 1 : 0
- Behavior on opacity {
- NumberAnimation {
- property: "opacity"
- duration: 250
- }
- }
- }
-
- MouseArea {
- anchors.fill: cancelIcon
- onClicked: { reset() }
- }
-
- MouseArea {
- anchors.fill: confirmIcon
- onClicked: { confirm() }
- }
-
- MouseArea {
- id: editRegion
- anchors.fill: textEdit
- onClicked: { edit() }
- }
-
- states: [
- State {
- name: "editing"
- PropertyChanges {
- target: confirmIcon
- opacity: 1
- }
- PropertyChanges {
- target: cancelIcon
- opacity: 1
- }
- PropertyChanges {
- target: textEdit
- color: "black"
- readOnly: false
- focus: true
- selectionStart: 0
- selectionEnd: -1
- }
- PropertyChanges {
- target: editRegion
- opacity: 0
- }
- PropertyChanges {
- target: textEdit.anchors
- leftMargin: 34
- }
- PropertyChanges {
- target: textEdit.anchors
- rightMargin: 34
- }
- }
- ]
-
- transitions: [
- Transition {
- from: ""
- to: "*"
- reversible: true
- NumberAnimation {
- properties: "opacity,leftMargin,rightMargin"
- duration: 200
- }
- ColorAnimation {
- property: "color"
- duration: 150
- }
- }
- ]
-}
diff --git a/demos/declarative/webbrowser/content/fieldtext/pics/cancel.png b/demos/declarative/webbrowser/content/fieldtext/pics/cancel.png
deleted file mode 100644
index ecc95331f2..0000000000
--- a/demos/declarative/webbrowser/content/fieldtext/pics/cancel.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/fieldtext/pics/ok.png b/demos/declarative/webbrowser/content/fieldtext/pics/ok.png
deleted file mode 100644
index 5795f04fbf..0000000000
--- a/demos/declarative/webbrowser/content/fieldtext/pics/ok.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/addressbar-filled.png b/demos/declarative/webbrowser/content/pics/addressbar-filled.png
deleted file mode 100644
index d8452ecda1..0000000000
--- a/demos/declarative/webbrowser/content/pics/addressbar-filled.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/addressbar-filled.sci b/demos/declarative/webbrowser/content/pics/addressbar-filled.sci
deleted file mode 100644
index 96c5efbe80..0000000000
--- a/demos/declarative/webbrowser/content/pics/addressbar-filled.sci
+++ /dev/null
@@ -1,6 +0,0 @@
-border.left: 7
-border.top: 7
-border.bottom: 7
-border.right: 7
-source: addressbar-filled.png
-
diff --git a/demos/declarative/webbrowser/content/pics/addressbar.png b/demos/declarative/webbrowser/content/pics/addressbar.png
deleted file mode 100644
index 3278f58fc5..0000000000
--- a/demos/declarative/webbrowser/content/pics/addressbar.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/addressbar.sci b/demos/declarative/webbrowser/content/pics/addressbar.sci
deleted file mode 100644
index 8f1cd18fca..0000000000
--- a/demos/declarative/webbrowser/content/pics/addressbar.sci
+++ /dev/null
@@ -1,6 +0,0 @@
-border.left: 7
-border.top: 7
-border.bottom: 7
-border.right: 7
-source: addressbar.png
-
diff --git a/demos/declarative/webbrowser/content/pics/back-disabled.png b/demos/declarative/webbrowser/content/pics/back-disabled.png
deleted file mode 100644
index 91b9e76364..0000000000
--- a/demos/declarative/webbrowser/content/pics/back-disabled.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/back.png b/demos/declarative/webbrowser/content/pics/back.png
deleted file mode 100644
index 9988dd35a9..0000000000
--- a/demos/declarative/webbrowser/content/pics/back.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/display.png b/demos/declarative/webbrowser/content/pics/display.png
new file mode 100644
index 0000000000..9507f4382e
--- /dev/null
+++ b/demos/declarative/webbrowser/content/pics/display.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/edit-delete.png b/demos/declarative/webbrowser/content/pics/edit-delete.png
new file mode 100644
index 0000000000..351659ba4b
--- /dev/null
+++ b/demos/declarative/webbrowser/content/pics/edit-delete.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/footer.png b/demos/declarative/webbrowser/content/pics/footer.png
deleted file mode 100644
index 8391a93723..0000000000
--- a/demos/declarative/webbrowser/content/pics/footer.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/footer.sci b/demos/declarative/webbrowser/content/pics/footer.sci
deleted file mode 100644
index 7be58f1d93..0000000000
--- a/demos/declarative/webbrowser/content/pics/footer.sci
+++ /dev/null
@@ -1,6 +0,0 @@
-border.left: 5
-border.top: 0
-border.bottom: 0
-border.right: 5
-source: footer.png
-
diff --git a/demos/declarative/webbrowser/content/pics/forward-disabled.png b/demos/declarative/webbrowser/content/pics/forward-disabled.png
deleted file mode 100644
index cb87f4f950..0000000000
--- a/demos/declarative/webbrowser/content/pics/forward-disabled.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/forward.png b/demos/declarative/webbrowser/content/pics/forward.png
deleted file mode 100644
index 83870eea81..0000000000
--- a/demos/declarative/webbrowser/content/pics/forward.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/go-jump-locationbar.png b/demos/declarative/webbrowser/content/pics/go-jump-locationbar.png
new file mode 100644
index 0000000000..636fe38a77
--- /dev/null
+++ b/demos/declarative/webbrowser/content/pics/go-jump-locationbar.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/go-next-view.png b/demos/declarative/webbrowser/content/pics/go-next-view.png
new file mode 100644
index 0000000000..3bce02d473
--- /dev/null
+++ b/demos/declarative/webbrowser/content/pics/go-next-view.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/go-previous-view.png b/demos/declarative/webbrowser/content/pics/go-previous-view.png
new file mode 100644
index 0000000000..3ec011ef1c
--- /dev/null
+++ b/demos/declarative/webbrowser/content/pics/go-previous-view.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/header.png b/demos/declarative/webbrowser/content/pics/header.png
deleted file mode 100644
index 26588c3142..0000000000
--- a/demos/declarative/webbrowser/content/pics/header.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/reload.png b/demos/declarative/webbrowser/content/pics/reload.png
deleted file mode 100644
index 45b5535ce4..0000000000
--- a/demos/declarative/webbrowser/content/pics/reload.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/scrollbar.png b/demos/declarative/webbrowser/content/pics/scrollbar.png
new file mode 100644
index 0000000000..0228dcf9eb
--- /dev/null
+++ b/demos/declarative/webbrowser/content/pics/scrollbar.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/softshadow-bottom.png b/demos/declarative/webbrowser/content/pics/softshadow-bottom.png
deleted file mode 100644
index 85b0b4451b..0000000000
--- a/demos/declarative/webbrowser/content/pics/softshadow-bottom.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/softshadow-left.png b/demos/declarative/webbrowser/content/pics/softshadow-left.png
deleted file mode 100644
index 02926d1135..0000000000
--- a/demos/declarative/webbrowser/content/pics/softshadow-left.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/softshadow-left.sci b/demos/declarative/webbrowser/content/pics/softshadow-left.sci
deleted file mode 100644
index 45c88d5b68..0000000000
--- a/demos/declarative/webbrowser/content/pics/softshadow-left.sci
+++ /dev/null
@@ -1,5 +0,0 @@
-border.left: 0
-border.top: 16
-border.bottom: 16
-border.right: 0
-source: softshadow-left.png
diff --git a/demos/declarative/webbrowser/content/pics/softshadow-right.png b/demos/declarative/webbrowser/content/pics/softshadow-right.png
deleted file mode 100644
index e459f4fb04..0000000000
--- a/demos/declarative/webbrowser/content/pics/softshadow-right.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/softshadow-right.sci b/demos/declarative/webbrowser/content/pics/softshadow-right.sci
deleted file mode 100644
index 4d459c027a..0000000000
--- a/demos/declarative/webbrowser/content/pics/softshadow-right.sci
+++ /dev/null
@@ -1,5 +0,0 @@
-border.left: 0
-border.top: 16
-border.bottom: 16
-border.right: 0
-source: softshadow-right.png
diff --git a/demos/declarative/webbrowser/content/pics/softshadow-top.png b/demos/declarative/webbrowser/content/pics/softshadow-top.png
deleted file mode 100644
index 9a9e23219f..0000000000
--- a/demos/declarative/webbrowser/content/pics/softshadow-top.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/titlebar-bg.png b/demos/declarative/webbrowser/content/pics/titlebar-bg.png
new file mode 100644
index 0000000000..06961e8d84
--- /dev/null
+++ b/demos/declarative/webbrowser/content/pics/titlebar-bg.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/view-refresh.png b/demos/declarative/webbrowser/content/pics/view-refresh.png
new file mode 100644
index 0000000000..afa2a9d774
--- /dev/null
+++ b/demos/declarative/webbrowser/content/pics/view-refresh.png
Binary files differ