Use rectangle indicator instead of left-bar indicator
This commit is contained in:
parent
d4ca82e6d3
commit
953905ba3b
3 changed files with 51 additions and 32 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
36
touch/RectangleIndicator.qml
Normal file
36
touch/RectangleIndicator.qml
Normal file
|
@ -0,0 +1,36 @@
|
|||
|
||||
/**
|
||||
*
|
||||
* gPodder QML UI Reference Implementation
|
||||
* Copyright (c) 2015, Thomas Perl <m@thp.io>
|
||||
*
|
||||
* 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
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue