diff --git a/gpodder-ui-qml b/gpodder-ui-qml index 0afaba0..2e18f54 160000 --- a/gpodder-ui-qml +++ b/gpodder-ui-qml @@ -1 +1 @@ -Subproject commit 0afaba02d0e92bcfb8e3a7b62b74cda5a7d39a72 +Subproject commit 2e18f54e5e0c04e3e9c7eeeb6638b97531753440 diff --git a/org.gpodder.sailfish.qml b/org.gpodder.sailfish.qml index 8d58227..65df251 100644 --- a/org.gpodder.sailfish.qml +++ b/org.gpodder.sailfish.qml @@ -22,7 +22,12 @@ import Sailfish.Silica 1.0 import 'qml' ApplicationWindow { - initialPage: Page { - Main {} + initialPage: Main {} + + cover: CoverBackground { + CoverPlaceholder { + text: "gPodder" + icon.source: "/usr/share/icons/hicolor/86x86/apps/org.gpodder.sailfish.png" + } } } diff --git a/qml/ButtonArea.qml b/qml/ButtonArea.qml deleted file mode 100644 index 0f07557..0000000 --- a/qml/ButtonArea.qml +++ /dev/null @@ -1,37 +0,0 @@ - -/** - * - * gPodder QML UI Reference Implementation - * Copyright (c) 2013, 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 - -Rectangle { - id: buttonArea - - signal clicked - - property bool transparent: false - color: mouseArea.pressed?'#33ffffff':(transparent?'#00000000':'#88000000') - - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: buttonArea.clicked(); - } -} - diff --git a/qml/ButtonRow.qml b/qml/ButtonRow.qml index a65fd80..5b65c21 100644 --- a/qml/ButtonRow.qml +++ b/qml/ButtonRow.qml @@ -19,6 +19,7 @@ */ import QtQuick 2.0 +import Sailfish.Silica 1.0 Row { id: buttonRow @@ -30,12 +31,12 @@ Row { id: repeater model: buttonRow.model - delegate: ButtonArea { + delegate: BackgroundItem { height: buttonRow.height width: buttonRow.width / repeater.count onClicked: buttonRow.model[index].clicked() - PLabel { + Label { anchors.centerIn: parent text: modelData.label } diff --git a/qml/Dragging.qml b/qml/Dragging.qml deleted file mode 100644 index 7c94ebd..0000000 --- a/qml/Dragging.qml +++ /dev/null @@ -1,57 +0,0 @@ - -/** - * - * gPodder QML UI Reference Implementation - * Copyright (c) 2013, 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 - -MouseArea { - id: dragging - - property Item stacking - property bool hasPull: false - property bool canClose: true - signal pulled - - anchors.fill: parent - - drag { - target: parent - axis: Drag.XAxis - minimumX: dragging.hasPull ? (-parent.width/4) : 0 - maximumX: canClose ? parent.width : 0 - filterChildren: true - } - - onPressedChanged: { - if (pressed) { - dragging.stacking.stopAllAnimations(); - } else { - if (hasPull && parent.x < -parent.width / 4 + 10) { - pulled(); - parent.x = -parent.width / 4; - //dragging.stacking.fadeInAgain(); - } else if (parent.x > parent.width / 3) { - dragging.stacking.startFadeOut(); - } else { - dragging.stacking.fadeInAgain(); - } - } - } -} - diff --git a/qml/EpisodeDetail.qml b/qml/EpisodeDetail.qml index a58e9cd..1b6f73b 100644 --- a/qml/EpisodeDetail.qml +++ b/qml/EpisodeDetail.qml @@ -19,10 +19,11 @@ */ import QtQuick 2.0 +import Sailfish.Silica 1.0 import 'constants.js' as Constants -SlidePage { +Page { id: detailPage property int episode_id @@ -35,10 +36,24 @@ SlidePage { }); } - Flickable { + SilicaFlickable { id: flickable anchors.fill: parent + VerticalScrollDecorator { flickable: flickable } + + PullDownMenu { + MenuItem { + text: 'Now playing' + onClicked: pgst.loadPage('PlayerPage.qml'); + } + + MenuItem { + text: 'Play' + onClicked: player.playbackEpisode(detailPage.episode_id) + } + } + contentWidth: detailColumn.width contentHeight: detailColumn.height + detailColumn.spacing @@ -48,22 +63,11 @@ SlidePage { width: detailPage.width spacing: 10 * pgst.scalef - SlidePageHeader { + PageHeader { title: detailPage.title } - ButtonArea { - width: detailPage.width - height: 100 * pgst.scalef - onClicked: player.playbackEpisode(detailPage.episode_id) - - PLabel { - anchors.centerIn: parent - text: 'Play' - } - } - - PLabel { + Label { id: label width: parent.width * .8 font.pixelSize: 30 * pgst.scalef diff --git a/qml/EpisodeItem.qml b/qml/EpisodeItem.qml index e0354b6..406dde0 100644 --- a/qml/EpisodeItem.qml +++ b/qml/EpisodeItem.qml @@ -19,10 +19,11 @@ */ import QtQuick 2.0 +import Sailfish.Silica 1.0 import 'constants.js' as Constants -ButtonArea { +BackgroundItem { id: podcastItem Rectangle { @@ -36,7 +37,6 @@ ButtonArea { opacity: .4 } - transparent: true height: 80 * pgst.scalef anchors { @@ -44,7 +44,7 @@ ButtonArea { right: parent.right } - PLabel { + Label { anchors { left: parent.left right: downloadStatusIcon.left diff --git a/qml/EpisodesPage.qml b/qml/EpisodesPage.qml index 47810ad..4a21482 100644 --- a/qml/EpisodesPage.qml +++ b/qml/EpisodesPage.qml @@ -19,50 +19,59 @@ */ import QtQuick 2.0 +import Sailfish.Silica 1.0 import io.thp.pyotherside 1.0 import 'util.js' as Util -SlidePage { +Page { id: episodesPage - hasPull: true - property int podcast_id property string title width: parent.width height: parent.height + RemorsePopup { id: remorse } + Component.onCompleted: { py.call('main.load_episodes', [podcast_id], function (episodes) { Util.updateModelFrom(episodeListModel, episodes); }); } - PullMenu { - PullMenuItem { - source: 'images/play.png' - onClicked: { - pgst.loadPage('PlayerPage.qml'); - episodesPage.unPull(); - } - } - - PullMenuItem { - source: 'images/delete.png' - onClicked: { - py.call('main.unsubscribe', [episodesPage.podcast_id]); - episodesPage.closePage(); - } - } - } - - PListView { + SilicaListView { id: episodeList - title: episodesPage.title + + VerticalScrollDecorator { flickable: episodeList } + + anchors.fill: parent + header: PageHeader { + title: episodesPage.title + } + model: ListModel { id: episodeListModel } + PullDownMenu { + MenuItem { + text: 'Now playing' + onClicked: pgst.loadPage('PlayerPage.qml'); + } + + MenuItem { + text: 'Unsubscribe' + onClicked: { + remorse.execute("Unsubscribing", function() { + py.call('main.unsubscribe', [episodesPage.podcast_id]); + if (pageStack.currentPage == episodesPage) { + pageStack.pop(); + } + }) + } + } + } + delegate: EpisodeItem { onClicked: pgst.loadPage('EpisodeDetail.qml', {episode_id: id, title: title}); } diff --git a/qml/FreshEpisodes.qml b/qml/FreshEpisodes.qml index f090fe8..d67a2ad 100644 --- a/qml/FreshEpisodes.qml +++ b/qml/FreshEpisodes.qml @@ -19,10 +19,11 @@ */ import QtQuick 2.0 +import Sailfish.Silica 1.0 import 'util.js' as Util -SlidePage { +Page { id: freshEpisodes property bool ready: false @@ -33,14 +34,36 @@ SlidePage { }); } - PBusyIndicator { + BusyIndicator { visible: !freshEpisodes.ready + running: visible anchors.centerIn: parent } - PListView { + SilicaListView { id: freshEpisodesList - title: 'Fresh episodes' + anchors.fill: parent + + VerticalScrollDecorator { flickable: freshEpisodesList } + + PullDownMenu { + MenuItem { + text: 'Now playing' + onClicked: pgst.loadPage('PlayerPage.qml'); + } + + MenuItem { + text: 'Mark all as old' + } + + MenuItem { + text: 'Download all episodes' + } + } + + header: PageHeader { + title: 'Fresh episodes' + } model: ListModel { id: freshEpisodesListModel } diff --git a/qml/Main.qml b/qml/Main.qml index d78c00e..9e3185c 100644 --- a/qml/Main.qml +++ b/qml/Main.qml @@ -19,9 +19,10 @@ */ import QtQuick 2.0 +import Sailfish.Silica 1.0 import io.thp.pyotherside 1.0 -Item { +Page { id: pgst property bool ready: false @@ -52,9 +53,9 @@ Item { component.errorString()); } if (properties === undefined) { - component.createObject(pgst); + pageStack.push(component.createObject(pgst)); } else { - component.createObject(pgst, properties); + pageStack.push(component.createObject(pgst, properties)); } } @@ -95,9 +96,10 @@ Item { id: player } - PBusyIndicator { + BusyIndicator { anchors.centerIn: parent visible: !pgst.ready + running: visible } StartPage { diff --git a/qml/PBusyIndicator.qml b/qml/PBusyIndicator.qml deleted file mode 100644 index cf19da7..0000000 --- a/qml/PBusyIndicator.qml +++ /dev/null @@ -1,53 +0,0 @@ - -/** - * - * gPodder QML UI Reference Implementation - * Copyright (c) 2013, 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 - -Item { - height: 64 * pgst.scalef - width: 64 * pgst.scalef - - Image { - anchors { - horizontalCenter: parent.horizontalCenter - bottom: parent.bottom - bottomMargin: 30*Math.abs(Math.sin(phase)) * pgst.scalef - } - - transform: Scale { - origin.x: 32 * pgst.scalef - origin.y: 32 * pgst.scalef - xScale: 1.0 - 0.3 * (1.0 - Math.abs(Math.sin(phase))) - } - - source: 'images/gpodder.png' - } - - property real phase: 0 - - PropertyAnimation on phase { - loops: Animation.Infinite - duration: 2000 - running: parent.visible - from: 0 - to: 2*Math.PI - } -} - diff --git a/qml/PLabel.qml b/qml/PLabel.qml deleted file mode 100644 index 580cfe7..0000000 --- a/qml/PLabel.qml +++ /dev/null @@ -1,27 +0,0 @@ - -/** - * - * gPodder QML UI Reference Implementation - * Copyright (c) 2013, 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 - -Text { - font.pixelSize: 30 * pgst.scalef - color: 'white' -} - diff --git a/qml/PListView.qml b/qml/PListView.qml deleted file mode 100644 index b53e9c7..0000000 --- a/qml/PListView.qml +++ /dev/null @@ -1,34 +0,0 @@ - -/** - * - * gPodder QML UI Reference Implementation - * Copyright (c) 2013, 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 'constants.js' as Constants - -ListView { - id: pListView - - anchors.fill: parent - - property string title - - header: SlidePageHeader { title: pListView.title } -} - diff --git a/qml/PSlider.qml b/qml/PSlider.qml deleted file mode 100644 index a4144d4..0000000 --- a/qml/PSlider.qml +++ /dev/null @@ -1,53 +0,0 @@ - -/** - * - * gPodder QML UI Reference Implementation - * Copyright (c) 2013, 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 - -Rectangle { - id: slider - - property real value - property real min: 0.0 - property real max: 1.0 - - signal valueChangeRequested(real newValue) - - color: '#aa000000' - - height: 50 * pgst.scalef - - MouseArea { - anchors.fill: parent - onClicked: slider.valueChangeRequested(min + (max - min) * (mouse.x / width)) - } - - Rectangle { - height: parent.height * 0.9 - width: height - - color: '#aaffffff' - - anchors { - verticalCenter: parent.verticalCenter - left: parent.left - leftMargin: parent.width * (parent.value - parent.min) / (parent.max - parent.min) - } - } -} diff --git a/qml/PTextField.qml b/qml/PTextField.qml deleted file mode 100644 index 91a7a03..0000000 --- a/qml/PTextField.qml +++ /dev/null @@ -1,51 +0,0 @@ - -/** - * - * gPodder QML UI Reference Implementation - * Copyright (c) 2013, 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 - -Rectangle { - id: textField - - property alias text: textInput.text - property string placeholderText: '' - - radius: 10 * pgst.scalef - height: 50 * pgst.scalef - color: 'white' - - TextInput { - anchors { - fill: parent - margins: 5 * pgst.scalef - } - color: 'black' - id: textInput - font.pixelSize: height - } - - Text { - anchors.fill: textInput - visible: !textInput.focus && (textInput.text == '') - text: textField.placeholderText - color: '#aaa' - font.pixelSize: textInput.font.pixelSize - } -} - diff --git a/qml/PlayerPage.qml b/qml/PlayerPage.qml index 8928099..9a1f078 100644 --- a/qml/PlayerPage.qml +++ b/qml/PlayerPage.qml @@ -19,10 +19,11 @@ */ import QtQuick 2.0 +import Sailfish.Silica 1.0 import 'constants.js' as Constants -SlidePage { +Page { id: playerPage property string episodeTitle @@ -33,7 +34,7 @@ SlidePage { }); } - Flickable { + SilicaFlickable { id: flickable anchors.fill: parent @@ -46,7 +47,7 @@ SlidePage { width: playerPage.width spacing: 10 * pgst.scalef - SlidePageHeader { + PageHeader { title: 'Now playing' } @@ -68,14 +69,13 @@ SlidePage { ] } - PSlider { + Slider { width: playerPage.width value: player.playbackRate - min: 0.5 - max: 3.0 - onValueChangeRequested: { - player.playbackRate = newValue - value = player.playbackRate + minimumValue: 0.5 + maximumValue: 3.0 + onSliderValueChanged: { + player.playbackRate = sliderValue } } } diff --git a/qml/PodcastItem.qml b/qml/PodcastItem.qml index 8b1442e..5b8faa2 100644 --- a/qml/PodcastItem.qml +++ b/qml/PodcastItem.qml @@ -19,12 +19,11 @@ */ import QtQuick 2.0 +import Sailfish.Silica 1.0 -ButtonArea { +BackgroundItem { id: podcastItem - transparent: true - height: 100 * pgst.scalef anchors { left: parent.left @@ -50,12 +49,13 @@ ButtonArea { source: coverart } - PBusyIndicator { + BusyIndicator { anchors.centerIn: cover visible: updating + running: visible } - PLabel { + Label { anchors { left: cover.right leftMargin: 10 * pgst.scalef diff --git a/qml/PodcastsPage.qml b/qml/PodcastsPage.qml index d64bb8d..cfc1114 100644 --- a/qml/PodcastsPage.qml +++ b/qml/PodcastsPage.qml @@ -19,12 +19,12 @@ */ import QtQuick 2.0 +import Sailfish.Silica 1.0 import 'util.js' as Util -SlidePage { +Page { id: podcastsPage - hasPull: true function reload() { loading.visible = true; @@ -65,41 +65,38 @@ SlidePage { py.setHandler('updated-podcast', undefined); } - PullMenu { - PullMenuItem { - source: 'images/play.png' - onClicked: { - pgst.loadPage('PlayerPage.qml'); - podcastsPage.unPull(); - } - } - - PullMenuItem { - source: 'images/search.png' - onClicked: { - podcastsPage.unPull(); - py.call('main.check_for_episodes'); - } - } - - PullMenuItem { - source: 'images/subscriptions.png' - onClicked: { - pgst.loadPage('Subscribe.qml'); - podcastsPage.unPull(); - } - } - } - - PLabel { + Label { id: loading anchors.centerIn: parent text: 'Loading' } - PListView { + SilicaListView { id: podcastList - title: 'Subscriptions' + anchors.fill: parent + + VerticalScrollDecorator { flickable: podcastList } + + PullDownMenu { + MenuItem { + text: 'Now playing' + onClicked: pgst.loadPage('PlayerPage.qml'); + } + + MenuItem { + text: 'Check for new episodes' + onClicked: py.call('main.check_for_episodes'); + } + + MenuItem { + text: 'Add new podcast' + onClicked: pgst.loadPage('Subscribe.qml'); + } + } + + header: PageHeader { + title: 'Subscriptions' + } section.property: 'section' section.delegate: SectionHeader { text: section } diff --git a/qml/SectionHeader.qml b/qml/SectionHeader.qml deleted file mode 100644 index 621f83e..0000000 --- a/qml/SectionHeader.qml +++ /dev/null @@ -1,39 +0,0 @@ - -/** - * - * gPodder QML UI Reference Implementation - * Copyright (c) 2013, 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 - -Item { - property alias text: pLabel.text - - height: 70 * pgst.scalef - - PLabel { - id: pLabel - anchors { - left: parent.left - bottom: parent.bottom - margins: 10 * pgst.scalef - } - - color: '#aaa' - } -} - diff --git a/qml/Settings.qml b/qml/Settings.qml index 3b6a18f..5e6683d 100644 --- a/qml/Settings.qml +++ b/qml/Settings.qml @@ -19,14 +19,13 @@ */ import QtQuick 2.0 +import Sailfish.Silica 1.0 -SlidePage { - SlidePageHeader { title: 'Settings' } +Page { + PageHeader { title: 'Settings' } - Text { + Label { anchors.centerIn: parent - color: 'white' - font.pixelSize: 50 * pgst.scalef text: 'TODO' } } diff --git a/qml/SlidePage.qml b/qml/SlidePage.qml deleted file mode 100644 index 2d1435d..0000000 --- a/qml/SlidePage.qml +++ /dev/null @@ -1,92 +0,0 @@ - -/** - * - * gPodder QML UI Reference Implementation - * Copyright (c) 2013, 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 'constants.js' as Constants - -Rectangle { - id: page - color: '#88000000' - - default property alias children: dragging.children - property alias hasPull: dragging.hasPull - property alias canClose: dragging.canClose - property real pullPhase: (x >= 0) ? 0 : (-x / (width / 4)) - - function unPull() { - stacking.fadeInAgain(); - } - - function closePage() { - stacking.startFadeOut(); - } - - onXChanged: pgst.update(page, x) - - width: parent.width - height: parent.height - - Stacking { id: stacking } - - Dragging { - id: dragging - stacking: stacking - - onPulled: console.log('have pulled it!') - } - - Rectangle { - color: 'black' - anchors.fill: parent - - opacity: page.pullPhase * 0.8 - - MouseArea { - enabled: parent.opacity > 0 - anchors.fill: parent - onClicked: page.unPull(); - } - } - - Image { - anchors { - right: parent.left - top: parent.top - bottom: parent.bottom - } - width: 10 * pgst.scalef - source: 'images/pageshadow.png' - opacity: .2 - } - - Image { - anchors { - left: parent.right - top: parent.top - bottom: parent.bottom - } - mirror: true - width: 10 * pgst.scalef - source: 'images/pageshadow.png' - opacity: .2 - } -} - diff --git a/qml/SlidePageHeader.qml b/qml/SlidePageHeader.qml deleted file mode 100644 index 0435ba0..0000000 --- a/qml/SlidePageHeader.qml +++ /dev/null @@ -1,60 +0,0 @@ - -/** - * - * gPodder QML UI Reference Implementation - * Copyright (c) 2013, 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 'constants.js' as Constants - -Item { - id: slidePageHeader - property string title - - width: parent.width - height: Constants.layout.header.height * pgst.scalef - - Rectangle { - anchors { - left: parent.left - right: parent.right - top: parent.top - topMargin: slidePageHeader.height * 0.15 - } - - height: slidePageHeader.height * 0.7 - color: '#33000000' - } - - Text { - anchors { - left: parent.left - right: parent.right - rightMargin: 20 * pgst.scalef - leftMargin: 70 * pgst.scalef - verticalCenter: parent.verticalCenter - } - - color: 'white' - horizontalAlignment: Text.AlignRight - font.pixelSize: parent.height * .4 * pgst.scalef - elide: Text.ElideRight - text: parent.title - } -} - diff --git a/qml/StartPage.qml b/qml/StartPage.qml index c5d2979..921e775 100644 --- a/qml/StartPage.qml +++ b/qml/StartPage.qml @@ -19,10 +19,10 @@ */ import QtQuick 2.0 +import Sailfish.Silica 1.0 -SlidePage { +Page { id: startPage - canClose: false function update_stats() { py.call('main.get_stats', [], function (result) { @@ -42,7 +42,22 @@ SlidePage { py.setHandler('update-stats', undefined); } - Flickable { + SilicaFlickable { + id: startPageFlickable + + PullDownMenu { + MenuItem { + text: 'Now playing' + onClicked: pgst.loadPage('PlayerPage.qml'); + } + MenuItem { + text: "Settings" + onClicked: pgst.loadPage('Settings.qml'); + } + } + + VerticalScrollDecorator { flickable: startPageFlickable } + Connections { target: pgst onReadyChanged: { @@ -63,17 +78,22 @@ SlidePage { width: startPage.width spacing: 20 * pgst.scalef - SlidePageHeader { + PageHeader { title: 'gPodder' } - StartPageButton { + SectionHeader { + text: 'Subscriptions' + } + + BackgroundItem { id: subscriptionsPane - title: 'Subscriptions' onClicked: pgst.loadPage('PodcastsPage.qml'); + width: startPage.width + height: startPage.height / 5 - PLabel { + Label { id: stats anchors { @@ -82,55 +102,40 @@ SlidePage { margins: 20 * pgst.scalef } } - - ButtonArea { - anchors { - bottom: parent.bottom - right: parent.right - } - - transparent: true - onClicked: pgst.loadPage('Subscribe.qml'); - width: subscriptions.width + 2*subscriptions.anchors.margins - height: subscriptions.height + 2*subscriptions.anchors.margins - - Image { - id: subscriptions - source: 'images/subscriptions.png' - - anchors { - bottom: parent.bottom - right: parent.right - margins: 20 * pgst.scalef - } - } - } } - StartPageButton { - id: freshEpisodesPage + SectionHeader { + id: freshEpisodesHeader + text: 'Fresh episodes' + } + + BackgroundItem { + id: freshEpisodesPage + height: startPage.height / 6 + width: parent.width - title: 'Fresh episodes' onClicked: pgst.loadPage('FreshEpisodes.qml'); Component.onCompleted: { py.setHandler('refreshing', function (is_refreshing) { - refresherButtonArea.visible = !is_refreshing; + refresherButton.visible = !is_refreshing; if (!is_refreshing) { - freshEpisodesPage.title = 'Fresh episodes'; + freshEpisodesHeader.text = 'Fresh episodes'; } }); py.setHandler('refresh-progress', function (pos, total) { - freshEpisodesPage.title = 'Refreshing feeds (' + pos + '/' + total + ')'; + freshEpisodesHeader.text = 'Refreshing feeds (' + pos + '/' + total + ')'; }); } Row { - anchors.bottom: parent.bottom - anchors.bottomMargin: 50 * pgst.scalef - anchors.leftMargin: 20 * pgst.scalef + id: freshRow + + anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left + anchors.margins: spacing + spacing: 10 * pgst.scalef Repeater { @@ -142,108 +147,19 @@ SlidePage { width: 80 * pgst.scalef height: 80 * pgst.scalef - PLabel { + /* + Label { anchors { horizontalCenter: parent.horizontalCenter - top: parent.bottom - margins: 5 * pgst.scalef + bottom: parent.bottom } text: modelData.newEpisodes } + */ } } } - - ButtonArea { - id: refresherButtonArea - - anchors { - bottom: parent.bottom - right: parent.right - } - - transparent: true - onClicked: py.call('main.check_for_episodes'); - width: refresher.width + 2*refresher.anchors.margins - height: refresher.height + 2*refresher.anchors.margins - - Image { - id: refresher - source: 'images/search.png' - - anchors { - bottom: parent.bottom - right: parent.right - margins: 20 * pgst.scalef - } - } - } - } - - ButtonArea { - onClicked: pgst.loadPage('PlayerPage.qml'); - - anchors { - left: recommendationsPane.left - right: recommendationsPane.right - } - - height: 100 * pgst.scalef - - PLabel { - anchors.centerIn: parent - text: 'Now playing' - } - } - - ButtonArea { - onClicked: pgst.loadPage('Settings.qml'); - - anchors { - left: recommendationsPane.left - right: recommendationsPane.right - } - - height: 100 * pgst.scalef - - PLabel { - anchors.centerIn: parent - text: 'Settings' - } - } - - StartPageButton { - id: recommendationsPane - - title: 'Recommendations' - onClicked: pgst.loadPage('Settings.qml'); - - Row { - anchors { - horizontalCenter: parent.horizontalCenter - bottom: parent.bottom - margins: 40 * pgst.scalef - } - - spacing: 20 * pgst.scalef - - Connections { - target: pgst - onReadyChanged: { - if (pgst.ready) { - py.call('main.load_podcasts', [], function (podcasts) { - recommendationsRepeater.model = podcasts.splice(0, 4); - }); - } - } - } - - Repeater { - id: recommendationsRepeater - Image { source: modelData.coverart; sourceSize { width: 80 * pgst.scalef; height: 80 * pgst.scalef } } - } - } } } } diff --git a/qml/StartPageButton.qml b/qml/StartPageButton.qml index 7c4917e..1e5d959 100644 --- a/qml/StartPageButton.qml +++ b/qml/StartPageButton.qml @@ -19,24 +19,17 @@ */ import QtQuick 2.0 +import Sailfish.Silica 1.0 -ButtonArea { +Column { id: startPageButton - property string title anchors.horizontalCenter: parent.horizontalCenter width: parent.width * .9 height: 200 * pgst.scalef - PLabel { - anchors { - right: parent.right - top: parent.top - margins: 20 * pgst.scalef - } - + SectionHeader { text: startPageButton.title } } - diff --git a/qml/Subscribe.qml b/qml/Subscribe.qml index 1736ec9..202cf21 100644 --- a/qml/Subscribe.qml +++ b/qml/Subscribe.qml @@ -19,28 +19,29 @@ */ import QtQuick 2.0 +import Sailfish.Silica 1.0 -SlidePage { +Page { id: subscribe - SlidePageHeader { title: 'Add subscription' } + PageHeader { title: 'Add subscription' } Column { anchors.centerIn: parent spacing: 30 * pgst.scalef - PTextField { + TextField { id: input width: subscribe.width *.8 placeholderText: 'Feed URL' } - ButtonArea { + BackgroundItem { id: button width: input.width height: input.height - PLabel { + Label { anchors.centerIn: parent text: 'Subscribe' } @@ -50,14 +51,17 @@ SlidePage { button.visible = false; input.visible = false; py.call('main.subscribe', [input.text], function () { - subscribe.closePage(); + if (pageStack.currentPage == subscribe) { + pageStack.pop(); + } }); } } - PBusyIndicator { + BusyIndicator { id: loading visible: false + running: visible anchors.horizontalCenter: parent.horizontalCenter } }