From 8b132bf559003357bd89026207f1e83e3defaeb2 Mon Sep 17 00:00:00 2001 From: Jeena Date: Wed, 4 Feb 2015 19:14:27 +0100 Subject: [PATCH] removed html, added keyboard browsing --- Content.qml | 18 ++++++++++++++---- FeedMonkey.pro | 8 ++------ PostListItem.qml | 12 +++++++----- TheMenuBar.qml | 1 - main.qml | 6 ++++++ 5 files changed, 29 insertions(+), 16 deletions(-) diff --git a/Content.qml b/Content.qml index f0991dc..f43dae6 100644 --- a/Content.qml +++ b/Content.qml @@ -5,11 +5,21 @@ import TTRSS 1.0 ScrollView { property Post post + property int headLinefontSize: 23 + property int textfontSize: 14 style: ScrollViewStyle { transientScrollBars: true } + function scrollDown() { + flickableItem.contentY += 30 + } + + function scrollUp() { + + } + Item { height: column.height + 50 width: parent.parent.width @@ -39,7 +49,7 @@ ScrollView { } } color: "gray" - font.pointSize: 16 + font.pointSize: textfontSize textFormat: Text.PlainText wrapMode: Text.WrapAtWordBoundaryOrAnywhere width: parent.width @@ -48,7 +58,7 @@ ScrollView { Label { text: post ? post.title : "" - font.pointSize: 30 + font.pointSize: headLinefontSize wrapMode: Text.WrapAtWordBoundaryOrAnywhere width: parent.width renderType: Text.NativeRendering @@ -62,7 +72,7 @@ ScrollView { Label { text: post ? post.date.toLocaleString(Qt.locale(), Locale.LongFormat) : "" color: "gray" - font.pointSize: 16 + font.pointSize: textfontSize textFormat: Text.PlainText wrapMode: Text.WrapAtWordBoundaryOrAnywhere width: parent.width @@ -98,7 +108,7 @@ ScrollView { id: contentLabel text: post ? "" + post.content : "" textFormat: Text.RichText - font.pointSize: 16 + font.pointSize: textfontSize wrapMode: Text.WrapAtWordBoundaryOrAnywhere width: parent.width renderType: Text.NativeRendering diff --git a/FeedMonkey.pro b/FeedMonkey.pro index 79527ba..eaec577 100644 --- a/FeedMonkey.pro +++ b/FeedMonkey.pro @@ -7,8 +7,7 @@ SOURCES += main.cpp \ tinytinyrsslogin.cpp \ post.cpp -RESOURCES += qml.qrc \ - html.qrc +RESOURCES += qml.qrc # Needed for bringing browser from background to foreground using QDesktopServices: http://bugreports.qt-project.org/browse/QTBUG-8336 TARGET.CAPABILITY += SwEvent @@ -19,10 +18,7 @@ QML_IMPORT_PATH = # Default rules for deployment. include(deployment.pri) -OTHER_FILES += \ - content.html \ - content.css \ - content.js +OTHER_FILES += HEADERS += \ tinytinyrss.h \ diff --git a/PostListItem.qml b/PostListItem.qml index 6d100c4..753e311 100644 --- a/PostListItem.qml +++ b/PostListItem.qml @@ -2,8 +2,10 @@ import QtQuick 2.0 import QtQuick.Controls 1.3 Component { - id: component Item { + property int headLinefontSize: 14 + property int smallfontSize: 10 + id: item height: column.height + 20 width: parent.parent.parent.width @@ -28,7 +30,7 @@ Component { spacing: 10 Label { text: feedTitle - font.pointSize: 12 + font.pointSize: smallfontSize textFormat: Text.PlainText color: "gray" wrapMode: Text.WrapAtWordBoundaryOrAnywhere @@ -36,7 +38,7 @@ Component { } Label { text: date.toLocaleString(Qt.locale(), Locale.ShortFormat) - font.pointSize: 12 + font.pointSize: smallfontSize textFormat: Text.PlainText color: "gray" wrapMode: Text.WrapAtWordBoundaryOrAnywhere @@ -45,7 +47,7 @@ Component { } Label { text: title - font.pointSize: 16 + font.pointSize: headLinefontSize textFormat: Text.PlainText wrapMode: Text.WrapAtWordBoundaryOrAnywhere renderType: Text.NativeRendering @@ -53,7 +55,7 @@ Component { } Label { text: excerpt - font.pointSize: 12 + font.pointSize: smallfontSize textFormat: Text.RichText color: "gray" wrapMode: Text.WrapAtWordBoundaryOrAnywhere diff --git a/TheMenuBar.qml b/TheMenuBar.qml index 3fe7cba..24d8549 100644 --- a/TheMenuBar.qml +++ b/TheMenuBar.qml @@ -2,7 +2,6 @@ import QtQuick.Controls 1.2 import TTRSS 1.0 MenuBar { - property bool loggedIn: false property Server server property Sidebar sidebar diff --git a/main.qml b/main.qml index e7698ab..972d249 100644 --- a/main.qml +++ b/main.qml @@ -30,6 +30,7 @@ ApplicationWindow { anchors.fill: parent orientation: Qt.Horizontal visible: serverLogin.loggedIn() + focus: true Sidebar { id: sidebar @@ -46,6 +47,11 @@ ApplicationWindow { Layout.minimumWidth: 200 implicitWidth: 624 } + + Keys.onRightPressed: sidebar.next() + Keys.onLeftPressed: sidebar.previous() + Keys.onDownPressed: content.scrollDown() + Keys.onUpPressed: content.scrollUp() } Login {