~tpeeters/ubuntu-ui-toolkit/toolbarActions-hide

« back to all changes in this revision

Viewing changes to modules/Ubuntu/Components/Themes/Ambiance/DialogForegroundStyle.qml

merge lp:~fboucault/ubuntu-ui-toolkit/theme_relative_path_fix. All API tests pass now

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright 2012 Canonical Ltd.
 
2
 * Copyright 2013 Canonical Ltd.
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
5
5
 * it under the terms of the GNU Lesser General Public License as published by
18
18
import Ubuntu.Components 0.1
19
19
 
20
20
Item {
21
 
    id: visuals
22
 
    // styling properties
 
21
    id: dialogForegroundStyle
 
22
 
23
23
    visible: styledItem.dismissArea.width > units.gu(60)
24
 
    property color color: visible ? Qt.rgba(0, 0, 0, 0.7) : "transparent"
25
 
    property string radius: "medium"
26
 
 
27
 
    anchors.fill: parent
28
 
    z: -1
29
 
 
30
 
    Rectangle {
31
 
        id: container
32
 
        color: visuals.color
33
 
        anchors.fill: parent
34
 
        radius: 10
35
 
    }
36
 
 
37
 
    clip: true // hide the ShaderEffectSource
 
24
 
38
25
    UbuntuShape {
 
26
        id: background
39
27
        anchors.fill: parent
40
 
        image: effectSource
41
 
        radius: visuals.radius
42
 
        borderSource: Qt.resolvedUrl("artwork/ubuntushape_"+radius+"_radius_mask.sci")
43
 
    }
44
 
 
45
 
    ShaderEffectSource {
46
 
        smooth: false // prevent linear interpolation
47
 
        id: effectSource
48
 
        hideSource: true
49
 
        sourceItem: container
50
 
        format: ShaderEffectSource.RGBA
51
 
        live: true
52
 
 
53
 
        // Do not set visible to false because it will leave the FBO empty,
54
 
        //  but position the ShaderEffectSource somewhere that it will be clipped
55
 
        //  so it is not visible.
56
 
        x: width
57
 
        width: sourceItem.width
58
 
        height: sourceItem.height
 
28
        color: Qt.rgba(0, 0, 0, 0.7)
59
29
    }
60
30
}