Changeset View
Changeset View
Standalone View
Standalone View
src/qmlcontrols/kcmcontrols/qml/GridDelegate.qml
| Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Line(s) | 141 | RowLayout { | |||
|---|---|---|---|---|---|
| 144 | Repeater { | 144 | Repeater { | ||
| 145 | model: delegate.actions | 145 | model: delegate.actions | ||
| 146 | delegate: Controls.Button { | 146 | delegate: Controls.Button { | ||
| 147 | icon.name: modelData.iconName | 147 | icon.name: modelData.iconName | ||
| 148 | activeFocusOnTab: focus || delegate.focus | 148 | activeFocusOnTab: focus || delegate.focus | ||
| 149 | onClicked: modelData.trigger() | 149 | onClicked: modelData.trigger() | ||
| 150 | enabled: modelData.enabled | 150 | enabled: modelData.enabled | ||
| 151 | visible: modelData.visible | 151 | visible: modelData.visible | ||
| 152 | //NOTE: there aren't any global settings where to take "official" tooltip timeouts | 152 | | ||
| 153 | Controls.ToolTip.delay: 1000 | 153 | Controls.ToolTip { | ||
| 154 | Controls.ToolTip.timeout: 5000 | 154 | text: modelData.tooltip | ||
| 155 | Controls.ToolTip.visible: (Kirigami.Settings.isMobile ? pressed : hovered) && modelData.tooltip.length > 0 | 155 | visible: (Kirigami.Settings.isMobile ? pressed : hovered) && text.length > 0 | ||
| 156 | Controls.ToolTip.text: modelData.tooltip | 156 | } | ||
| 157 | } | 157 | } | ||
| 158 | } | 158 | } | ||
| 159 | } | 159 | } | ||
| 160 | } | 160 | } | ||
| 161 | } | 161 | } | ||
| 162 | // Bug 397367: explicitly using "delegate" as otherwise it crashes when switching between KCMs | 162 | // Bug 397367: explicitly using "delegate" as otherwise it crashes when switching between KCMs | ||
| 163 | layer.enabled: delegate.GraphicsInfo.api === GraphicsInfo.OpenGL | 163 | layer.enabled: delegate.GraphicsInfo.api === GraphicsInfo.OpenGL | ||
| 164 | layer.effect: DropShadow { | 164 | layer.effect: DropShadow { | ||
| Show All 12 Lines | 175 | anchors { | |||
| 177 | right: thumbnail.right | 177 | right: thumbnail.right | ||
| 178 | top: thumbnail.bottom | 178 | top: thumbnail.bottom | ||
| 179 | topMargin: Kirigami.Units.smallSpacing | 179 | topMargin: Kirigami.Units.smallSpacing | ||
| 180 | } | 180 | } | ||
| 181 | text: delegate.text | 181 | text: delegate.text | ||
| 182 | horizontalAlignment: Text.AlignHCenter | 182 | horizontalAlignment: Text.AlignHCenter | ||
| 183 | elide: Text.ElideRight | 183 | elide: Text.ElideRight | ||
| 184 | } | 184 | } | ||
| 185 | Controls.ToolTip.delay: 1000 | 185 | | ||
| 186 | Controls.ToolTip.timeout: 5000 | 186 | Controls.ToolTip { | ||
| 187 | Controls.ToolTip.visible: hovered && delegate.toolTip.length > 0 | 187 | visible: delegate.hovered && text.length > 0 | ||
| 188 | Controls.ToolTip.text: toolTip | 188 | text: delegate.toolTip | ||
| 189 | } | ||||
| 189 | } | 190 | } | ||