Skip to content

Commit

Permalink
Merge pull request #120 from Keeper-of-the-Keys/episode-art-list
Browse files Browse the repository at this point in the history
Episode art list
  • Loading branch information
Keeper-of-the-Keys authored Apr 9, 2020
2 parents 9b8bbdf + 4090920 commit 4f9e218
Show file tree
Hide file tree
Showing 20 changed files with 399 additions and 312 deletions.
2 changes: 1 addition & 1 deletion gpodder-core
1 change: 1 addition & 0 deletions gpodder-sailfish.pro
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ TRANSLATIONS += \
translations/harbour-org.gpodder.sailfish-zh_CN.ts \
translations/harbour-org.gpodder.sailfish-sv.ts \
translations/harbour-org.gpodder.sailfish-pl.ts \
translations/harbour-org.gpodder.sailfish-ru.ts \
translations/harbour-org.gpodder.sailfish.ts

TRANSLATION_SOURCES += /$$_PRO_FILE_PWD_/gpodder-ui-qml/common/
Expand Down
2 changes: 1 addition & 1 deletion gpodder-ui-qml
Submodule gpodder-ui-qml updated 3 files
+6 −2 common/GPodderPlayback.qml
+13 −3 main.py
+1 −1 makefile
2 changes: 1 addition & 1 deletion podcastparser
46 changes: 46 additions & 0 deletions qml/ArtArea.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import QtQuick 2.0
import Sailfish.Silica 1.0

Item {
Image {
id: episodeArtArea
visible: episode_art || cover_art ? true : false

anchors {
left: parent.left
top: parent.top
}
height: episode_art ? parent.height * 0.9 : parent.height
width: episode_art ? parent.width * 0.9 : parent.width

source: episode_art ? episode_art : cover_art
}
Image {
id: podcastArtArea
visible: episode_art && cover_art ? true : false

anchors {
right: parent.right
bottom: parent.bottom
}
opacity: 0.75
height: parent.height * 0.4
width: parent.width * 0.4
source: cover_art
}
Rectangle {
anchors.fill: parent
visible: !cover_art && !episode_art ? true : false
color: Theme.rgba(Theme.highlightColor, 0.5)

clip: true

Label {
anchors.centerIn: parent

font.pixelSize: parent.height * 0.8
text: title_char
color: Theme.highlightColor
}
}
}
14 changes: 9 additions & 5 deletions qml/CoverContainer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import QtQuick 2.0
import Sailfish.Silica 1.0
import QtMultimedia 5.0

import 'common/util.js' as Util

Expand All @@ -41,11 +40,16 @@ CoverBackground {

PlayerCover {
id: playerCover
visible: cover_player && player.episode != 0 && (player.playbackState == MediaPlayer.PlayingState || player.playbackState == MediaPlayer.PausedState)
width: parent.width
height: width
property string cover_art: player.cover_art
property string episode_art: player.episode_art
property string title_char: player.podcast_title[0]
visible: cover_player && player.episode !== 0 && (player.isPlaying || player.isPaused)
}

CoverActionList {
enabled: cover_player && player.episode != 0 && player.playbackState == MediaPlayer.PlayingState
enabled: cover_player && player.episode !== 0 && player.isPlaying

CoverAction {
iconSource: 'image://theme/icon-cover-pause'
Expand All @@ -58,7 +62,7 @@ CoverBackground {
}

CoverActionList {
enabled: cover_player && player.episode != 0 && player.playbackState == MediaPlayer.PausedState
enabled: cover_player && player.episode !== 0 && player.isPaused

CoverAction {
iconSource: 'image://theme/icon-cover-play'
Expand All @@ -76,7 +80,7 @@ CoverBackground {
}

CoverActionList {
enabled: player.episode == 0 || (player.episode != 0 && player.playbackState == MediaPlayer.StoppedState)
enabled: player.episode === 0 || (player.episode !== 0 && player.isStopped)

CoverAction {
iconSource: 'image://theme/icon-cover-sync'
Expand Down
14 changes: 14 additions & 0 deletions qml/EpisodeDetail.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ Page {
property string link
property bool ready: false
property var chapters: ([])
property string episode_art
property string cover_art
property string title_char

onStatusChanged: pgst.handlePageStatusChange(status)

Expand Down Expand Up @@ -81,6 +84,17 @@ Page {
title: qsTr("Episode details")
}

CustomExpander {
width: parent.width
expandedHeight: width

ArtArea {
id: coverImage
width: parent.width
height: width
}
}

Label {
text: detailPage.title
wrapMode: Text.WordWrap
Expand Down
21 changes: 18 additions & 3 deletions qml/EpisodeItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ ListItem {
icon.source: 'image://theme/icon-m-about'
onClicked: {
episodeItem.closeMenu();
pgst.loadPage('EpisodeDetail.qml', {episode_id: id, title: title});
pgst.loadPage('EpisodeDetail.qml',
{episode_id: id,
title: title,
cover_art: cover_art,
episode_art: episode_art,
podcast_title: podcast_title});
}
}
}
Expand All @@ -141,7 +146,7 @@ ListItem {

Column {
anchors {
left: parent.left
left: artArea.right
right: downloadStatusIcon.left
verticalCenter: parent.verticalCenter
margins: Theme.paddingMedium
Expand Down Expand Up @@ -177,6 +182,7 @@ ListItem {
}

Label {
id: subtitleItem
text: total_time > 0 ? (subtitle != '' ? Util.formatDuration(total_time) + ' | ' + subtitle : Util.formatDuration(total_time)) : subtitle
anchors {
left: titleItem.left
Expand All @@ -189,6 +195,16 @@ ListItem {
}
}

ArtArea {
id: artArea
anchors {
left: parent.left
}
height: titleItem.height + subtitleItem.height
width: titleItem.height + subtitleItem.height
property string title_char: podcast_title[0]
}

Label {
id: videoIcon

Expand Down Expand Up @@ -233,4 +249,3 @@ ListItem {
}
}
}

9 changes: 4 additions & 5 deletions qml/PlayerCover.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ Column {
visible: false
}

Image {
ArtArea {
id: coverArtImage
visible: source != ""
source: player.podcast_coverart
sourceSize.width: parent.width
fillMode: Image.Pad
visible: episode_art != '' || cover_art != ''
width: parent.width
height: width
}

Rectangle {
Expand Down
23 changes: 15 additions & 8 deletions qml/PlayerPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,22 @@ Page {
visible: player.episode!=0
}

Image {
anchors {
horizontalCenter: parent.horizontalCenter
margins: Theme.paddingMedium
CustomExpander {
width: parent.width
expandedHeight: width
ArtArea {
anchors {
horizontalCenter: parent.horizontalCenter
margins: Theme.paddingMedium
}
id: coverImage
property string cover_art: player.cover_art
property string episode_art: player.episode_art
property string title_char: player.podcast_title[0]

width: parent.width
height: width
}
id: coverImage
source: player.podcast_coverart
fillMode: Image.PreserveAspectFit
width: parent.width * 0.66
}

Label {
Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-org.gpodder.sailfish.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Summary: Media and podcast aggregator
Name: harbour-org.gpodder.sailfish
Version: 4.10.0
Version: 4.11.0
Release: 1
Group: System/GUI/Other
License: ISC / GPLv3
Expand Down
Loading

0 comments on commit 4f9e218

Please sign in to comment.