Changeset View
Changeset View
Standalone View
Standalone View
org.kde.desktop/ItemDelegate.qml
Show All 15 Lines | |||||
16 | * Software Foundation and appearing in the file LICENSE.GPL included in | 16 | * Software Foundation and appearing in the file LICENSE.GPL included in | ||
17 | * the packaging of this file. Please review the following information to | 17 | * the packaging of this file. Please review the following information to | ||
18 | * ensure the GNU General Public License version 2.0 requirements will be | 18 | * ensure the GNU General Public License version 2.0 requirements will be | ||
19 | * met: http://www.gnu.org/licenses/gpl-2.0.html. | 19 | * met: http://www.gnu.org/licenses/gpl-2.0.html. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | 22 | | |||
23 | import QtQuick 2.5 | 23 | import QtQuick 2.5 | ||
24 | import org.kde.qqc2desktopstyle.private 1.0 as StylePrivate | | |||
25 | import QtQuick.Templates 2.0 as T | 24 | import QtQuick.Templates 2.0 as T | ||
25 | import org.kde.kirigami 2.2 as Kirigami | ||||
26 | import "private" | 26 | import "private" | ||
27 | 27 | | |||
28 | T.ItemDelegate { | 28 | T.ItemDelegate { | ||
29 | id: controlRoot | 29 | id: controlRoot | ||
30 | 30 | | |||
31 | implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding | 31 | implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding | ||
32 | implicitHeight: Math.max(contentItem.implicitHeight, | 32 | implicitHeight: Math.max(contentItem.implicitHeight, | ||
33 | indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding | 33 | indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding | ||
34 | hoverEnabled: true | 34 | hoverEnabled: true | ||
35 | 35 | | |||
36 | padding: 4 | 36 | padding: 4 | ||
37 | spacing: 4 | 37 | spacing: 4 | ||
38 | rightPadding: 20 | 38 | rightPadding: 20 | ||
39 | 39 | | |||
40 | contentItem: Label { | 40 | contentItem: Label { | ||
41 | leftPadding: controlRoot.mirrored ? (controlRoot.indicator ? controlRoot.indicator.width : 0) + controlRoot.spacing : 0 | 41 | leftPadding: controlRoot.mirrored ? (controlRoot.indicator ? controlRoot.indicator.width : 0) + controlRoot.spacing : 0 | ||
42 | rightPadding: !controlRoot.mirrored ? (controlRoot.indicator ? controlRoot.indicator.width : 0) + controlRoot.spacing : 0 | 42 | rightPadding: !controlRoot.mirrored ? (controlRoot.indicator ? controlRoot.indicator.width : 0) + controlRoot.spacing : 0 | ||
43 | 43 | | |||
44 | text: controlRoot.text | 44 | text: controlRoot.text | ||
45 | font: controlRoot.font | 45 | font: controlRoot.font | ||
46 | color: controlRoot.highlighted || controlRoot.checked || (controlRoot.pressed && !controlRoot.checked && !controlRoot.sectionDelegate) ? StylePrivate.SystemPaletteSingleton.highlightedText(controlRoot.enabled) : StylePrivate.SystemPaletteSingleton.text(controlRoot.enabled) | 46 | color: controlRoot.highlighted || controlRoot.checked || (controlRoot.pressed && !controlRoot.checked && !controlRoot.sectionDelegate) ? Kirigami.Theme.highlightedTextColor : (controlRoot.enabled ? Kirigami.Theme.textColor : Kirigami.Theme.disabledTextColor) | ||
47 | elide: Text.ElideRight | 47 | elide: Text.ElideRight | ||
48 | visible: controlRoot.text | 48 | visible: controlRoot.text | ||
49 | horizontalAlignment: Text.AlignLeft | 49 | horizontalAlignment: Text.AlignLeft | ||
50 | verticalAlignment: Text.AlignVCenter | 50 | verticalAlignment: Text.AlignVCenter | ||
51 | } | 51 | } | ||
52 | 52 | | |||
53 | background: DefaultListItemBackground {} | 53 | background: DefaultListItemBackground {} | ||
54 | } | 54 | } |