Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
1c9e4402
Commit
1c9e4402
authored
Jun 23, 2012
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: SeekSlider: non seekable must be non interactive
parent
6598d092
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
6 deletions
+21
-6
modules/gui/qt4/components/controller.cpp
modules/gui/qt4/components/controller.cpp
+3
-0
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+5
-0
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/input_manager.hpp
+1
-0
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+10
-6
modules/gui/qt4/util/input_slider.hpp
modules/gui/qt4/util/input_slider.hpp
+2
-0
No files found.
modules/gui/qt4/components/controller.cpp
View file @
1c9e4402
...
...
@@ -359,6 +359,9 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
THEMIM
->
getIM
(),
sliderUpdate
(
float
)
);
CONNECT
(
THEMIM
->
getIM
(),
cachingChanged
(
float
),
slider
,
updateBuffering
(
float
)
);
/* Give hint to disable slider's interactivity when useless */
CONNECT
(
THEMIM
->
getIM
(),
inputCanSeek
(
bool
),
slider
,
setSeekable
(
bool
)
);
widget
=
slider
;
}
break
;
...
...
modules/gui/qt4/input_manager.cpp
View file @
1c9e4402
...
...
@@ -426,6 +426,11 @@ void InputManager::UpdateNavigation()
}
else
emit
chapterChanged
(
false
);
if
(
hasInput
()
)
emit
inputCanSeek
(
var_GetBool
(
p_input
,
"can-seek"
)
);
else
emit
inputCanSeek
(
false
);
}
void
InputManager
::
UpdateStatus
()
...
...
modules/gui/qt4/input_manager.hpp
View file @
1c9e4402
...
...
@@ -218,6 +218,7 @@ signals:
/// Used to signal whether we should show navigation buttons
void
titleChanged
(
bool
);
void
chapterChanged
(
bool
);
void
inputCanSeek
(
bool
);
/// Statistics are updated
void
statisticsUpdated
(
input_item_t
*
);
void
infoChanged
(
input_item_t
*
);
...
...
modules/gui/qt4/util/input_slider.cpp
View file @
1c9e4402
...
...
@@ -62,6 +62,7 @@ SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent, bool _static )
mHandleOpacity
=
1.0
;
chapters
=
NULL
;
mHandleLength
=
-
1
;
b_seekable
=
true
;
// prepare some static colors
QPalette
p
=
palette
();
...
...
@@ -166,7 +167,7 @@ void SeekSlider::setPosition( float pos, int64_t time, int length )
isSliding
=
false
;
}
else
setEnabled
(
tru
e
);
setEnabled
(
b_seekabl
e
);
if
(
!
isSliding
)
setValue
(
(
int
)(
pos
*
1000.0
)
);
...
...
@@ -205,15 +206,16 @@ void SeekSlider::mouseReleaseEvent( QMouseEvent *event )
return
;
}
QSlider
::
mouseReleaseEvent
(
event
);
if
(
b_seekPending
)
if
(
b_seekPending
&&
isEnabled
()
)
updatePos
();
}
void
SeekSlider
::
mousePressEvent
(
QMouseEvent
*
event
)
{
/* Right-click */
if
(
event
->
button
()
!=
Qt
::
LeftButton
&&
event
->
button
()
!=
Qt
::
MidButton
)
if
(
!
isEnabled
()
||
(
event
->
button
()
!=
Qt
::
LeftButton
&&
event
->
button
()
!=
Qt
::
MidButton
)
)
{
QSlider
::
mousePressEvent
(
event
);
return
;
...
...
@@ -266,6 +268,8 @@ void SeekSlider::mousePressEvent( QMouseEvent* event )
void
SeekSlider
::
mouseMoveEvent
(
QMouseEvent
*
event
)
{
if
(
!
isEnabled
()
)
return
event
->
accept
();
if
(
isSliding
)
{
setValue
(
QStyle
::
sliderValueFromPosition
(
MINIMUM
,
MAXIMUM
,
event
->
x
()
-
handleLength
()
/
2
,
width
()
-
handleLength
(),
false
)
);
...
...
@@ -308,7 +312,7 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event )
void
SeekSlider
::
wheelEvent
(
QWheelEvent
*
event
)
{
/* Don't do anything if we are for somehow reason sliding */
if
(
!
isSliding
)
if
(
!
isSliding
&&
isEnabled
()
)
{
setValue
(
value
()
+
event
->
delta
()
/
12
);
/* 12 = 8 * 15 / 10
Since delta is in 1/8 of ° and mouse have steps of 15 °
...
...
@@ -324,7 +328,7 @@ void SeekSlider::enterEvent( QEvent * )
/* Cancel the fade-out timer */
hideHandleTimer
->
stop
();
/* Only start the fade-in if needed */
if
(
animHandle
->
direction
()
!=
QAbstractAnimation
::
Forward
)
if
(
isEnabled
()
&&
animHandle
->
direction
()
!=
QAbstractAnimation
::
Forward
)
{
/* If pause is called while not running Qt will complain */
if
(
animHandle
->
state
()
==
QAbstractAnimation
::
Running
)
...
...
modules/gui/qt4/util/input_slider.hpp
View file @
1c9e4402
...
...
@@ -85,6 +85,7 @@ private:
float
f_buffering
;
SeekPoints
*
chapters
;
bool
b_classic
;
bool
b_seekable
;
int
mHandleLength
;
/* Colors & gradients */
...
...
@@ -102,6 +103,7 @@ private:
public
slots
:
void
setPosition
(
float
,
int64_t
,
int
);
void
setSeekable
(
bool
b
)
{
b_seekable
=
b
;
}
void
updateBuffering
(
float
);
void
hideHandle
();
...
...
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