removed html, added keyboard browsing
This commit is contained in:
parent
6968d8ed0e
commit
8b132bf559
5 changed files with 29 additions and 16 deletions
18
Content.qml
18
Content.qml
|
@ -5,11 +5,21 @@ import TTRSS 1.0
|
||||||
|
|
||||||
ScrollView {
|
ScrollView {
|
||||||
property Post post
|
property Post post
|
||||||
|
property int headLinefontSize: 23
|
||||||
|
property int textfontSize: 14
|
||||||
|
|
||||||
style: ScrollViewStyle {
|
style: ScrollViewStyle {
|
||||||
transientScrollBars: true
|
transientScrollBars: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function scrollDown() {
|
||||||
|
flickableItem.contentY += 30
|
||||||
|
}
|
||||||
|
|
||||||
|
function scrollUp() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
height: column.height + 50
|
height: column.height + 50
|
||||||
width: parent.parent.width
|
width: parent.parent.width
|
||||||
|
@ -39,7 +49,7 @@ ScrollView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
color: "gray"
|
color: "gray"
|
||||||
font.pointSize: 16
|
font.pointSize: textfontSize
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
@ -48,7 +58,7 @@ ScrollView {
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: post ? post.title : ""
|
text: post ? post.title : ""
|
||||||
font.pointSize: 30
|
font.pointSize: headLinefontSize
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
width: parent.width
|
width: parent.width
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
|
@ -62,7 +72,7 @@ ScrollView {
|
||||||
Label {
|
Label {
|
||||||
text: post ? post.date.toLocaleString(Qt.locale(), Locale.LongFormat) : ""
|
text: post ? post.date.toLocaleString(Qt.locale(), Locale.LongFormat) : ""
|
||||||
color: "gray"
|
color: "gray"
|
||||||
font.pointSize: 16
|
font.pointSize: textfontSize
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
@ -98,7 +108,7 @@ ScrollView {
|
||||||
id: contentLabel
|
id: contentLabel
|
||||||
text: post ? "<style>a { color: #555; }</style>" + post.content : ""
|
text: post ? "<style>a { color: #555; }</style>" + post.content : ""
|
||||||
textFormat: Text.RichText
|
textFormat: Text.RichText
|
||||||
font.pointSize: 16
|
font.pointSize: textfontSize
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
width: parent.width
|
width: parent.width
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
|
|
|
@ -7,8 +7,7 @@ SOURCES += main.cpp \
|
||||||
tinytinyrsslogin.cpp \
|
tinytinyrsslogin.cpp \
|
||||||
post.cpp
|
post.cpp
|
||||||
|
|
||||||
RESOURCES += qml.qrc \
|
RESOURCES += qml.qrc
|
||||||
html.qrc
|
|
||||||
|
|
||||||
# Needed for bringing browser from background to foreground using QDesktopServices: http://bugreports.qt-project.org/browse/QTBUG-8336
|
# Needed for bringing browser from background to foreground using QDesktopServices: http://bugreports.qt-project.org/browse/QTBUG-8336
|
||||||
TARGET.CAPABILITY += SwEvent
|
TARGET.CAPABILITY += SwEvent
|
||||||
|
@ -19,10 +18,7 @@ QML_IMPORT_PATH =
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
include(deployment.pri)
|
include(deployment.pri)
|
||||||
|
|
||||||
OTHER_FILES += \
|
OTHER_FILES +=
|
||||||
content.html \
|
|
||||||
content.css \
|
|
||||||
content.js
|
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
tinytinyrss.h \
|
tinytinyrss.h \
|
||||||
|
|
|
@ -2,8 +2,10 @@ import QtQuick 2.0
|
||||||
import QtQuick.Controls 1.3
|
import QtQuick.Controls 1.3
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: component
|
|
||||||
Item {
|
Item {
|
||||||
|
property int headLinefontSize: 14
|
||||||
|
property int smallfontSize: 10
|
||||||
|
|
||||||
id: item
|
id: item
|
||||||
height: column.height + 20
|
height: column.height + 20
|
||||||
width: parent.parent.parent.width
|
width: parent.parent.parent.width
|
||||||
|
@ -28,7 +30,7 @@ Component {
|
||||||
spacing: 10
|
spacing: 10
|
||||||
Label {
|
Label {
|
||||||
text: feedTitle
|
text: feedTitle
|
||||||
font.pointSize: 12
|
font.pointSize: smallfontSize
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
color: "gray"
|
color: "gray"
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
|
@ -36,7 +38,7 @@ Component {
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
text: date.toLocaleString(Qt.locale(), Locale.ShortFormat)
|
text: date.toLocaleString(Qt.locale(), Locale.ShortFormat)
|
||||||
font.pointSize: 12
|
font.pointSize: smallfontSize
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
color: "gray"
|
color: "gray"
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
|
@ -45,7 +47,7 @@ Component {
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
text: title
|
text: title
|
||||||
font.pointSize: 16
|
font.pointSize: headLinefontSize
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
|
@ -53,7 +55,7 @@ Component {
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
text: excerpt
|
text: excerpt
|
||||||
font.pointSize: 12
|
font.pointSize: smallfontSize
|
||||||
textFormat: Text.RichText
|
textFormat: Text.RichText
|
||||||
color: "gray"
|
color: "gray"
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
|
|
|
@ -2,7 +2,6 @@ import QtQuick.Controls 1.2
|
||||||
import TTRSS 1.0
|
import TTRSS 1.0
|
||||||
|
|
||||||
MenuBar {
|
MenuBar {
|
||||||
|
|
||||||
property bool loggedIn: false
|
property bool loggedIn: false
|
||||||
property Server server
|
property Server server
|
||||||
property Sidebar sidebar
|
property Sidebar sidebar
|
||||||
|
|
6
main.qml
6
main.qml
|
@ -30,6 +30,7 @@ ApplicationWindow {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
orientation: Qt.Horizontal
|
orientation: Qt.Horizontal
|
||||||
visible: serverLogin.loggedIn()
|
visible: serverLogin.loggedIn()
|
||||||
|
focus: true
|
||||||
|
|
||||||
Sidebar {
|
Sidebar {
|
||||||
id: sidebar
|
id: sidebar
|
||||||
|
@ -46,6 +47,11 @@ ApplicationWindow {
|
||||||
Layout.minimumWidth: 200
|
Layout.minimumWidth: 200
|
||||||
implicitWidth: 624
|
implicitWidth: 624
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Keys.onRightPressed: sidebar.next()
|
||||||
|
Keys.onLeftPressed: sidebar.previous()
|
||||||
|
Keys.onDownPressed: content.scrollDown()
|
||||||
|
Keys.onUpPressed: content.scrollUp()
|
||||||
}
|
}
|
||||||
|
|
||||||
Login {
|
Login {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue