~josharenson/unity8/slim_greeter_real_lightdm

« back to all changes in this revision

Viewing changes to qml/Dash/Previews/PreviewInlineVideo.qml

  • Committer: Josh Arenson
  • Date: 2016-06-29 14:44:41 UTC
  • mfrom: (1789.412.85 unity8)
  • Revision ID: joshua.arenson@canonical.com-20160629144441-du2vd7vu97b2n8pc
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2016 Canonical, Ltd.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; version 3.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
import QtQuick 2.4
 
18
import QtMultimedia 5.0
 
19
import Ubuntu.Components 1.3
 
20
import Ubuntu.Thumbnailer 0.1
 
21
import "../../Components"
 
22
import "../../Components/MediaServices"
 
23
 
 
24
/*! \brief Preview widget for video.
 
25
 
 
26
    This widget shows video contained in widgetData["source"],
 
27
    with a placeholder screenshot specified by widgetData["screenshot"].
 
28
 */
 
29
 
 
30
PreviewWidget {
 
31
    id: root
 
32
    implicitWidth: units.gu(35)
 
33
    implicitHeight: services.height
 
34
 
 
35
    widgetMargins: -units.gu(1)
 
36
    orientationLock: services.fullscreen
 
37
 
 
38
    property alias rootItem: services.rootItem
 
39
 
 
40
    MediaServices {
 
41
        id: services
 
42
        width: parent.width
 
43
 
 
44
        actions: sharingAction
 
45
        context: "video"
 
46
        sourceData: widgetData
 
47
        fullscreen: false
 
48
        maximumEmbeddedHeight: rootItem.height / 2
 
49
 
 
50
        onClose: fullscreen = false
 
51
 
 
52
        Action {
 
53
            id: sharingAction
 
54
            iconName: "share"
 
55
            visible: sharingPicker.active
 
56
            onTriggered: sharingPicker.showPeerPicker()
 
57
        }
 
58
    }
 
59
 
 
60
    SharingPicker {
 
61
        id: sharingPicker
 
62
        objectName: "sharingPicker"
 
63
        shareData: widgetData["share-data"]
 
64
    }
 
65
}