Changeset View
Changeset View
Standalone View
Standalone View
src/context/applets/wikipedia/package/contents/ui/main.qml
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | 42 | Button { | |||
---|---|---|---|---|---|
48 | onClicked: content.goForward() | 48 | onClicked: content.goForward() | ||
49 | } | 49 | } | ||
50 | Button { | 50 | Button { | ||
51 | iconName: "view-refresh" | 51 | iconName: "view-refresh" | ||
52 | enabled: !content.loading | 52 | enabled: !content.loading | ||
53 | Layout.alignment: Qt.AlignLeft | 53 | Layout.alignment: Qt.AlignLeft | ||
54 | tooltip: i18n("Refresh") | 54 | tooltip: i18n("Refresh") | ||
55 | 55 | | |||
56 | onClicked: content.reload() | 56 | onClicked: WikipediaEngine.reloadWikipedia() | ||
57 | } | 57 | } | ||
58 | Item { | 58 | Item { | ||
59 | Layout.fillWidth: true | 59 | Layout.fillWidth: true | ||
60 | } | 60 | } | ||
61 | Button { | 61 | Button { | ||
62 | iconName: "filename-artist-amarok" | 62 | iconName: "filename-artist-amarok" | ||
63 | Layout.alignment: Qt.AlignRight | 63 | Layout.alignment: Qt.AlignRight | ||
64 | tooltip: i18n("Artist") | 64 | tooltip: i18n("Artist") | ||
Show All 28 Lines | 91 | WebEngineView { | |||
93 | 93 | | |||
94 | backgroundColor: "transparent" | 94 | backgroundColor: "transparent" | ||
95 | 95 | | |||
96 | Layout.fillWidth: true | 96 | Layout.fillWidth: true | ||
97 | Layout.fillHeight: true | 97 | Layout.fillHeight: true | ||
98 | Layout.alignment: Qt.AlignBottom | 98 | Layout.alignment: Qt.AlignBottom | ||
99 | 99 | | |||
100 | onNavigationRequested: { | 100 | onNavigationRequested: { | ||
101 | request.action = WebEngineNavigationRequest.IgnoreRequest; | 101 | if (request.navigationType == WebEngineNavigationRequest.LinkClickedNavigation) { | ||
102 | WikipediaEngine.url = request.url; | 102 | request.action = WebEngineNavigationRequest.IgnoreRequest | ||
103 | WikipediaEngine.url = request.url | ||||
104 | } | ||||
103 | } | 105 | } | ||
104 | 106 | | |||
105 | Connections { | 107 | Connections { | ||
106 | target: WikipediaEngine | 108 | target: WikipediaEngine | ||
107 | 109 | | |||
108 | onPageChanged: content.loadHtml(WikipediaEngine.page, WikipediaEngine.url) | 110 | onPageChanged: content.loadHtml(WikipediaEngine.page, WikipediaEngine.url) | ||
109 | } | 111 | } | ||
110 | 112 | | |||
111 | BusyIndicator { | 113 | BusyIndicator { | ||
112 | anchors.centerIn: parent | 114 | anchors.centerIn: parent | ||
113 | running: WikipediaEngine.busy | 115 | running: WikipediaEngine.busy | ||
114 | } | 116 | } | ||
115 | } | 117 | } | ||
116 | } | 118 | } | ||
117 | } | 119 | } |