Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Frameworks
KDE Plasma Framework
Commits
524ff23f
Commit
524ff23f
authored
May 22, 2014
by
Marco Martin
Browse files
add support for tooltips
use qwidget tooltips, not plasma ones
BUG:335131
parent
88275439
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/declarativeimports/plasmacomponents/qml/Button.qml
View file @
524ff23f
...
...
@@ -30,6 +30,8 @@
*/
import
QtQuick
2.1
import
org
.
kde
.
plasma
.
core
2.0
as
PlasmaCore
import
QtQuick
.
Controls
.
Private
1.0
import
QtQuick
.
Controls
1.0
import
"
private
"
as
Private
...
...
@@ -70,6 +72,9 @@ Item {
*/
property
alias
text
:
label
.
text
/*! This property holds the button tooltip. */
property
string
tooltip
/**
* type:string
*
...
...
@@ -261,7 +266,17 @@ Item {
hoverEnabled
:
true
onPressed
:
internal
.
userPressed
=
true
onReleased
:
internal
.
userPressed
=
false
onCanceled
:
internal
.
userPressed
=
false
onCanceled
:
{
internal
.
userPressed
=
false
Tooltip
.
hideText
()
}
onClicked
:
internal
.
clickButton
()
onExited
:
Tooltip
.
hideText
()
Timer
{
interval
:
1000
running
:
mouse
.
containsMouse
&&
!
pressed
&&
tooltip
.
length
onTriggered
:
Tooltip
.
showText
(
mouse
,
Qt
.
point
(
mouse
.
mouseX
,
mouse
.
mouseY
),
tooltip
)
}
}
}
src/declarativeimports/plasmacomponents/qml/ToolButton.qml
View file @
524ff23f
...
...
@@ -20,6 +20,8 @@
import
QtQuick
2.1
import
org
.
kde
.
plasma
.
core
2.0
as
PlasmaCore
import
QtQuick
.
Controls
.
Private
1.0
import
QtQuick
.
Controls
1.0
import
"
private
"
as
Private
/**
...
...
@@ -56,6 +58,9 @@ Item {
*/
property
alias
text
:
label
.
text
/*! This property holds the button tooltip. */
property
string
tooltip
/**
* type:variant
*
...
...
@@ -386,6 +391,7 @@ Item {
onCanceled
:
{
internal
.
userPressed
=
false
delegate
.
shadowState
=
"
shadow
"
Tooltip
.
hideText
()
}
onClicked
:
internal
.
clickButton
()
...
...
@@ -406,6 +412,13 @@ Item {
}
}
button
.
z
-=
2
Tooltip
.
hideText
()
}
Timer
{
interval
:
1000
running
:
mouse
.
containsMouse
&&
!
pressed
&&
tooltip
.
length
onTriggered
:
Tooltip
.
showText
(
mouse
,
Qt
.
point
(
mouse
.
mouseX
,
mouse
.
mouseY
),
tooltip
)
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment