diff --git a/touch/EpisodeItem.qml b/touch/EpisodeItem.qml index 8e28d15..8a8a55e 100644 --- a/touch/EpisodeItem.qml +++ b/touch/EpisodeItem.qml @@ -135,22 +135,22 @@ Item { Rectangle { anchors { top: parent.top - left: downloadIndicator.right + left: parent.left } height: Constants.layout.padding * pgst.scalef - width: (parent.width - downloadIndicator.width) * progress + width: parent.width * progress color: Constants.colors.download } Rectangle { anchors { bottom: parent.bottom - left: downloadIndicator.right + left: parent.left } height: Constants.layout.padding * pgst.scalef - width: (parent.width - downloadIndicator.width) * playbackProgress + width: parent.width * playbackProgress color: titleLabel.color opacity: episodeItem.isPlaying ? 1 : .2 } @@ -163,27 +163,17 @@ Item { right: parent.right } - Rectangle { + RectangleIndicator { id: downloadIndicator - - width: Constants.layout.padding * pgst.scalef * (downloadState == Constants.state.downloaded) - - Behavior on width { PropertyAnimation { } } - - anchors { - top: parent.top - bottom: parent.bottom - left: parent.left - } - + enabled: downloadState == Constants.state.downloaded color: titleLabel.color } Column { anchors { left: parent.left - leftMargin: 2 * Constants.layout.padding * pgst.scalef - right: parent.right + leftMargin: Constants.layout.padding * pgst.scalef + right: downloadIndicator.left rightMargin: Constants.layout.padding * pgst.scalef verticalCenter: parent.verticalCenter } diff --git a/touch/PodcastItem.qml b/touch/PodcastItem.qml index 91c15d5..3eb80fd 100644 --- a/touch/PodcastItem.qml +++ b/touch/PodcastItem.qml @@ -33,19 +33,6 @@ ButtonArea { right: parent.right } - Rectangle { - width: Constants.layout.padding * pgst.scalef * (newEpisodes > 0) - Behavior on width { PropertyAnimation { } } - - anchors { - top: cover.top - bottom: cover.bottom - left: parent.left - } - - color: Constants.colors.fresh - } - CoverArt { id: cover visible: !updating @@ -85,7 +72,7 @@ ButtonArea { PLabel { id: downloadsLabel anchors { - right: parent.right + right: newEpisodesIndicator.enabled ? newEpisodesIndicator.left : parent.right rightMargin: Constants.layout.padding * pgst.scalef verticalCenter: parent.verticalCenter } @@ -93,4 +80,10 @@ ButtonArea { text: downloaded ? downloaded : '' color: Constants.colors.text } + + RectangleIndicator { + id: newEpisodesIndicator + enabled: newEpisodes > 0 + color: Constants.colors.fresh + } } diff --git a/touch/RectangleIndicator.qml b/touch/RectangleIndicator.qml new file mode 100644 index 0000000..08adccd --- /dev/null +++ b/touch/RectangleIndicator.qml @@ -0,0 +1,36 @@ + +/** + * + * gPodder QML UI Reference Implementation + * Copyright (c) 2015, Thomas Perl + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + */ + +import QtQuick 2.0 + +import 'common/constants.js' as Constants + +Rectangle { + width: Constants.layout.padding * 2 * pgst.scalef * enabled + height: width + + Behavior on width { PropertyAnimation { } } + + anchors { + verticalCenter: parent.verticalCenter + right: parent.right + margins: Constants.layout.padding * 2 * pgst.scalef - width / 2 + } +}