Warning, /plasma/latte-dock/declarativeimports/components/private/SwitchStyle.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 * Copyright 2019 Michail Vourlakos <mvourlakos@gmail.com> 0003 * 0004 * This file is part of Latte-Dock 0005 * 0006 * Latte-Dock is free software; you can redistribute it and/or 0007 * modify it under the terms of the GNU General Public License as 0008 * published by the Free Software Foundation; either version 2 of 0009 * the License, or (at your option) any later version. 0010 * 0011 * Latte-Dock is distributed in the hope that it will be useful, 0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0014 * GNU General Public License for more details. 0015 * 0016 * You should have received a copy of the GNU General Public License 0017 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0018 */ 0019 0020 import QtQuick 2.2 0021 import QtQuick.Controls.Styles 1.2 as QtQuickControlStyle 0022 import QtQuick.Controls 1.2 0023 import org.kde.plasma.core 2.0 as PlasmaCore 0024 0025 QtQuickControlStyle.SwitchStyle { 0026 id: styleRoot 0027 0028 handle: PlasmaCore.FrameSvgItem { 0029 opacity: control.enabled ? 1.0 : 0.6 0030 width: height 0031 imagePath: "widgets/button" 0032 prefix: "shadow" 0033 0034 PlasmaCore.FrameSvgItem { 0035 id: button 0036 imagePath: "widgets/button" 0037 prefix: "normal" 0038 anchors.fill: parent 0039 } 0040 } 0041 0042 groove: PlasmaCore.FrameSvgItem { 0043 imagePath: "widgets/slider" 0044 prefix: "groove" 0045 implicitHeight: theme.mSize(theme.defaultFont).height 0046 implicitWidth: height * 2 0047 0048 PlasmaCore.FrameSvgItem { 0049 id: highlight 0050 imagePath: "widgets/slider" 0051 prefix: "groove-highlight" 0052 anchors.fill: parent 0053 0054 opacity: control.checked ? 1 : 0 0055 Behavior on opacity { 0056 PropertyAnimation { duration: units.shortDuration * 2 } 0057 } 0058 } 0059 } 0060 }