diff --git a/PostListItem.qml b/PostListItem.qml index 63b3aed..4058c25 100644 --- a/PostListItem.qml +++ b/PostListItem.qml @@ -1,58 +1,69 @@ import QtQuick 2.0 -Item { - property ListView listView +Component { + id: component + Item { + id: item + height: column.height + 20 + width: parent.parent.parent.width - height: column.height + 10 - width: parent.parent.parent.width - - Rectangle { - anchors.fill: parent - anchors.leftMargin: 10 - anchors.rightMargin: 10 - anchors.topMargin: 5 - anchors.bottomMargin: 5 - color: "transparent" - - Column { - id: column - width: parent.width - - Row { - spacing: 10 - Text { - text: feedTitle - font.pointSize: 9 - color: "gray" - wrapMode: Text.Wrap - } - Text { - text: date.toLocaleString(null) - font.pointSize: 9 - color: "gray" - wrapMode: Text.Wrap - } + Rectangle { + property variant colors: ["#AAFFFFFF", "transparent"] + anchors.fill: parent + color: { + if(item.ListView.isCurrentItem) return "transparent" + return colors[index % 2] } - Text { - text: title - font.pointSize: 12 - wrapMode: Text.Wrap - width: parent.width - } - Text { - text: excerpt - font.pointSize: 9 - color: "gray" - wrapMode: Text.Wrap - width: parent.width + + Rectangle { + anchors.fill: parent + anchors.leftMargin: 15 + anchors.rightMargin: 15 + anchors.topMargin: 10 + anchors.bottomMargin: 10 + color: "transparent" + + Column { + id: column + width: parent.width + + Row { + spacing: 10 + Text { + text: feedTitle + font.pointSize: 12 + color: "gray" + wrapMode: Text.Wrap + } + Text { + text: date.toLocaleString(null) + font.pointSize: 12 + color: "gray" + wrapMode: Text.Wrap + } + } + Text { + text: title + font.pointSize: 16 + wrapMode: Text.Wrap + width: parent.width + } + Text { + text: excerpt + font.pointSize: 12 + color: "gray" + wrapMode: Text.Wrap + width: parent.width + } + } } } - } - MouseArea { - anchors.fill: parent - onClicked: { - parent.parent.parent.currentIndex = index + MouseArea { + anchors.fill: parent + onClicked: { + parent.parent.parent.currentIndex = index + } } } } diff --git a/Sidebar.qml b/Sidebar.qml index aab8072..09e3435 100644 --- a/Sidebar.qml +++ b/Sidebar.qml @@ -31,13 +31,17 @@ ScrollView { spacing: 1 model: item.server.posts - delegate: Component { - PostListItem {} - } + delegate: PostListItem {} - highlight: Rectangle { - color: "lightblue" - opacity: 0.5 + highlightFollowsCurrentItem: false + highlight: Component { + Rectangle { + width: listView.currentItem.width + height: listView.currentItem.height + color: "lightblue" + opacity: 0.5 + y: listView.currentItem.y + } } onCurrentItemChanged: { diff --git a/content.css b/content.css index 1e566d5..f177d11 100644 --- a/content.css +++ b/content.css @@ -1,37 +1,43 @@ body { - font-family: "Ubuntu", "Lucida Grande", "Tahoma", sans-serif; - padding: 1em 2em 1em 2em; - background: transpatent; -} -body.darwin { - font-family: "LucidaGrande", sans-serif; + font-family: sans-serif; + padding: 1em 1.5em; + font-weight: lighter; + background: #eee; } + h1 { - font-weight: normal; + font-weight: lighter; margin: 0; padding: 0; } -header { - margin-bottom: 1em; - border-bottom: 1px solid #aaa; - padding-bottom: 1em; + +#date:not(:empty) { + border-bottom: 1px solid #aaa; + margin-bottom: 1em; + padding-bottom: 1em; + display: block; } + .starred:after { content: "*"; } + header p { color: #aaa; margin: 0; padding: 0 } + a { - color: #772953; + color: #333; text-decoration: none; } + img { max-width: 100%; height: auto; } + article { line-height: 1.6; } diff --git a/main.qml b/main.qml index 7383a73..2ac4877 100644 --- a/main.qml +++ b/main.qml @@ -24,6 +24,7 @@ ApplicationWindow { SplitView { anchors.fill: parent orientation: Qt.Horizontal + visible: serverLogin.loggedIn() Sidebar { id: sidebar @@ -41,7 +42,7 @@ ApplicationWindow { Login { id: login anchors.fill: parent - visible: true + visible: !serverLogin.loggedIn() function login() { serverLogin.login(serverUrl, userName, password)