Warning, /plasma/qqc2-breeze-style/style/qtquickcontrols/SwipeDelegate.qml is written in an unsupported language. File is not indexed.
0001 /* SPDX-FileCopyrightText: 2020 Noah Davis <noahadvs@gmail.com>
0002 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0003 */
0004
0005 import QtQuick
0006 import QtQuick.Controls as Controls
0007 import QtQuick.Templates as T
0008 import org.kde.kirigami as Kirigami
0009
0010 import org.kde.breeze.impl as Impl
0011
0012 T.SwipeDelegate {
0013 id: control
0014
0015 implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
0016 implicitContentWidth + leftPadding + rightPadding,
0017 implicitIndicatorWidth + leftPadding + rightPadding)
0018 implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
0019 implicitContentHeight + topPadding + bottomPadding,
0020 implicitIndicatorHeight + topPadding + bottomPadding)
0021
0022 padding: Kirigami.Units.mediumSpacing
0023 leftPadding: {
0024 if ((!contentItem.hasIcon && contentItem.textBesideIcon) // False if contentItem has been replaced
0025 || display == T.AbstractButton.TextOnly
0026 || display == T.AbstractButton.TextUnderIcon) {
0027 return Impl.Units.mediumHorizontalPadding
0028 } else {
0029 return control.horizontalPadding
0030 }
0031 }
0032 rightPadding: {
0033 if (contentItem.hasLabel && display != T.AbstractButton.IconOnly) { // False if contentItem has been replaced
0034 return Impl.Units.mediumHorizontalPadding
0035 } else {
0036 return control.horizontalPadding
0037 }
0038 }
0039
0040 spacing: Kirigami.Units.mediumSpacing
0041
0042 icon.width: Kirigami.Units.iconSizes.sizeForLabels
0043 icon.height: Kirigami.Units.iconSizes.sizeForLabels
0044
0045 contentItem:Impl.IconLabelContent {
0046 control: control
0047 text: control.text
0048 alignment: Qt.AlignLeft | Qt.AlignVCenter
0049 //color: (control.pressed && !control.checked && !control.sectionDelegate) ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor
0050 }
0051
0052 background: Impl.DelegateBackground {
0053 control: control
0054 }
0055
0056 clip: true
0057 swipe.transition: Transition {
0058 SmoothedAnimation {
0059 velocity: 3
0060 easing.type: Easing.InOutCubic
0061 }
0062 }
0063 }