~mzanetti/unity8/spread-blur

« back to all changes in this revision

Viewing changes to qml/Stage/WindowInfoItem.qml

  • Committer: Bileto Bot
  • Author(s): Michael Zanetti
  • Date: 2016-10-24 11:34:08 UTC
  • mfrom: (2400.6.204 unity8-unified-spread)
  • Revision ID: ci-train-bot@canonical.com-20161024113408-7ul8ivww68dqm74v
Merge all Stages into one single codebase. Apply new spread visuals.

This deletes PhoneStage, TabletStage and DesktopStage, and merges all of the functionality into Stage. Also the spread visuals have been updated by design to work with all usage modes. (LP: #1489517, #1603914, #1635800)

Approved by: Lukáš Tinkl

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.4
 
2
import Ubuntu.Components 1.3
 
3
 
 
4
Item {
 
5
    id: root
 
6
    implicitWidth: Math.max(iconShape.width, titleLabel.width)
 
7
    implicitHeight: iconShape.height + titleLabel.height + labelMargin + iconMargin
 
8
    property alias title: titleLabel.text
 
9
    property alias iconSource: icon.source
 
10
 
 
11
    property real iconHeight: (height - titleLabel.height) * 0.65
 
12
    property real iconMargin: (height - titleLabel.height) * 0.25
 
13
    property real labelMargin: (height - titleLabel.height) * 0.1
 
14
    property int maxWidth: units.gu(10)
 
15
 
 
16
    signal clicked()
 
17
 
 
18
    ProportionalShape {
 
19
        id: iconShape
 
20
        anchors {
 
21
            top: parent.top
 
22
            topMargin: iconMargin
 
23
            left: parent.left
 
24
        }
 
25
        height: iconHeight
 
26
        borderSource: "undefined"
 
27
        aspect: UbuntuShape.Flat
 
28
        source: Image {
 
29
            id: icon
 
30
            sourceSize.width: iconShape.width
 
31
            sourceSize.height: iconShape.height
 
32
            cache: false // see lpbug#1543290 why no cache
 
33
        }
 
34
    }
 
35
 
 
36
    MouseArea {
 
37
        anchors.fill: iconShape
 
38
        onClicked: root.clicked()
 
39
    }
 
40
 
 
41
    Label {
 
42
        id: titleLabel
 
43
        anchors {
 
44
            left: iconShape.left
 
45
            top: iconShape.bottom
 
46
            topMargin: labelMargin
 
47
        }
 
48
        width: root.maxWidth
 
49
        fontSize: 'small'
 
50
        color: 'white'
 
51
        elide: Label.ElideRight
 
52
    }
 
53
}