/** * * 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 'common' import 'common/util.js' as Util import 'common/constants.js' as Constants import 'icons/icons.js' as Icons Item { id: pgst GPodderCore { id: py } GPodderPlayback { id: player } GPodderPlatform { id: platform } GPodderPodcastListModel { id: podcastListModel } GPodderPodcastListModelConnections {} Keys.onPressed: { switch (event.key) { case Qt.Key_Space: player.togglePause(); break; case Qt.Key_Q: player.seekAndSync(player.position - 60 * 1000); break; case Qt.Key_W: player.seekAndSync(player.position - 10 * 1000); break; case Qt.Key_O: player.seekAndSync(player.position + 10 * 1000); break; case Qt.Key_P: player.seekAndSync(player.position + 60 * 1000); break; case Qt.Key_Escape: case Qt.Key_Backspace: case Qt.Key_Back: if (backButton.enabled) { backButton.clicked(); event.accepted = true; } break; default: break; } } // Initial focus focus: true property real scalef: (width < height) ? (width / 480) : (height / 480) property int shorterSide: (width < height) ? width : height property int dialogsVisible: 0 anchors.fill: parent function update(page, x) { var index = -1; for (var i=0; i 50) { if (throbber.enabled) { throbber.clicked(); } } } } } Rectangle { z: 190 color: Constants.colors.playback visible: platform.floatingPlayButton && !pgst.havePlayer Behavior on opacity { NumberAnimation { } } opacity: (player.episode != 0) ? (player.isPlaying ? 1 : .5) : 0 width: Constants.layout.item.height * 1.1 * pgst.scalef height: width radius: height / 2 anchors { right: parent.right margins: Constants.layout.padding * 2 * pgst.scalef } y: pgst.height - height - anchors.margins PIcon { id: icon anchors.centerIn: parent icon: Icons.headphones size: 60 color: Constants.colors.inverted.toolbarText } MouseArea { anchors.fill: parent onClicked: loadPage('PlayerPage.qml'); drag { target: parent axis: Drag.YAxis minimumY: pgst.bottomSpacing + parent.anchors.margins maximumY: pgst.height - parent.height - parent.anchors.margins } } } PodcastsPage { visible: py.ready } }