~etherpulse/podbird/bottom_edge

7.4.5 by Nekhelesh Ramananthan
Added copyright header to now playing page
1
/*
117 by Nekhelesh Ramananthan
- Migrated to Ubuntu.Components 1.3
2
 * Copyright 2015-2016 Podbird Team
7.4.5 by Nekhelesh Ramananthan
Added copyright header to now playing page
3
 *
4
 * This file is part of Podbird.
5
 *
6
 * Podbird is free software; you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation; version 3.
9
 *
10
 * Podbird is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 */
18
116 by Nekhelesh Ramananthan
Synced devel to trunk
19
import QtQuick 2.4
125.1.7 by Nekhelesh Ramananthan
Primitive first working version of playlist support
20
import QtMultimedia 5.6
117 by Nekhelesh Ramananthan
- Migrated to Ubuntu.Components 1.3
21
import Ubuntu.Components 1.3
125.1.12 by Nekhelesh Ramananthan
Moved queue to page header sections. Removed queue empty view as it is never shown
22
import QtQuick.LocalStorage 2.0
7.4.1 by Nekhelesh Ramananthan
Added now playing page
23
import "../podcasts.js" as Podcasts
70 by Nekhelesh Ramananthan
Moved generic components to a new components for better reorganization
24
import "../components"
7.4.1 by Nekhelesh Ramananthan
Added now playing page
25
26
Page {
27
    id: nowPlayingPage
28
29
    visible: false
125.1.2 by Nekhelesh Ramananthan
Added Queue landing page accesible from the now playing page
30
125.1.12 by Nekhelesh Ramananthan
Moved queue to page header sections. Removed queue empty view as it is never shown
31
    property bool isNowPlayingPage: true
32
157 by Eran Uzan
Added bottom edge
33
    signal closeBottomEdge()
34
125.1.2 by Nekhelesh Ramananthan
Added Queue landing page accesible from the now playing page
35
    header: PageHeader {
36
        title: i18n.tr("Now Playing")
37
38
        StyleHints {
39
            backgroundColor: podbird.appTheme.background
40
        }
41
135.1.2 by Nekhelesh Ramananthan
Split NowPlayingPage into FullPlayingView and Queue
42
        leadingActionBar.actions: Action {
159 by Eran Uzan
Added bottom edge support toggle in setting page
43
            iconName: nowPlayingPageSections.selectedIndex === 1 && currentViewLoader.item.ViewItems.dragMode ? "back" : "go-down"
135.1.2 by Nekhelesh Ramananthan
Split NowPlayingPage into FullPlayingView and Queue
44
            text: i18n.tr("Back")
45
            onTriggered: {
46
                if (nowPlayingPageSections.selectedIndex === 1 && currentViewLoader.item.ViewItems.dragMode) {
47
                    currentViewLoader.item.ViewItems.dragMode = !currentViewLoader.item.ViewItems.dragMode
48
                } else {
157 by Eran Uzan
Added bottom edge
49
                    closeBottomEdge()
135.1.2 by Nekhelesh Ramananthan
Split NowPlayingPage into FullPlayingView and Queue
50
                }
51
            }
52
        }
53
125.1.2 by Nekhelesh Ramananthan
Added Queue landing page accesible from the now playing page
54
        trailingActionBar.actions: Action {
125.1.12 by Nekhelesh Ramananthan
Moved queue to page header sections. Removed queue empty view as it is never shown
55
            iconName: "delete"
56
            visible: nowPlayingPageSections.selectedIndex === 1
125.1.2 by Nekhelesh Ramananthan
Added Queue landing page accesible from the now playing page
57
            onTriggered: {
125.1.12 by Nekhelesh Ramananthan
Moved queue to page header sections. Removed queue empty view as it is never shown
58
                Podcasts.clearQueue()
59
                player.playlist.clear()
157 by Eran Uzan
Added bottom edge
60
                 closeBottomEdge()
125.1.12 by Nekhelesh Ramananthan
Moved queue to page header sections. Removed queue empty view as it is never shown
61
            }
62
        }
63
64
        extension: Sections {
65
            id: nowPlayingPageSections
66
67
            anchors {
68
                left: parent.left
69
                bottom: parent.bottom
70
            }
71
72
            StyleHints {
73
                selectedSectionColor: podbird.appTheme.focusText
74
            }
125.1.19 by Nekhelesh Ramananthan
Changed string fullview
75
            model: [i18n.tr("Full view"), i18n.tr("Queue")]
125.1.2 by Nekhelesh Ramananthan
Added Queue landing page accesible from the now playing page
76
        }
77
    }
7.4.1 by Nekhelesh Ramananthan
Added now playing page
78
135.1.2 by Nekhelesh Ramananthan
Split NowPlayingPage into FullPlayingView and Queue
79
    Loader {
80
        id: currentViewLoader
81
        anchors { fill: parent; topMargin: nowPlayingPage.header.height }
82
        source: nowPlayingPageSections.selectedIndex === 0 ? Qt.resolvedUrl("FullPlayingView.qml") : Qt.resolvedUrl("Queue.qml")
7.4.1 by Nekhelesh Ramananthan
Added now playing page
83
    }
84
}