Merge branch 'main' of https://github.com/noctalia-dev/noctalia-shell
This commit is contained in:
commit
b3972fd862
1 changed files with 9 additions and 12 deletions
|
|
@ -29,11 +29,6 @@ Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onTextChanged: {
|
|
||||||
// Compute new dimensions everytime the text changes
|
|
||||||
_updateDimensions()
|
|
||||||
}
|
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
isVisible = true
|
isVisible = true
|
||||||
}
|
}
|
||||||
|
|
@ -42,16 +37,10 @@ Window {
|
||||||
timerShow.running = false
|
timerShow.running = false
|
||||||
}
|
}
|
||||||
|
|
||||||
function _updateDimensions() {
|
function _showNow() {
|
||||||
// Compute new size everytime we show the tooltip
|
// Compute new size everytime we show the tooltip
|
||||||
width = Math.max(50 * scaling, tooltipText.implicitWidth + Style.marginL * 2 * scaling)
|
width = Math.max(50 * scaling, tooltipText.implicitWidth + Style.marginL * 2 * scaling)
|
||||||
height = Math.max(40 * scaling, tooltipText.implicitHeight + Style.marginM * 2 * scaling)
|
height = Math.max(40 * scaling, tooltipText.implicitHeight + Style.marginM * 2 * scaling)
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function _showNow() {
|
|
||||||
// Compute new dimensions everytime we show the tooltip
|
|
||||||
_updateDimensions()
|
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
return
|
return
|
||||||
|
|
@ -120,6 +109,14 @@ Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Connections {
|
||||||
|
target: root
|
||||||
|
function onTextChanged() {
|
||||||
|
if (root.visible) {
|
||||||
|
root._showNow()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: timerShow
|
id: timerShow
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue