Changeset View
Changeset View
Standalone View
Standalone View
sidebar/package/contents/ui/CategoryItem.qml
- This file was added.
1 | import QtQuick 2.5 | ||||
---|---|---|---|---|---|
2 | import QtQuick.Controls 2.5 as QQC2 | ||||
3 | import QtQuick.Layouts 1.1 | ||||
4 | import org.kde.kirigami 2.10 as Kirigami | ||||
5 | | ||||
6 | RowLayout { | ||||
7 | id: layout | ||||
8 | spacing: Kirigami.Settings.tabletMode ? Kirigami.Units.largeSpacing : Kirigami.Units.smallSpacing | ||||
9 | Kirigami.Icon { | ||||
10 | id: icon | ||||
11 | source: model.decoration | ||||
12 | Layout.preferredHeight: Layout.preferredWidth | ||||
13 | Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium | ||||
14 | Layout.leftMargin: model.DepthRole > 1 ? (model.DepthRole - 1) * (Kirigami.Units.iconSizes.smallMedium + layout.spacing) : 0 | ||||
15 | } | ||||
16 | QQC2.Label { | ||||
17 | Layout.fillWidth: true | ||||
18 | text: model.display | ||||
19 | color: (delegate.highlighted || delegate.checked || (delegate.pressed && delegate.supportsMouseEvents)) ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor | ||||
20 | elide: Text.ElideRight | ||||
21 | } | ||||
22 | | ||||
23 | Rectangle { | ||||
24 | id: defaultIndicator | ||||
25 | radius: width * 0.5 | ||||
26 | width: Kirigami.Units.largeSpacing | ||||
27 | height: Kirigami.Units.largeSpacing | ||||
28 | visible: model.showDefaultIndicator | ||||
29 | Kirigami.Theme.colorSet: Kirigami.Theme.View | ||||
30 | color: (delegate.highlighted || delegate.checked || (delegate.pressed && delegate.supportsMouseEvents)) ? Kirigami.Theme.backgroundColor : Kirigami.Theme.focusColor | ||||
31 | } | ||||
32 | } |