From ad275cf1fbfe44e3c1504df961cd49e7564f23bf Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Mon, 16 Mar 2015 21:59:29 +0100 Subject: [PATCH] Improve section header --- touch/EpisodeQueryPage.qml | 6 +++++- touch/SectionHeader.qml | 20 +++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/touch/EpisodeQueryPage.qml b/touch/EpisodeQueryPage.qml index ebd8d01..bf8f423 100644 --- a/touch/EpisodeQueryPage.qml +++ b/touch/EpisodeQueryPage.qml @@ -44,6 +44,10 @@ SlidePage { title: 'Episodes' section.property: 'section' - section.delegate: SectionHeader { text: section } + section.delegate: SectionHeader { + text: section + color: episodeList.selectedIndex === -1 ? Constants.colors.secondaryHighlight : Constants.colors.text + opacity: episodeList.selectedIndex === -1 ? 1 : 0.2 + } } } diff --git a/touch/SectionHeader.qml b/touch/SectionHeader.qml index 55234f6..7ce75e0 100644 --- a/touch/SectionHeader.qml +++ b/touch/SectionHeader.qml @@ -24,15 +24,29 @@ import 'common/constants.js' as Constants Item { property alias text: pLabel.text + property alias color: pLabel.color height: 70 * pgst.scalef + width: parent.width + + Rectangle { + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + right: pLabel.left + margins: Constants.layout.padding * pgst.scalef + } + + color: pLabel.color + height: 1 * pgst.scalef + } PLabel { id: pLabel anchors { - left: parent.left - bottom: parent.bottom - margins: 10 * pgst.scalef + right: parent.right + verticalCenter: parent.verticalCenter + margins: Constants.layout.padding * pgst.scalef } color: Constants.colors.secondaryHighlight