Changeset View
Changeset View
Standalone View
Standalone View
desktoppackage/contents/configuration/ConfigCategoryDelegate.qml
Show First 20 Lines • Show All 122 Lines • ▼ Show 20 Line(s) | 122 | QIconItem { | |||
---|---|---|---|---|---|
123 | id: iconItem | 123 | id: iconItem | ||
124 | Layout.alignment: Qt.AlignHCenter | 124 | Layout.alignment: Qt.AlignHCenter | ||
125 | width: units.iconSizes.medium | 125 | width: units.iconSizes.medium | ||
126 | height: width | 126 | height: width | ||
127 | icon: model.icon | 127 | icon: model.icon | ||
128 | state: current && categoriesScroll.activeFocus ? QIconItem.SelectedState : QIconItem.DefaultState | 128 | state: current && categoriesScroll.activeFocus ? QIconItem.SelectedState : QIconItem.DefaultState | ||
129 | } | 129 | } | ||
130 | 130 | | |||
131 | // FIXME: This label is center-aligned with a maximum width instead | ||||
132 | // of the more conventional combination of "Layout.fillWidth: true" | ||||
133 | // and "horizontalAlignment: Text.AlignHCenter" because that combination | ||||
134 | // triggers https://bugreports.qt.io/browse/QTBUG-49646 | ||||
135 | | ||||
131 | QtControls.Label { | 136 | QtControls.Label { | ||
132 | id: nameLabel | 137 | id: nameLabel | ||
133 | Layout.fillWidth: true | 138 | Layout.alignment: Qt.AlignHCenter | ||
139 | Layout.maximumWidth: delegateContents.width | ||||
134 | Layout.leftMargin: units.smallSpacing | 140 | Layout.leftMargin: units.smallSpacing | ||
135 | Layout.rightMargin: units.smallSpacing | 141 | Layout.rightMargin: units.smallSpacing | ||
136 | text: model.name | 142 | text: model.name | ||
137 | wrapMode: Text.Wrap | 143 | wrapMode: Text.Wrap | ||
138 | horizontalAlignment: Text.AlignHCenter | | |||
139 | color: current && categoriesScroll.activeFocus ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor | 144 | color: current && categoriesScroll.activeFocus ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor | ||
140 | Behavior on color { | 145 | Behavior on color { | ||
141 | ColorAnimation { | 146 | ColorAnimation { | ||
142 | duration: units.longDuration | 147 | duration: units.longDuration | ||
143 | easing.type: Easing.InOutQuad | 148 | easing.type: Easing.InOutQuad | ||
144 | } | 149 | } | ||
145 | } | 150 | } | ||
146 | } | 151 | } | ||
147 | } | 152 | } | ||
148 | //END UI components | 153 | //END UI components | ||
149 | } | 154 | } |