Plasma

SwitchStyle.qml
1 /*
2  SPDX-FileCopyrightText: 2014 Marco Martin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 import QtQuick 2.2
8 import QtQuick.Controls.Styles 1.2 as QtQuickControlStyle
9 import QtQuick.Controls 1.2
10 import org.kde.plasma.core 2.0 as PlasmaCore
11 
12 QtQuickControlStyle.SwitchStyle {
13  id: styleRoot
14 
15  handle: PlasmaCore.FrameSvgItem {
16  opacity: control.enabled ? 1.0 : 0.6
17  width: height
18  imagePath: "widgets/button"
19  prefix: "shadow"
20 
21  PlasmaCore.FrameSvgItem {
22  id: button
23  imagePath: "widgets/button"
24  prefix: "normal"
25  anchors.fill: parent
26  }
27  }
28 
29  groove: PlasmaCore.FrameSvgItem {
30  imagePath: "widgets/slider"
31  prefix: "groove"
32  implicitHeight: theme.mSize(theme.defaultFont).height
33  implicitWidth: height * 2
34 
35  PlasmaCore.FrameSvgItem {
36  id: highlight
37  imagePath: "widgets/slider"
38  prefix: "groove-highlight"
39  anchors.fill: parent
40 
41  opacity: checked ? 1 : 0
42  Behavior on opacity {
43  PropertyAnimation { duration: units.shortDuration * 2 }
44  }
45  }
46  }
47 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Sep 20 2020 22:40:37 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.