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 {
|
Rectangle {
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
left: downloadIndicator.right
|
left: parent.left
|
||||||
}
|
}
|
||||||
|
|
||||||
height: Constants.layout.padding * pgst.scalef
|
height: Constants.layout.padding * pgst.scalef
|
||||||
width: (parent.width - downloadIndicator.width) * progress
|
width: parent.width * progress
|
||||||
color: Constants.colors.download
|
color: Constants.colors.download
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors {
|
anchors {
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
left: downloadIndicator.right
|
left: parent.left
|
||||||
}
|
}
|
||||||
|
|
||||||
height: Constants.layout.padding * pgst.scalef
|
height: Constants.layout.padding * pgst.scalef
|
||||||
width: (parent.width - downloadIndicator.width) * playbackProgress
|
width: parent.width * playbackProgress
|
||||||
color: titleLabel.color
|
color: titleLabel.color
|
||||||
opacity: episodeItem.isPlaying ? 1 : .2
|
opacity: episodeItem.isPlaying ? 1 : .2
|
||||||
}
|
}
|
||||||
|
@ -163,27 +163,17 @@ Item {
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
RectangleIndicator {
|
||||||
id: downloadIndicator
|
id: downloadIndicator
|
||||||
|
enabled: downloadState == Constants.state.downloaded
|
||||||
width: Constants.layout.padding * pgst.scalef * (downloadState == Constants.state.downloaded)
|
|
||||||
|
|
||||||
Behavior on width { PropertyAnimation { } }
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
bottom: parent.bottom
|
|
||||||
left: parent.left
|
|
||||||
}
|
|
||||||
|
|
||||||
color: titleLabel.color
|
color: titleLabel.color
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
leftMargin: 2 * Constants.layout.padding * pgst.scalef
|
leftMargin: Constants.layout.padding * pgst.scalef
|
||||||
right: parent.right
|
right: downloadIndicator.left
|
||||||
rightMargin: Constants.layout.padding * pgst.scalef
|
rightMargin: Constants.layout.padding * pgst.scalef
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,19 +33,6 @@ ButtonArea {
|
||||||
right: parent.right
|
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 {
|
CoverArt {
|
||||||
id: cover
|
id: cover
|
||||||
visible: !updating
|
visible: !updating
|
||||||
|
@ -85,7 +72,7 @@ ButtonArea {
|
||||||
PLabel {
|
PLabel {
|
||||||
id: downloadsLabel
|
id: downloadsLabel
|
||||||
anchors {
|
anchors {
|
||||||
right: parent.right
|
right: newEpisodesIndicator.enabled ? newEpisodesIndicator.left : parent.right
|
||||||
rightMargin: Constants.layout.padding * pgst.scalef
|
rightMargin: Constants.layout.padding * pgst.scalef
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
@ -93,4 +80,10 @@ ButtonArea {
|
||||||
text: downloaded ? downloaded : ''
|
text: downloaded ? downloaded : ''
|
||||||
color: Constants.colors.text
|
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