diff --git a/package/contents/ui/Bookmarks.qml b/package/contents/ui/Bookmarks.qml index 09b9a6a..6d5234c 100644 --- a/package/contents/ui/Bookmarks.qml +++ b/package/contents/ui/Bookmarks.qml @@ -1,54 +1,51 @@ /*************************************************************************** * * * Copyright 2014-2015 Sebastian Kügler * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * * * ***************************************************************************/ import QtQuick 2.3 //import QtQuick.Controls 1.0 //import QtWebEngine 1.0 import QtQuick.Layouts 1.0 -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.extras 2.0 as PlasmaExtras - Item { // id: options //Rectangle { anchors.fill: parent; color: "orange"; opacity: 0.5; } anchors.fill: parent ListView { anchors.fill: parent spacing: units.smallSpacing interactive: height < contentHeight model: browserManager.bookmarks delegate: UrlDelegate { onRemoved: browserManager.removeBookmark(url); } } Component.onCompleted: print("Bookmarks.qml complete."); } diff --git a/package/contents/ui/ContentView.qml b/package/contents/ui/ContentView.qml index 2df3f99..2ee7e92 100644 --- a/package/contents/ui/ContentView.qml +++ b/package/contents/ui/ContentView.qml @@ -1,144 +1,141 @@ /*************************************************************************** * * * Copyright 2014-2015 Sebastian Kügler * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * * * ***************************************************************************/ import QtQuick 2.3 //import QtWebEngine 1.0 //import QtQuick.Controls 1.0 //import QtQuick.Controls.Styles 1.0 import QtQuick.Layouts 1.0 //import QtQuick.Window 2.1 //import QtQuick.Controls.Private 1.0 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.kirigami 2.0 as Kirigami Rectangle { id: contentView //state: "hidden" state: "hidden" property string title: "" color: theme.backgroundColor Rectangle { color: "white" opacity: 0.6 anchors.fill: parent } opacity: state == "hidden" ? 0.0 : 1.0 Behavior on opacity { NumberAnimation { duration: units.longDuration/2; easing.type: Easing.InOutQuad } } MouseArea { // block intput from arriving in the webview anchors.fill: parent visible: contentView.state != "hidden" onPressed: { mouse.accepted = true; print("Blocked Mouse."); } } Loader { id: contentViewLoader anchors { top: heading.bottom left: parent.left right: parent.right bottom: parent.bottom margins: Kirigami.Units.gridUnit / 2 } } - PlasmaExtras.Heading { + Kirigami.Heading { id: heading level: 2 text: contentView.title anchors { right: closeButton.left top: parent.top left: parent.left margins: Kirigami.Units.gridUnit / 2 } MouseArea { anchors.fill: parent onClicked: contentView.state = "hidden" } } - PlasmaCore.IconItem { + Kirigami.Icon { id: closeButton width: Kirigami.Units.gridUnit height: width source: "dialog-close" anchors { right: parent.right top: parent.top margins: Kirigami.Units.gridUnit } MouseArea { anchors.fill: parent onClicked: contentView.state = "hidden" } } states: [ State { name: "hidden" //PropertyChanges { target: currentWebView; visible: true} }, State { name: "history" PropertyChanges { target: contentView; title: i18n("History")} PropertyChanges { target: contentViewLoader; source: "History.qml"} }, State { name: "bookmarks" PropertyChanges { target: contentViewLoader; source: "Bookmarks.qml"} PropertyChanges { target: contentView; title: i18n("Bookmarks")} }, State { name: "tabs" PropertyChanges { target: contentView; title: i18n("Tabs")} PropertyChanges { target: contentViewLoader; source: "Tabs.qml"} //PropertyChanges { target: currentWebView; visible: false} }, State { name: "settings" PropertyChanges { target: contentView; title: i18n("Settings")} PropertyChanges { target: contentViewLoader; source: "Settings.qml"} } ] } diff --git a/package/contents/ui/ErrorHandler.qml b/package/contents/ui/ErrorHandler.qml index 89e9f4b..e86eb06 100644 --- a/package/contents/ui/ErrorHandler.qml +++ b/package/contents/ui/ErrorHandler.qml @@ -1,92 +1,91 @@ /*************************************************************************** * * * Copyright 2014-2015 Sebastian Kügler * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * * * ***************************************************************************/ import QtQuick 2.3 //import QtWebEngine 1.0 -//import QtQuick.Controls 1.0 +import QtQuick.Controls 2.0 as Controls //import QtQuick.Controls.Styles 1.0 import QtQuick.Layouts 1.0 //import QtQuick.Window 2.1 //import QtQuick.Controls.Private 1.0 -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.extras 2.0 as PlasmaExtras + import org.kde.kirigami 2.0 as Kirigami Item { id: errorHandler property string errorCode: "" property alias errorString: errorDescription.text property int expandedHeight: Kirigami.Units.gridUnit * 8 Behavior on height { NumberAnimation { duration: units.longDuration; easing.type: Easing.InOutQuad} } Rectangle { anchors.fill: parent; color: theme.backgroundColor; } ColumnLayout { visible: parent.height > 0 spacing: Kirigami.Units.gridUnit anchors { fill: parent margins: Kirigami.Units.gridUnit } - PlasmaExtras.Heading { + Kirigami.Heading { level: 3 Layout.fillHeight: false text: i18n("Error loading the page") } - PlasmaComponents.Label { + Controls.Label { id: errorDescription Layout.fillHeight: false } Item { Layout.fillHeight: true } } - PlasmaComponents.Label { + Controls.Label { font.pixelSize: Math.round(parent.height / 3) opacity: 0.3 anchors { right: parent.right bottom: parent.bottom margins: Kirigami.Units.gridUnit } text: errorCode } states: [ State { name: "error" when: errorCode != "" PropertyChanges { target: errorHandler; height: expandedHeight} }, State { name: "normal" when: errorCode == "" PropertyChanges { target: errorHandler; height: 0} } ] } diff --git a/package/contents/ui/History.qml b/package/contents/ui/History.qml index afbddd0..3c21b98 100644 --- a/package/contents/ui/History.qml +++ b/package/contents/ui/History.qml @@ -1,53 +1,51 @@ /*************************************************************************** * * * Copyright 2014-2015 Sebastian Kügler * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * * * ***************************************************************************/ import QtQuick 2.3 //import QtQuick.Controls 1.0 //import QtWebEngine 1.0 import QtQuick.Layouts 1.0 -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.extras 2.0 as PlasmaExtras Item { // id: options //Rectangle { anchors.fill: parent; color: "orange"; opacity: 0.5; } anchors.fill: parent ListView { anchors.fill: parent spacing: units.smallSpacing interactive: height < contentHeight model: browserManager.history delegate: UrlDelegate { onRemoved: browserManager.removeFromHistory(url); } } Component.onCompleted: print("History.qml complete."); } diff --git a/package/contents/ui/Options.qml b/package/contents/ui/Options.qml index fd4a070..caf9eff 100644 --- a/package/contents/ui/Options.qml +++ b/package/contents/ui/Options.qml @@ -1,150 +1,147 @@ /*************************************************************************** * * * Copyright 2014-2015 Sebastian Kügler * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * * * ***************************************************************************/ import QtQuick 2.3 //import QtWebEngine 1.0 //import QtQuick.Controls 1.0 //import QtQuick.Controls.Styles 1.0 import QtQuick.Layouts 1.0 //import QtQuick.Window 2.1 //import QtQuick.Controls.Private 1.0 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.kirigami 2.0 as Kirigami Rectangle { id: options state: "hidden" //state: "bookmarks" color: Kirigami.Theme.backgroundColor property string title: "" property int expandedHeight: Kirigami.Units.gridUnit * 12 property int expandedWidth: Kirigami.Units.gridUnit * 14 Behavior on opacity { NumberAnimation { duration: units.longDuration/2; easing.type: Easing.InOutQuad} } Behavior on x { NumberAnimation { duration: units.longDuration/2; easing.type: Easing.InOutQuad} } height: expandedHeight width: expandedWidth //height: childrenRect.height + Kirigami.Units.gridUnit //width: childrenRect.width + Kirigami.Units.gridUnit/2 //width: expandedWidth //anchors.rightMargin: -options.margins.right //Rectangle { anchors.fill: parent; color: theme.backgroundColor; } Rectangle { width: webBrowser.borderWidth color: webBrowser.borderColor anchors { left: parent.left top: parent.top bottom: parent.bottom } } Rectangle { height: webBrowser.borderWidth color: webBrowser.borderColor anchors { left: parent.left bottom: parent.bottom right: parent.right } } ColumnLayout { //visible: parent.height > 0 //spacing: Kirigami.Units.gridUnit spacing: 0 //x: Kirigami.Units.gridUnit / 2 //y: - (Kirigami.Units.gridUnit + webBrowser.borderWidth) //width: Kirigami.Units.gridUnit * 14 anchors { //fill: parent top: parent.top //topMargin: Kirigami.Units.gridUnit left: parent.left right: parent.right //margins: Kirigami.Units.gridUnit / 2 } MouseArea { anchors.fill: parent } OptionsOverview { Layout.fillWidth: true; } Loader { id: loader Layout.fillHeight: true Layout.fillWidth: true //Rectangle { anchors.fill: parent; color: "black"; opacity: 0.1; } } } // NumberAnimation on state { // //loops: Animation.Infinite // from: state == "hidden" ? 0 : 1.0 // to: state == "hidden" ? 1.0 : 0.0 // } states: [ State { name: "hidden" PropertyChanges { target: options; opacity: 0.0} PropertyChanges { target: options; x: webBrowser.width} }, State { name: "overview" PropertyChanges { target: options; title: ""} //PropertyChanges { target: options; height: Kirigami.Units.gridUnit * 3} PropertyChanges { target: options; opacity: 1.0} PropertyChanges { target: options; x: webBrowser.width - options.width } }/*, State { name: "bookmarks" PropertyChanges { target: loader; source: "Bookmarks.qml"} PropertyChanges { target: options; title: i18n("Bookmarks")} PropertyChanges { target: options; height: expandedHeight} }, State { name: "tabs" PropertyChanges { target: options; title: i18n("Tabs")} PropertyChanges { target: loader; source: "Tabs.qml"} PropertyChanges { target: options; height: expandedHeight} }, State { name: "settings" PropertyChanges { target: options; title: i18n("Settings")} PropertyChanges { target: loader; source: "Settings.qml"} PropertyChanges { target: options; height: expandedHeight} } */ ] } diff --git a/package/contents/ui/OptionsOverview.qml b/package/contents/ui/OptionsOverview.qml index 049f9e5..fa3a2f7 100644 --- a/package/contents/ui/OptionsOverview.qml +++ b/package/contents/ui/OptionsOverview.qml @@ -1,178 +1,176 @@ /*************************************************************************** * * * Copyright 2014-2015 Sebastian Kügler * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * * * ***************************************************************************/ import QtQuick 2.3 //import QtWebEngine 1.0 //import QtQuick.Controls 1.0 //import QtQuick.Controls.Styles 1.0 import QtQuick.Layouts 1.0 //import QtQuick.Window 2.1 //import QtQuick.Controls.Private 1.0 -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.kirigami 2.0 as Kirigami ColumnLayout { id: optionsOverview property int buttonSize: Kirigami.Units.gridUnit * 2 RowLayout { id: layout anchors.fill: parent height: buttonSize spacing: 0 // anchors.leftMargin: Kirigami.Units.gridUnit / 2 // anchors.rightMargin: Kirigami.Units.gridUnit / 2 //visible: navigationShown //spacing: units.smallSpacing OptionButton { id: backButton enabled: currentWebView.canGoBack iconSource: "go-previous" onClicked: currentWebView.goBack() onTriggered: { print("Booh") options.state = "hidden"; currentWebView.goBack() } } OptionButton { id: forwardButton // Layout.fillWidth: true // Layout.preferredHeight: buttonSize enabled: currentWebView.canGoForward iconSource: "go-next" onTriggered: { options.state = "hidden"; currentWebView.goForward() } } OptionButton { id: reloadButton // Layout.fillWidth: true // Layout.preferredHeight: buttonSize iconSource: currentWebView.loading ? "process-stop" : "view-refresh" onTriggered: { options.state = "hidden"; currentWebView.loading ? currentWebView.stop() : currentWebView.reload() } } OptionButton { id: bookmarkButton // Layout.fillWidth: true // Layout.preferredHeight: buttonSize iconSource: "bookmarks" onTriggered: { print("Adding bookmark"); var request = new Object;// FIXME request.url = currentWebView.url; request.title = currentWebView.title; request.iconSource = currentWebView.iconSource; request.bookmarked = true; browserManager.addBookmark(request); options.state = "hidden" } } } // RowLayout { // // Layout.fillHeight: false // Layout.preferredWidth: parent.width Item { Layout.preferredHeight: units.smallSpacing Layout.fillWidth: true } OptionButton { iconSource: "tab-duplicate" Layout.fillWidth: true Layout.preferredHeight: buttonSize onTriggered: { contentView.state = "tabs" options.state = "hidden" } checked: contentView.state == "tabs" text: i18n("Tabs") } OptionButton { iconSource: "bookmarks" Layout.fillWidth: true Layout.preferredHeight: buttonSize onTriggered: { contentView.state = "bookmarks" options.state = "hidden" } //checked: contentView.state == "bookmarks" text: i18n("Bookmarks") } OptionButton { iconSource: "view-history" Layout.fillWidth: true Layout.preferredHeight: buttonSize onTriggered: { contentView.state = "history" options.state = "hidden" } //checked: contentView.state == "bookmarks" text: i18n("History") } OptionButton { iconSource: "configure" Layout.fillWidth: true Layout.preferredHeight: buttonSize text: i18n("Settings") checked: contentView.state == "settings" onTriggered: { contentView.state = "settings" options.state = "hidden" } } } diff --git a/package/contents/ui/UrlDelegate.qml b/package/contents/ui/UrlDelegate.qml index 64ea979..3cc4a0c 100644 --- a/package/contents/ui/UrlDelegate.qml +++ b/package/contents/ui/UrlDelegate.qml @@ -1,121 +1,118 @@ /*************************************************************************** * * * Copyright 2014-2015 Sebastian Kügler * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * * * ***************************************************************************/ import QtQuick 2.3 import QtQuick.Controls 2.0 as Controls //import QtWebEngine 1.0 import QtQuick.Layouts 1.0 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.extras 2.0 as PlasmaExtras - import org.kde.kirigami 2.0 as Kirigami + Controls.ItemDelegate { id: urlDelegate height: Kirigami.Units.gridUnit * 3 width: parent.width //Rectangle { anchors.fill: parent; color: "white"; opacity: 0.5; } onClicked: { load(url) // tabs.newTab(url) // contentView.state = "hidden" } signal removed Kirigami.Icon { id: urlIcon width: height anchors { left: parent.left top: parent.top topMargin: Kirigami.Units.gridUnit / 2 bottomMargin: Kirigami.Units.gridUnit / 2 bottom: parent.bottom margins: units.smallSpacing } source: icon } Image { anchors.fill: urlIcon source: preview == undefined ? "" : preview } Controls.Label { id: urlTitle text: title anchors { left: urlIcon.right leftMargin: units.largeSpacing / 2 right: parent.right bottom: parent.verticalCenter top: urlIcon.top //margins: units.smallSpacing } } Controls.Label { id: urlUrl text: url opacity: 0.6 font.pointSize: theme.smallestFont.pointSize anchors { left: urlIcon.right leftMargin: units.largeSpacing / 2 right: removeIcon.left top: urlIcon.verticalCenter bottom: parent.bottom //margins: units.smallSpacing } } Kirigami.Icon { id: removeIcon width: height source: "list-remove" //visible: bookmarked anchors { right: parent.right top: parent.top topMargin: Kirigami.Units.gridUnit bottomMargin: Kirigami.Units.gridUnit bottom: parent.bottom margins: units.smallSpacing } MouseArea { anchors.fill: parent onClicked: urlDelegate.removed(); } } }