added a proper header (for now purple)

This commit is contained in:
Hauke Schade 2012-11-21 17:23:10 +01:00
parent cc796f57f2
commit 3e084f9936
4 changed files with 60 additions and 45 deletions

View file

@ -15,7 +15,6 @@ import com.nokia.meego 1.0
Page {
id: categoriesPage
tools: categoriesTools
anchors.margins: rootWindow.pageMargin
property int numStatusUpdates
property bool loading: false
@ -24,28 +23,10 @@ Page {
id: categoriesModel
}
Component {
id: listHeading
Rectangle {
width: parent.width
height: 60
radius: 10
color: "orange"
Text {
anchors {
horizontalCenter: parent.horizontalCenter
verticalCenter: parent.verticalCenter
}
text: qsTr("Tiny Tiny RSS Reader")
font.weight: Font.Bold
font.pixelSize: 26
}
}
}
ListView {
id: listView
anchors.fill: parent
anchors.margins: constant.paddingLarge
anchors{ top: pageHeader.bottom; bottom: parent.bottom; left: parent.left; right: parent.right }
model: categoriesModel
@ -215,6 +196,11 @@ Page {
}
}
PageHeader {
id: pageHeader
text: qsTr("Tiny Tiny RSS Reader")
}
ToolBarLayout {
id: categoriesTools

View file

@ -20,37 +20,15 @@ Page {
property bool loading: false
property string pageTitle: ""
anchors.margins: rootWindow.pageMargin
ListModel {
id: feedsModel
}
Component {
id: listHeading
Rectangle {
width: parent.width
height: 60
radius: 10
color: "orange"
visible: pageTitle !== ""
Text {
anchors {
horizontalCenter: parent.horizontalCenter
verticalCenter: parent.verticalCenter
}
text: pageTitle
font.weight: Font.Bold
font.pixelSize: 26
}
}
}
ListView {
id: listView
anchors.fill: parent
anchors.margins: constant.paddingLarge
anchors{ top: pageHeader.bottom; bottom: parent.bottom; left: parent.left; right: parent.right }
model: feedsModel
header: listHeading
delegate: Item {
id: listItem
@ -211,6 +189,11 @@ Page {
}
}
PageHeader {
id: pageHeader
text: pageTitle
}
ToolBarLayout {
id: feedsTools

46
qml/ttrss/PageHeader.qml Normal file
View file

@ -0,0 +1,46 @@
//Copyright Hauke Schade, 2012
//
//This file is part of TTRss.
//
//TTRss is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the
//Free Software Foundation, either version 2 of the License, or (at your option) any later version.
//TTRss is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//You should have received a copy of the GNU General Public License along with TTRss (on a Maemo/Meego system there is a copy
//in /usr/share/common-licenses. If not, see http://www.gnu.org/licenses/.
import QtQuick 1.1
import com.nokia.meego 1.0
import com.nokia.extras 1.1
Item{
id: root
property string text
height: constant.headerHeight
width: parent.width
visible: text !== ""
Image{
id: background
anchors.fill: parent
source: "resources/color10-meegotouch-view-header.png"
sourceSize.width: parent.width
sourceSize.height: parent.height
}
Text{
id: mainText
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
right: parent.right
margins: constant.paddingXLarge
}
font.pixelSize: constant.fontSizeXLarge
color: "white"
elide: Text.ElideRight
text: root.text
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B