summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-20 14:24:14 -0600
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-20 14:24:14 -0600
commit633eed6bb6bc2251cfb324d8017279bee14578b0 (patch)
tree0dbf47f91987011ed3a0108e32137eeaa763a1d6
parentb2fae6c6dbc3d50a77e2e7cc25e7ec3089ace39c (diff)
downloadkube-633eed6bb6bc2251cfb324d8017279bee14578b0.tar.gz
kube-633eed6bb6bc2251cfb324d8017279bee14578b0.zip
Make the tooltip a feature of IconButton
-rw-r--r--components/kube/contents/ui/Kube.qml36
-rw-r--r--framework/qml/IconButton.qml6
2 files changed, 12 insertions, 30 deletions
diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml
index bc30b337..ae7269f1 100644
--- a/components/kube/contents/ui/Kube.qml
+++ b/components/kube/contents/ui/Kube.qml
@@ -127,11 +127,7 @@ Controls2.ApplicationWindow {
127 iconName: Kube.Icons.search_inverted 127 iconName: Kube.Icons.search_inverted
128 onClicked: search.open() 128 onClicked: search.open()
129 activeFocusOnTab: true 129 activeFocusOnTab: true
130 130 tooltip: qsTr("search")
131 Kube.ToolTip {
132 text: qsTr("search")
133 visible: parent.hovered
134 }
135 } 131 }
136 132
137 Kube.IconButton { 133 Kube.IconButton {
@@ -141,11 +137,7 @@ Controls2.ApplicationWindow {
141 activeFocusOnTab: true 137 activeFocusOnTab: true
142 checkable: true 138 checkable: true
143 Controls2.ButtonGroup.group: viewButtonGroup 139 Controls2.ButtonGroup.group: viewButtonGroup
144 140 tooltip: qsTr("composer")
145 Kube.ToolTip {
146 text: qsTr("composer")
147 visible: parent.hovered
148 }
149 } 141 }
150 142
151 Kube.IconButton { 143 Kube.IconButton {
@@ -155,11 +147,7 @@ Controls2.ApplicationWindow {
155 checkable: true 147 checkable: true
156 checked: true 148 checked: true
157 Controls2.ButtonGroup.group: viewButtonGroup 149 Controls2.ButtonGroup.group: viewButtonGroup
158 150 tooltip: qsTr("mails")
159 Kube.ToolTip {
160 text: qsTr("mails")
161 visible: parent.hovered
162 }
163 } 151 }
164 152
165 Kube.IconButton { 153 Kube.IconButton {
@@ -168,11 +156,7 @@ Controls2.ApplicationWindow {
168 activeFocusOnTab: true 156 activeFocusOnTab: true
169 checkable: true 157 checkable: true
170 Controls2.ButtonGroup.group: viewButtonGroup 158 Controls2.ButtonGroup.group: viewButtonGroup
171 159 tooltip: qsTr("people")
172 Kube.ToolTip {
173 text: qsTr("people")
174 visible: parent.hovered
175 }
176 } 160 }
177 } 161 }
178 Column { 162 Column {
@@ -199,11 +183,7 @@ Controls2.ApplicationWindow {
199 activeFocusOnTab: true 183 activeFocusOnTab: true
200 checkable: true 184 checkable: true
201 Controls2.ButtonGroup.group: viewButtonGroup 185 Controls2.ButtonGroup.group: viewButtonGroup
202 186 tooltip: qsTr("logview")
203 Kube.ToolTip {
204 text: qsTr("logview")
205 visible: parent.hovered
206 }
207 } 187 }
208 188
209 Kube.IconButton { 189 Kube.IconButton {
@@ -212,11 +192,7 @@ Controls2.ApplicationWindow {
212 activeFocusOnTab: true 192 activeFocusOnTab: true
213 checkable: true 193 checkable: true
214 Controls2.ButtonGroup.group: viewButtonGroup 194 Controls2.ButtonGroup.group: viewButtonGroup
215 195 tooltip: qsTr("settings")
216 Kube.ToolTip {
217 text: qsTr("settings")
218 visible: parent.hovered
219 }
220 } 196 }
221 } 197 }
222 } 198 }
diff --git a/framework/qml/IconButton.qml b/framework/qml/IconButton.qml
index 302e51b0..8fd8b705 100644
--- a/framework/qml/IconButton.qml
+++ b/framework/qml/IconButton.qml
@@ -23,6 +23,7 @@ AbstractButton {
23 id: root 23 id: root
24 24
25 property alias iconName: icon.iconName 25 property alias iconName: icon.iconName
26 property alias tooltip: toolTipItem.text
26 27
27 width: Units.gridUnit + leftPadding + rightPadding 28 width: Units.gridUnit + leftPadding + rightPadding
28 height: Units.gridUnit + topPadding + bottomPadding 29 height: Units.gridUnit + topPadding + bottomPadding
@@ -33,5 +34,10 @@ AbstractButton {
33 contentItem: Icon { 34 contentItem: Icon {
34 id: icon 35 id: icon
35 } 36 }
37
38 ToolTip {
39 id: toolTipItem
40 visible: parent.hovered && text != ""
41 }
36} 42}
37 43