~neon/plasmate/frameworks

« back to all changes in this revision

Viewing changes to themeexplorer/package/contents/ui/delegates/containment-controls.qml

  • Committer: Marco Martin
  • Date: 2015-03-04 17:05:00 UTC
  • Revision ID: git-v1:129afdfd207ae03fb1a00f1c785ff24c735c4dfb
add containment-controls

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *   Copyright 2015 Marco Martin <mart@kde.org>
 
3
 *
 
4
 *   This program is free software; you can redistribute it and/or modify
 
5
 *   it under the terms of the GNU Library General Public License as
 
6
 *   published by the Free Software Foundation; either version 2 or
 
7
 *   (at your option) any later version.
 
8
 *
 
9
 *   This program is distributed in the hope that it will be useful,
 
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 *   GNU General Public License for more details
 
13
 *
 
14
 *   You should have received a copy of the GNU Library General Public
 
15
 *   License along with this program; if not, write to the
 
16
 *   Free Software Foundation, Inc.,
 
17
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
18
 */
 
19
 
 
20
import QtQuick 2.0
 
21
import QtQuick.Layouts 1.1
 
22
import QtQuick.Controls 1.3
 
23
 
 
24
import org.kde.plasma.core 2.0 as PlasmaCore
 
25
import org.kde.plasma.components 2.0 as PlasmaComponents
 
26
 
 
27
Item {
 
28
    Rectangle {
 
29
        id: background
 
30
        anchors {
 
31
            fill: parent
 
32
            margins: units.gridUnit
 
33
        }
 
34
        radius: 3
 
35
        color: theme.backgroundColor
 
36
        opacity: 0.6
 
37
    }
 
38
    PlasmaCore.Svg {
 
39
        id: controlsSvg
 
40
        imagePath: "widgets/containment-controls"
 
41
    }
 
42
    PlasmaCore.FrameSvgItem {
 
43
        anchors {
 
44
            left: background.left
 
45
            right: background.right
 
46
            verticalCenter: background.verticalCenter
 
47
        }
 
48
        height: maxSlider.height + minSlider.height
 
49
        imagePath: "widgets/containment-controls"
 
50
        prefix: "south"
 
51
        PlasmaCore.SvgItem {
 
52
            anchors {
 
53
                top: parent.top
 
54
                horizontalCenter: parent.horizontalCenter
 
55
            }
 
56
            svg: controlsSvg
 
57
            elementId: "south-offsetslider"
 
58
        }
 
59
        PlasmaCore.SvgItem {
 
60
            id: maxSlider
 
61
            anchors {
 
62
                top: parent.top
 
63
                right: parent.right
 
64
            }
 
65
            svg: controlsSvg
 
66
            elementId: "south-maxslider"
 
67
        }
 
68
        PlasmaCore.SvgItem {
 
69
            id: minSlider
 
70
            anchors {
 
71
                bottom: parent.bottom
 
72
                right: parent.right
 
73
            }
 
74
            svg: controlsSvg
 
75
            elementId: "south-minslider"
 
76
        }
 
77
        PlasmaCore.SvgItem {
 
78
            anchors {
 
79
                top: parent.top
 
80
                left: parent.left
 
81
            }
 
82
            svg: controlsSvg
 
83
            elementId: "south-minslider"
 
84
        }
 
85
        PlasmaCore.SvgItem {
 
86
            anchors {
 
87
                bottom: parent.bottom
 
88
                left: parent.left
 
89
            }
 
90
            svg: controlsSvg
 
91
            elementId: "south-maxslider"
 
92
        }
 
93
    }
 
94
 
 
95
    PlasmaComponents.Label {
 
96
        anchors {
 
97
            horizontalCenter: background.horizontalCenter
 
98
            bottom: background.bottom
 
99
        }
 
100
        text: model.imagePath
 
101
        visible: width < background.width
 
102
    }
 
103
}