Warning, /plasma/latte-dock/declarativeimports/components/SpinBox.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.0
0021 import QtQuick.Controls 1.4 as Controls
0022 import QtQuick.Controls.Styles.Plasma 2.0 as Styles
0023 import org.kde.plasma.core 2.0 as PlasmaCore
0024 
0025 Controls.SpinBox {
0026     implicitWidth: theme.mSize(theme.defaultFont).width * 10
0027 
0028     style: Styles.SpinBoxStyle {
0029         PlasmaCore.Svg {
0030             id: arrowSvg
0031             imagePath: "widgets/arrows"
0032             colorGroup: PlasmaCore.Theme.ButtonColorGroup
0033         }
0034         incrementControl: PlasmaCore.SvgItem {
0035             implicitWidth: theme.mSize(theme.defaultFont).width * 1.8
0036             anchors {
0037                 centerIn: parent
0038                 margins: 1
0039                 leftMargin: 0
0040                 rightMargin: 3
0041             }
0042             svg: arrowSvg
0043             elementId: "up-arrow"
0044             opacity: control.enabled ? (styleData.upPressed ? 1 : 0.6) : 0.5
0045         }
0046         decrementControl: PlasmaCore.SvgItem {
0047             implicitWidth: theme.mSize(theme.defaultFont).width * 1.8
0048             anchors {
0049                 centerIn: parent
0050                 margins: 1
0051                 leftMargin: 0
0052                 rightMargin: 3
0053             }
0054             svg: arrowSvg
0055             elementId: "down-arrow"
0056             opacity: control.enabled ? (styleData.upPressed ? 1 : 0.6) : 0.5
0057         }
0058     }
0059 }