Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
8b7486e8
Commit
8b7486e8
authored
Apr 25, 2011
by
François Cartegnie
🤞
Browse files
Qt: SeekSlider: Don't show tooltip for unknown time positions
parent
86027501
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/gui/qt4/util/input_slider.cpp
View file @
8b7486e8
...
...
@@ -147,15 +147,18 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event )
}
/* Tooltip */
int
posX
=
qMax
(
rect
().
left
(),
qMin
(
rect
().
right
(),
event
->
x
()
)
);
if
(
inputLength
>
0
)
{
int
posX
=
qMax
(
rect
().
left
(),
qMin
(
rect
().
right
(),
event
->
x
()
)
);
QPoint
p
(
event
->
globalX
()
-
(
event
->
x
()
-
posX
)
-
(
mTimeTooltip
->
width
()
/
2
),
QWidget
::
mapToGlobal
(
pos
()
).
y
()
-
(
mTimeTooltip
->
height
()
+
2
)
);
QPoint
p
(
event
->
globalX
()
-
(
event
->
x
()
-
posX
)
-
(
mTimeTooltip
->
width
()
/
2
),
QWidget
::
mapToGlobal
(
pos
()
).
y
()
-
(
mTimeTooltip
->
height
()
+
2
)
);
secstotimestr
(
psz_length
,
(
posX
*
inputLength
)
/
size
().
width
()
);
mTimeTooltip
->
setTime
(
psz_length
);
mTimeTooltip
->
move
(
p
);
secstotimestr
(
psz_length
,
(
posX
*
inputLength
)
/
size
().
width
()
);
mTimeTooltip
->
setTime
(
psz_length
);
mTimeTooltip
->
move
(
p
);
}
event
->
accept
();
}
...
...
@@ -176,7 +179,7 @@ void SeekSlider::wheelEvent( QWheelEvent *event )
void
SeekSlider
::
enterEvent
(
QEvent
*
e
)
{
/* Don't show the tooltip if the slider is disabled */
if
(
isEnabled
()
)
if
(
isEnabled
()
&&
inputLength
>
0
)
mTimeTooltip
->
show
();
}
...
...
Write
Preview
Supports
Markdown
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