Changeset View
Changeset View
Standalone View
Standalone View
applets/webbrowser/contents/ui/main.qml
- This file was deleted.
1 | /*************************************************************************** | | |||
---|---|---|---|---|---|
2 | * Copyright 2014, 2016 by Mikhail Ivchenko <ematirov@gmail.com> * | | |||
3 | * * | | |||
4 | * This program is free software; you can redistribute it and/or modify * | | |||
5 | * it under the terms of the GNU General Public License as published by * | | |||
6 | * the Free Software Foundation; either version 2 of the License, or * | | |||
7 | * (at your option) any later version. * | | |||
8 | * * | | |||
9 | * This program is distributed in the hope that it will be useful, * | | |||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | | |||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | | |||
12 | * GNU General Public License for more details. * | | |||
13 | * * | | |||
14 | * You should have received a copy of the GNU General Public License * | | |||
15 | * along with this program; if not, write to the * | | |||
16 | * Free Software Foundation, Inc., * | | |||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * | | |||
18 | ***************************************************************************/ | | |||
19 | | ||||
20 | import QtQuick 2.0 | | |||
21 | import QtWebKit 3.0 | | |||
22 | import QtQuick.Layouts 1.1 | | |||
23 | import org.kde.plasma.components 2.0 as PlasmaComponents | | |||
24 | import org.kde.plasma.extras 2.0 as PlasmaExtras | | |||
25 | | ||||
26 | ColumnLayout { | | |||
27 | RowLayout{ | | |||
28 | Layout.fillWidth: true | | |||
29 | PlasmaComponents.Button{ | | |||
30 | iconSource: "go-previous" | | |||
31 | onClicked: webview.goBack() | | |||
32 | enabled: webview.canGoBack | | |||
33 | } | | |||
34 | PlasmaComponents.Button{ | | |||
35 | iconSource: "go-next" | | |||
36 | onClicked: webview.goForward() | | |||
37 | enabled: webview.canGoForward | | |||
38 | } | | |||
39 | PlasmaComponents.TextField{ | | |||
40 | Layout.fillWidth: true | | |||
41 | onAccepted: { | | |||
42 | var url = text; | | |||
43 | if (url.indexOf(":/") < 0) { | | |||
44 | url = "http://" + url; | | |||
45 | } | | |||
46 | webview.url = url; | | |||
47 | } | | |||
48 | text: webview.url | | |||
49 | } | | |||
50 | PlasmaComponents.Button{ | | |||
51 | iconSource: "view-refresh" | | |||
52 | onClicked: webview.reload() | | |||
53 | } | | |||
54 | } | | |||
55 | PlasmaExtras.ScrollArea { | | |||
56 | Layout.fillWidth: true | | |||
57 | Layout.fillHeight: true | | |||
58 | WebView { | | |||
59 | id: webview | | |||
60 | anchors.fill: parent | | |||
61 | onUrlChanged: plasmoid.configuration.url = url; | | |||
62 | Component.onCompleted: url = plasmoid.configuration.url; | | |||
63 | } | | |||
64 | } | | |||
65 | //There will be RowLayout with buttons for bookmarks and zooming. | | |||
66 | | ||||
67 | } | |