Skip to content

Commit

Permalink
Add cover background
Browse files Browse the repository at this point in the history
 * Mega nice!!!
  • Loading branch information
nagua committed Sep 14, 2016
1 parent 0a8b6ab commit 52ed67f
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 100 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ Makefile*

# QtCtreator CMake
CMakeLists.txt.user

# RPM
*.spec
4 changes: 2 additions & 2 deletions Taskwarrior.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ SOURCES += src/Taskwarrior.cpp \
src/taskexecuter.cpp

OTHER_FILES += qml/Taskwarrior.qml \
qml/cover/CoverPage.qml \
rpm/Taskwarrior.changes.in \
rpm/Taskwarrior.spec \
rpm/Taskwarrior.yaml \
Expand Down Expand Up @@ -46,5 +45,6 @@ DISTFILES += \
qml/lib/storage.js \
qml/lib/utils.js \
qml/pages/DetailView.qml \
qml/pages/DetailTask.qml
qml/pages/DetailTask.qml \
qml/cover/CoverPage.qml

69 changes: 43 additions & 26 deletions qml/cover/CoverPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,40 +33,57 @@ import Sailfish.Silica 1.0

CoverBackground {

Label {
id: header
text: "Tasks"
y: Theme.paddingMedium
anchors.horizontalCenter: parent.horizontalCenter
//width: parent.width
BackgroundItem {
anchors.fill: parent

Image {
anchors.fill: parent
fillMode: Image.PreserveAspectFit
source: "../images/taskwarrior_head.png"
opacity: 0.2
horizontalAlignment: Image.AlignHCenter
verticalAlignment: Image.AlignVCenter
}
}

ListView {
id: taskListView
model: taskWindow.coverModel
property real itemHeight: Theme.iconSizeSmall + Theme.paddingSmall
Rectangle {
anchors.fill: parent
anchors.margins: Theme.paddingSmall
color: "transparent"

anchors {
top: header.bottom
topMargin: Theme.paddingSmall
Label {
id: header
text: "Tasks"
anchors.horizontalCenter: parent.horizontalCenter
}
clip: true
width: parent.width
height: 6*itemHeight

delegate: Label {
ListView {
id: taskListView
model: taskWindow.coverModel
property real itemHeight: Theme.iconSizeSmall + Theme.paddingSmall

anchors {
leftMargin: Theme.paddingLarge
rightMargin: Theme.paddingLarge
left: parent.left
right: parent.right
top: header.bottom
topMargin: Theme.paddingSmall
}
height: taskListView.itemHeight
text: model.description
font.pixelSize: Theme.fontSizeSmall
truncationMode: TruncationMode.Fade
}
clip: true
width: parent.width
height: 6*itemHeight

delegate: Label {
anchors {
leftMargin: Theme.paddingLarge
rightMargin: Theme.paddingLarge
left: parent.left
right: parent.right
}
height: taskListView.itemHeight
text: model.description
font.pixelSize: Theme.fontSizeSmall
truncationMode: TruncationMode.Fade
}

}
}


Expand Down
Binary file added qml/images/taskwarrior_head.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions qml/pages/Viewlist.qml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ Page {
anchors.verticalCenter: parent.verticalCenter
x: Theme.horizontalPageMargin
}

menu: model.lid >= 0 ? context : undefined

ContextMenu {
id: context

Expand Down
72 changes: 0 additions & 72 deletions rpm/Taskwarrior.spec

This file was deleted.

87 changes: 87 additions & 0 deletions taskwarrior_head.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 52ed67f

Please sign in to comment.