summaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/BrowserWindow.qml23
-rw-r--r--src/qml/FeaturePermissionBar.qml8
-rw-r--r--src/qml/HomeScreen.qml6
-rw-r--r--src/qml/Keyboard.qml5
-rw-r--r--src/qml/Main.qml2
-rw-r--r--src/qml/MockTouchPoint.qml2
-rw-r--r--src/qml/NavigationBar.qml76
-rw-r--r--src/qml/PageView.qml72
-rw-r--r--src/qml/SettingsView.qml48
-rw-r--r--src/qml/assets/UIButton.qml28
-rw-r--r--src/qml/assets/UIToolBar.qml21
11 files changed, 132 insertions, 159 deletions
diff --git a/src/qml/BrowserWindow.qml b/src/qml/BrowserWindow.qml
index 05ddcff..ca52cbf 100644
--- a/src/qml/BrowserWindow.qml
+++ b/src/qml/BrowserWindow.qml
@@ -27,14 +27,12 @@
**
****************************************************************************/
-import QtQuick 2.5
-import QtWebEngine 1.1
+import QtQuick
+import QtWebEngine
+import QtQuick.Controls
+import QtQuick.Layouts
+import Qt.labs.platform
-import QtQuick.Controls 1.0
-import QtQuick.Controls.Styles 1.0
-import QtQuick.Layouts 1.0
-import QtQuick.Controls.Private 1.0
-import QtQuick.Dialogs 1.2
import "assets"
import WebBrowser 1.0
@@ -162,7 +160,7 @@ Item {
z: 6
title: qsTr("Leave Full Screen Mode")
visible: opacity != 0.0
- opacity: tabView.viewState == "fullscreen" ? 1.0 : 0.0
+ opacity: tabView.viewState === "fullscreen" ? 1.0 : 0.0
anchors {
left: parent.left
right: parent.right
@@ -233,22 +231,21 @@ Item {
property var certErrors: []
property var currentError: null
visible: certErrors.length > 0
- icon: StandardIcon.Warning
- standardButtons: StandardButton.No | StandardButton.Yes
+ buttons: MessageDialog.No | MessageDialog.Yes
title: "Server's certificate not trusted"
text: "Do you wish to continue?"
detailedText: "If you wish so, you may continue with an unverified certificate. " +
"Accepting an unverified certificate means " +
"you may not be connected with the host you tried to connect to.\n" +
"Do you wish to override the security check and continue?"
- onYes: {
+ onYesClicked: {
var cert = certErrors.shift()
var domain = AppEngine.domainFromString(cert.url)
acceptedCertificates.acceptedUrls.push(domain)
cert.ignoreCertificateError()
presentError()
}
- onNo: reject()
+ onNoClicked: reject()
onRejected: reject()
function reject(){
@@ -304,7 +301,7 @@ Item {
SearchProxyModel {
id: proxy
- target: navigation.webView.navigationHistory.items
+ target: navigation.webView.history.items
searchString: urlDropDown.searchString
enabled: urlDropDown.state == "enabled"
}
diff --git a/src/qml/FeaturePermissionBar.qml b/src/qml/FeaturePermissionBar.qml
index 374c9d7..04ecb5a 100644
--- a/src/qml/FeaturePermissionBar.qml
+++ b/src/qml/FeaturePermissionBar.qml
@@ -27,10 +27,10 @@
**
****************************************************************************/
-import QtQuick 2.1
-import QtQuick.Controls 1.0
-import QtWebEngine 1.1
-import QtQuick.Layouts 1.0
+import QtQuick
+import QtQuick.Controls
+import QtWebEngine
+import QtQuick.Layouts
import "assets"
diff --git a/src/qml/HomeScreen.qml b/src/qml/HomeScreen.qml
index 3d66e87..ebe5f92 100644
--- a/src/qml/HomeScreen.qml
+++ b/src/qml/HomeScreen.qml
@@ -27,8 +27,8 @@
**
****************************************************************************/
-import QtQuick 2.5
-import WebBrowser 1.0
+import QtQuick
+import WebBrowser
import "assets"
Rectangle {
@@ -172,7 +172,7 @@ Rectangle {
var margin = (parent.width - 4 * gridView.cellWidth - homeScreen.padding) / 2
var padding = gridView.page - Math.round(gridView.count % gridViewPageItemCount / 2) * gridView.cellWidth
- if (padding == gridView.page)
+ if (padding === gridView.page)
return margin
return margin + padding
diff --git a/src/qml/Keyboard.qml b/src/qml/Keyboard.qml
index 9ea7f71..c345920 100644
--- a/src/qml/Keyboard.qml
+++ b/src/qml/Keyboard.qml
@@ -27,8 +27,9 @@
**
****************************************************************************/
-import QtQuick 2.5
-import QtQuick.VirtualKeyboard 2.0
+import QtQuick
+import QtQuick.VirtualKeyboard
+
InputPanel {
id: inputPanel
diff --git a/src/qml/Main.qml b/src/qml/Main.qml
index 653b435..ea4d533 100644
--- a/src/qml/Main.qml
+++ b/src/qml/Main.qml
@@ -27,7 +27,7 @@
**
****************************************************************************/
-import QtQuick 2.5
+import QtQuick
Item {
BrowserWindow{
diff --git a/src/qml/MockTouchPoint.qml b/src/qml/MockTouchPoint.qml
index b47525c..9ae7420 100644
--- a/src/qml/MockTouchPoint.qml
+++ b/src/qml/MockTouchPoint.qml
@@ -27,7 +27,7 @@
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick
Item {
id: mockTouchPoint
diff --git a/src/qml/NavigationBar.qml b/src/qml/NavigationBar.qml
index f6e3bea..765b00f 100644
--- a/src/qml/NavigationBar.qml
+++ b/src/qml/NavigationBar.qml
@@ -27,10 +27,9 @@
**
****************************************************************************/
-import QtQuick 2.5
-import QtQuick.Controls 1.4
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
import WebBrowser 1.0
import "assets"
@@ -63,18 +62,11 @@ ToolBar {
state: "enabled"
- style: ToolBarStyle {
- background: Rectangle {
- color: uiColor
- implicitHeight: toolBarSize + 3
- }
- padding {
- left: 0
- right: 0
- top: 0
- bottom: 0
- }
+ background: Rectangle {
+ color: uiColor
+ implicitHeight: toolBarSize + 3
}
+ padding: 0
Behavior on y {
NumberAnimation { duration: animationDuration }
@@ -243,24 +235,23 @@ ToolBar {
urlBar.remove(urlBar.selectionStart, urlBar.selectionEnd)
}
}
- style: TextFieldStyle {
- textColor: "black"
- font.family: defaultFontFamily
- font.pixelSize: 28
- selectionColor: uiHighlightColor
- selectedTextColor: "black"
- placeholderTextColor: placeholderColor
- background: Rectangle {
- implicitWidth: 514
- implicitHeight: 56
- border.color: settingsView.privateBrowsingEnabled ? "black" : textFieldStrokeColor
- border.width: 1
- }
- padding {
- left: 15
- right: reloadButton.width
- }
+
+ color: "black"
+ font.family: defaultFontFamily
+ font.pixelSize: 28
+ selectionColor: uiHighlightColor
+ selectedTextColor: "black"
+ placeholderTextColor: placeholderColor
+ background: Rectangle {
+ implicitWidth: 514
+ implicitHeight: 56
+ border.color: settingsView.privateBrowsingEnabled ? "black" : textFieldStrokeColor
+ border.width: 1
}
+ leftPadding: 15
+ rightPadding: reloadButton.width
+ topPadding: 10
+
onAccepted: {
webView.url = AppEngine.fromUserInput(text)
homeScreen.state = "disabled"
@@ -404,17 +395,18 @@ ToolBar {
leftMargin: -10
rightMargin: -10
}
- style: ProgressBarStyle {
- background: Rectangle {
- height: 3
- color: emptyBackgroundColor
- }
- progress: Rectangle {
- color: settingsView.privateBrowsingEnabled ? "#46a2da" : "#317198"
- }
+
+ background: Rectangle {
+ height: 3
+ color: emptyBackgroundColor
+ }
+
+ contentItem: Rectangle {
+ width: progressBar.visualPosition * parent.width
+ color: settingsView.privateBrowsingEnabled ? "#46a2da" : "#317198"
}
- minimumValue: 0
- maximumValue: 100
+ from: 0
+ to: 100
value: (webView && webView.loadProgress < 100) ? webView.loadProgress : 0
}
}
diff --git a/src/qml/PageView.qml b/src/qml/PageView.qml
index d20355c..32237e6 100644
--- a/src/qml/PageView.qml
+++ b/src/qml/PageView.qml
@@ -27,12 +27,11 @@
**
****************************************************************************/
-import QtQuick 2.5
-import QtWebEngine 1.9
-import QtQuick.Controls 1.4
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Layouts 1.2
-import QtGraphicalEffects 1.0
+import QtQuick
+import QtWebEngine
+import QtQuick.Controls
+import QtQuick.Layouts
+import Qt5Compat.GraphicalEffects
import WebBrowser 1.0
import "assets"
@@ -62,7 +61,6 @@ Rectangle {
property QtObject defaultProfile: WebEngineProfile {
storageName: "YABProfile"
offTheRecord: false
- useForGlobalCertificateVerification: true
}
Component {
@@ -73,7 +71,7 @@ Rectangle {
property alias title: webEngineView.title
property var image: QtObject {
- property var snapshot: null
+ property var grabberUrl: null
property string url: "about:blank"
}
@@ -120,29 +118,25 @@ Rectangle {
function takeSnapshot() {
if (webEngineView.url == "" || webEngineView.url == "about:blank") {
tabItem.image.url = "about:blank"
- tabItem.image.snapshot = null
+ tabItem.image.grabberUrl = null
return
}
- if (tabItem.image.url == webEngineView.url || tabItem.opacity != 1.0)
+ if (tabItem.image.url === webEngineView.url || tabItem.opacity != 1.0)
return
tabItem.image.url = webEngineView.url
webEngineView.grabToImage(function(result) {
- tabItem.image.snapshot = result;
- console.log("takeSnapshot("+result.url+")")
+ tabItem.image.grabberUrl = result.url;
});
}
// Trigger a refresh to check if the new url is bookmarked.
onUrlChanged: navigation.refresh()
-
settings.autoLoadImages: settingsView.autoLoadImages
settings.javascriptEnabled: !settingsView.javaScriptDisabled
-
- // This should be enabled as we can switch to Qt 5.6 (i.e. import QtWebEngine 1.2)
- // settings.pluginsEnabled: settingsView.pluginsEnabled
+ settings.pluginsEnabled: settingsView.pluginsEnabled
onLoadingChanged: {
if (loading)
@@ -158,7 +152,7 @@ Rectangle {
}
}
- onNewViewRequested: {
+ onNewWindowRequested: {
webEngineView.takeSnapshot()
var tab
if (!request.userInitiated) {
@@ -305,19 +299,18 @@ Rectangle {
onAccepted: {
webEngineView.findText(text)
}
- style: TextFieldStyle {
- textColor: "black"
- font.family: defaultFontFamily
- font.pixelSize: 28
- selectionColor: uiHighlightColor
- selectedTextColor: "black"
- placeholderTextColor: placeholderColor
- background: Rectangle {
- implicitWidth: 514
- implicitHeight: toolBarSize / 2
- border.color: textFieldStrokeColor
- border.width: 1
- }
+
+ color: "black"
+ font.family: defaultFontFamily
+ font.pixelSize: 28
+ selectionColor: uiHighlightColor
+ selectedTextColor: "black"
+ placeholderTextColor: placeholderColor
+ background: Rectangle {
+ implicitWidth: 514
+ implicitHeight: toolBarSize / 2
+ border.color: textFieldStrokeColor
+ border.width: 1
}
}
Rectangle {
@@ -332,7 +325,7 @@ Rectangle {
}
UIButton {
id: findBackwardButton
- iconSource: "assets/icons/Btn_Back.png"
+ icon.source: "assets/icons/Btn_Back.png"
implicitHeight: parent.height
onClicked: webEngineView.findText(findTextField.text, WebEngineView.FindBackward)
}
@@ -343,7 +336,7 @@ Rectangle {
}
UIButton {
id: findForwardButton
- iconSource: "assets/icons/Btn_Forward.png"
+ icon.source: "assets/icons/Btn_Forward.png"
implicitHeight: parent.height
onClicked: webEngineView.findText(findTextField.text)
}
@@ -354,7 +347,7 @@ Rectangle {
}
UIButton {
id: findCancelButton
- iconSource: "assets/icons/Btn_Clear.png"
+ icon.source: "assets/icons/Btn_Clear.png"
implicitHeight: parent.height
onClicked: findBar.visible = false
}
@@ -389,7 +382,7 @@ Rectangle {
var element = {"item": null }
element.item = component.createObject(root, { "width": root.width, "height": root.height, "opacity": 0.0 })
- if (element.item == null) {
+ if (element.item === null) {
console.log("PageView::add(): Error creating object");
return
}
@@ -498,12 +491,12 @@ Rectangle {
MouseArea {
enabled: pathView.interactive
anchors.fill: wrapper
- onClicked: {
+ onClicked: mouse => {
mouse.accepted = true
if (index < 0)
return
- if (index == pathView.currentIndex) {
+ if (index === pathView.currentIndex) {
if (root.viewState == "list")
root.viewState = "page"
return
@@ -525,6 +518,7 @@ Rectangle {
width: snapshot.width
height: snapshot.height
}
+
GaussianBlur {
anchors.fill: shadow
source: shadow
@@ -541,13 +535,13 @@ Rectangle {
Image {
source: {
- if (!item.image.snapshot)
+ if (!item.image.grabberUrl)
return "assets/icons/about_blank.png"
- return item.image.snapshot.url
+ return item.image.grabberUrl
}
anchors.fill: parent
Rectangle {
- enabled: index == pathView.currentIndex && !pathView.moving && !pathView.flicking && wrapper.visibility == 1.0
+ enabled: index === pathView.currentIndex && !pathView.moving && !pathView.flicking && wrapper.visibility == 1.0
opacity: enabled ? 1.0 : 0.0
visible: wrapper.visibility == 1.0 && listModel.count > 1
width: image.sourceSize.width
diff --git a/src/qml/SettingsView.qml b/src/qml/SettingsView.qml
index f01a5a8..925c82d 100644
--- a/src/qml/SettingsView.qml
+++ b/src/qml/SettingsView.qml
@@ -27,11 +27,10 @@
**
****************************************************************************/
-import QtQuick 2.5
-import QtQuick.Layouts 1.0
-import QtQuick.Controls 1.4
-import QtQuick.Controls.Styles 1.4
-import Qt.labs.settings 1.0
+import QtQuick
+import QtQuick.Layouts
+import QtQuick.Controls
+import Qt.labs.settings
import WebBrowser 1.0
Rectangle {
@@ -41,14 +40,14 @@ Rectangle {
property bool httpDiskCacheEnabled: appSettings[1].active
property bool autoLoadImages: appSettings[2].active
property bool javaScriptDisabled: appSettings[3].active
- // property bool pluginsEnabled: appSettings[4].active
+ property bool pluginsEnabled: appSettings[4].active
property var appSettings: [
{ "name": "Private Browsing", "active": false, "notify": function(v) { privateBrowsingEnabled = v; } },
{ "name": "Enable HTTP Disk Cache", "active": true, "notify": function(v) { httpDiskCacheEnabled = v; } },
{ "name": "Auto Load Images", "active": true, "notify": function(v) { autoLoadImages = v; } },
{ "name": "Disable JavaScript", "active": false, "notify": function(v) { javaScriptDisabled = v; } },
-// { "name": "Enable Plugins", "active": false, "notify": function(v) { pluginsEnabled = v; } }
+ { "name": "Enable Plugins", "active": false, "notify": function(v) { pluginsEnabled = v; } }
]
function save() {
@@ -135,24 +134,25 @@ Rectangle {
setting.active = checked
setting.notify(checked)
}
- style: SwitchStyle {
- handle: Rectangle {
- width: 42
- height: 42
- radius: height / 2
- color: "white"
- border.color: control.checked ? "#5caa14" : "#9b9b9b"
- border.width: 1
- }
- groove: Rectangle {
- implicitWidth: 72
- height: 42
- radius: height / 2
- border.color: control.checked ? "#5caa14" : "#9b9b9b"
- color: control.checked ? "#5cff14" : "white"
- border.width: 1
- }
+ indicator: Rectangle {
+ x: sw.checked ? parent.width - width : 0
+ width: 42
+ height: 42
+ radius: height / 2
+ color: "white"
+ border.color: sw.checked ? "#5caa14" : "#9b9b9b"
+ border.width: 1
+
+ }
+
+ background: Rectangle {
+ implicitWidth: 72
+ height: 42
+ radius: height / 2
+ border.color: sw.checked ? "#5caa14" : "#9b9b9b"
+ color: sw.checked ? "#5cff14" : "white"
+ border.width: 1
}
}
}
diff --git a/src/qml/assets/UIButton.qml b/src/qml/assets/UIButton.qml
index 38d3e5a..ec53bb3 100644
--- a/src/qml/assets/UIButton.qml
+++ b/src/qml/assets/UIButton.qml
@@ -27,10 +27,9 @@
**
****************************************************************************/
-import QtQuick 2.5
-import QtQuick.Controls 1.4
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
ToolButton {
@@ -52,17 +51,16 @@ ToolButton {
font.family: defaultFontFamily
font.pixelSize: 28
}
- style: ButtonStyle {
- background: Rectangle {
- opacity: root.enabled ? 1.0 : 0.3
- color: root.pressed || root.checked ? root.highlightColor : root.color
- radius: root.radius
- Image {
- source: root.source
- width: Math.min(sourceSize.width, root.width)
- height: Math.min(sourceSize.height, root.height)
- anchors.centerIn: parent
- }
+
+ background: Rectangle {
+ opacity: root.enabled ? 1.0 : 0.3
+ color: root.pressed || root.checked ? root.highlightColor : root.color
+ radius: root.radius
+ Image {
+ source: root.source
+ width: Math.min(sourceSize.width, root.width)
+ height: Math.min(sourceSize.height, root.height)
+ anchors.centerIn: parent
}
}
}
diff --git a/src/qml/assets/UIToolBar.qml b/src/qml/assets/UIToolBar.qml
index caf4ec1..40aa990 100644
--- a/src/qml/assets/UIToolBar.qml
+++ b/src/qml/assets/UIToolBar.qml
@@ -27,10 +27,9 @@
**
****************************************************************************/
-import QtQuick 2.5
-import QtQuick.Controls 1.0
-import QtQuick.Controls.Styles 1.0
-import QtQuick.Layouts 1.0
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
ToolBar {
id: root
@@ -46,18 +45,10 @@ ToolBar {
signal doneClicked()
height: navigation.height
-
- style: ToolBarStyle {
- background: Rectangle {
- color: toolBarFillColor
- }
- padding {
- left: 0
- right: 0
- top: 0
- bottom: 0
- }
+ background: Rectangle {
+ color: toolBarFillColor
}
+ padding: 0
RowLayout {
spacing: 0