Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Thomas Perl
e95ec1f76a Experimental tablet UI 2015-03-07 17:38:12 +01:00
8 changed files with 142 additions and 65 deletions

View file

@ -62,6 +62,10 @@ ListModel {
});
}
onPodcast_idChanged: {
reload();
}
property var worker: ModelWorkerScript {
id: modelWorker
}

View file

@ -29,6 +29,7 @@ PListView {
id: episodeList
property int selectedIndex: -1
property alias podcast_id: episodeListModel.podcast_id
PScrollIntoView { id: scrollIntoView }
@ -42,14 +43,14 @@ PListView {
GPodderEpisodeListModelConnections {}
PBusyIndicator {
visible: !episodeListModel.ready
visible: !episodeListModel.ready && episodeListModel.podcast_id
anchors.centerIn: parent
}
PPlaceholder {
// TODO: If filter is "all", say "No episodes"
text: 'No episodes found'
visible: episodeList.count === 0 && episodeListModel.ready
text: episodeListModel.podcast_id ? 'No episodes found' : 'No podcast selected'
visible: (episodeList.count === 0 && episodeListModel.ready) || !episodeListModel.podcast_id
}
delegate: EpisodeItem { }

View file

@ -80,12 +80,6 @@ SlidePage {
], undefined, undefined, true);
}
Component.onCompleted: {
episodeList.model.podcast_id = podcast_id;
// List model will be loaded automatically on load
}
EpisodeQueryControl {
id: queryControl
model: episodeList.model
@ -95,5 +89,6 @@ SlidePage {
EpisodeListView {
id: episodeList
title: page.title
podcast_id: page.podcast_id
}
}

View file

@ -68,7 +68,7 @@ Item {
// Initial focus
focus: true
property real scalef: (width < height) ? (width / 480) : (height / 480)
property real scalef: 1.0 //(width < height) ? (width / 480) : (height / 480)
property int shorterSide: (width < height) ? width : height
property int dialogsVisible: 0

View file

@ -25,8 +25,9 @@ import 'common/util.js' as Util
import 'icons/icons.js' as Icons
import 'common/constants.js' as Constants
SlidePage {
SplitPage {
id: page
position: 0.4
canClose: false
@ -91,6 +92,7 @@ SlidePage {
], undefined, undefined, true);
}
SplitPane {
PListView {
id: podcastList
title: 'Subscriptions'
@ -106,7 +108,10 @@ SlidePage {
model: podcastListModel
delegate: PodcastItem {
onClicked: pgst.loadPage('EpisodesPage.qml', {'podcast_id': id, 'title': title});
onClicked: {
episodesPage.podcast_id = id;
episodesPage.title = title;
}//pgst.loadPage('EpisodesPage.qml', {'podcast_id': id, 'title': title});
onPressAndHold: {
pgst.showSelection([
{
@ -154,4 +159,13 @@ SlidePage {
}
}
}
}
SplitPane {
EpisodesPage {
id: episodesPage
anchors.fill: parent
}
}
}

34
touch/SplitPage.qml Normal file
View file

@ -0,0 +1,34 @@
/**
*
* 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
SlidePage {
id: splitPage
property real position: 0.5
Component.onCompleted: {
children[0].width = Qt.binding(function () { return splitPage.width * splitPage.position; });
children[1].width = Qt.binding(function () { return splitPage.width * (1.0 - splitPage.position); });
children[1].x = Qt.binding(function () { return children[0].width; });
}
}

29
touch/SplitPane.qml Normal file
View file

@ -0,0 +1,29 @@
/**
*
* 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
Item {
anchors {
top: parent.top
bottom: parent.bottom
}
}

View file

@ -24,7 +24,7 @@ import 'common/constants.js' as Constants
Rectangle {
color: Constants.colors.page
width: 480
width: 1280
height: 800
Main {}