forked from jeena/FeedTheMonkey
moved sidebar to own file
This commit is contained in:
parent
cc59671ff4
commit
ee6ba89ab4
7 changed files with 90 additions and 46 deletions
44
Content.qml
44
Content.qml
|
@ -1,18 +1,42 @@
|
|||
import QtWebKit 3.0
|
||||
import QtWebKit.experimental 1.0
|
||||
import QtQuick.Controls 1.3
|
||||
import QtQuick.Layouts 1.1
|
||||
import TTRSS 1.0
|
||||
|
||||
WebView {
|
||||
url: "content.html"
|
||||
ScrollView {
|
||||
id: content
|
||||
property Post post
|
||||
Layout.minimumWidth: 400
|
||||
|
||||
// Enable communication between QML and WebKit
|
||||
experimental.preferences.navigatorQtObjectEnabled: true;
|
||||
WebView {
|
||||
id: webView
|
||||
url: "content.html"
|
||||
|
||||
onNavigationRequested: {
|
||||
if (request.navigationType != WebView.LinkClickedNavigation) {
|
||||
request.action = WebView.AcceptRequest;
|
||||
} else {
|
||||
request.action = WebView.IgnoreRequest;
|
||||
Qt.openUrlExternally(request.url);
|
||||
property Post post: content.post
|
||||
|
||||
function setPost() {
|
||||
experimental.evaluateJavaScript("setArticle(" + post.jsonString + ")")
|
||||
}
|
||||
|
||||
// Enable communication between QML and WebKit
|
||||
experimental.preferences.navigatorQtObjectEnabled: true;
|
||||
|
||||
onNavigationRequested: {
|
||||
if (request.navigationType != WebView.LinkClickedNavigation) {
|
||||
request.action = WebView.AcceptRequest;
|
||||
} else {
|
||||
request.action = WebView.IgnoreRequest;
|
||||
Qt.openUrlExternally(request.url);
|
||||
}
|
||||
}
|
||||
|
||||
onLoadingChanged: {
|
||||
setPost()
|
||||
}
|
||||
|
||||
onPostChanged: {
|
||||
setPost();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue