From c25457e3ad621249e02bd19e902899dda9776a84 Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Wed, 21 May 2014 17:37:42 +0200 Subject: [PATCH] Fix paddings, items sizes and colors --- qml/DirectoryItem.qml | 6 +++--- qml/EpisodeDetail.qml | 3 +++ qml/EpisodeItem.qml | 18 +++++++++++++----- qml/IconContextMenu.qml | 2 +- qml/Main.qml | 2 -- qml/PodcastItem.qml | 13 ++++++++----- 6 files changed, 28 insertions(+), 16 deletions(-) diff --git a/qml/DirectoryItem.qml b/qml/DirectoryItem.qml index e57a053..6ce93be 100644 --- a/qml/DirectoryItem.qml +++ b/qml/DirectoryItem.qml @@ -24,7 +24,7 @@ import Sailfish.Silica 1.0 ListItem { id: directoryItem - contentHeight: Theme.itemSizeMedium + Theme.paddingSmall * 2 + contentHeight: Theme.itemSizeMedium height: contentHeight anchors { @@ -46,8 +46,8 @@ ListItem { sourceSize.width: width sourceSize.height: height - width: Theme.itemSizeMedium - height: Theme.itemSizeMedium + width: Theme.iconSizeMedium + height: Theme.iconSizeMedium source: scaled_logo_url } diff --git a/qml/EpisodeDetail.qml b/qml/EpisodeDetail.qml index 425618c..7fa7434 100644 --- a/qml/EpisodeDetail.qml +++ b/qml/EpisodeDetail.qml @@ -175,6 +175,9 @@ Page { text: 'Shownotes' color: Theme.highlightColor + // Only show if we also have a chapters list + visible: chaptersExpander.visible + anchors { left: parent.left leftMargin: Theme.paddingMedium diff --git a/qml/EpisodeItem.qml b/qml/EpisodeItem.qml index 9c3405e..c93166a 100644 --- a/qml/EpisodeItem.qml +++ b/qml/EpisodeItem.qml @@ -118,7 +118,7 @@ ListItem { } } - contentHeight: 80 * pgst.scalef + contentHeight: Theme.itemSizeSmall anchors { left: parent.left @@ -132,14 +132,20 @@ ListItem { left: parent.left right: downloadStatusIcon.left verticalCenter: parent.verticalCenter - margins: 30 * pgst.scalef + margins: Theme.paddingMedium } truncationMode: TruncationMode.Fade text: title // need to set opacity via color, as truncationMode overrides opacity - color: Theme.rgba(isNew ? Theme.highlightColor : Theme.primaryColor, opacity) + color: { + if (episodeItem.highlighted) { + return Theme.highlightColor + } else { + Theme.rgba(isNew ? Theme.highlightColor : Theme.primaryColor, opacity) + } + } opacity: { switch (downloadState) { @@ -156,14 +162,16 @@ ListItem { anchors { right: parent.right verticalCenter: parent.verticalCenter - rightMargin: (20 * pgst.scalef) * (text != '') + rightMargin: text ? Theme.paddingMedium : 0 } - font.pixelSize: episodeItem.contentHeight * 0.4 + font.pixelSize: Theme.fontSizeLarge font.bold: true opacity: titleItem.opacity + color: titleItem.color + text: { switch (downloadState) { case Constants.state.normal: return ''; diff --git a/qml/IconContextMenu.qml b/qml/IconContextMenu.qml index faa560f..92c25fd 100644 --- a/qml/IconContextMenu.qml +++ b/qml/IconContextMenu.qml @@ -25,7 +25,7 @@ ContextMenu { default property alias children: container.children Item { - height: Theme.itemSizeLarge + height: Theme.itemSizeMedium width: parent.width Row { id: container diff --git a/qml/Main.qml b/qml/Main.qml index 6493826..4ede10a 100644 --- a/qml/Main.qml +++ b/qml/Main.qml @@ -27,8 +27,6 @@ PodcastsPage { id: pgst property bool ready: false - property real scalef: width / 480 - property var playerPage: undefined property var cover: CoverContainer { } diff --git a/qml/PodcastItem.qml b/qml/PodcastItem.qml index 5b8ad8a..894fe1d 100644 --- a/qml/PodcastItem.qml +++ b/qml/PodcastItem.qml @@ -76,7 +76,8 @@ ListItem { } } - contentHeight: 100 * pgst.scalef + contentHeight: Theme.itemSizeMedium + anchors { left: parent.left right: parent.right @@ -88,15 +89,15 @@ ListItem { anchors { left: parent.left - leftMargin: 10 * pgst.scalef + leftMargin: Theme.paddingMedium verticalCenter: parent.verticalCenter } sourceSize.width: width sourceSize.height: height - width: 80 * pgst.scalef - height: 80 * pgst.scalef + width: Theme.iconSizeMedium + height: Theme.iconSizeMedium source: coverart } @@ -124,6 +125,7 @@ ListItem { } Label { + id: titleLabel anchors { left: cover.right leftMargin: Theme.paddingMedium @@ -134,7 +136,7 @@ ListItem { truncationMode: TruncationMode.Fade text: title - color: newEpisodes ? Theme.highlightColor : Theme.primaryColor + color: (newEpisodes || podcastItem.highlighted) ? Theme.highlightColor : Theme.primaryColor } Label { @@ -145,6 +147,7 @@ ListItem { verticalCenter: parent.verticalCenter } + color: titleLabel.color text: downloaded ? downloaded : '' } }