Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
230b1c05
Commit
230b1c05
authored
Sep 09, 2007
by
Jean-Baptiste Kempf
Browse files
Qt4 - MainInterface, avoid the bug that makes the popupMenu toggle the TimeDisplay().
parent
4d9d3b9b
Changes
3
Hide whitespace changes
Inline
Side-by-side
modules/gui/qt4/components/interface_widgets.hpp
View file @
230b1c05
...
...
@@ -186,7 +186,7 @@ public:
virtual
~
VolumeClickHandler
()
{};
bool
eventFilter
(
QObject
*
obj
,
QEvent
*
e
)
{
if
(
e
->
type
()
==
QEvent
::
MouseButtonPress
)
if
(
e
->
type
()
==
QEvent
::
MouseButtonPress
)
{
aout_VolumeMute
(
p_intf
,
NULL
);
audio_volume_t
i_volume
;
...
...
@@ -201,6 +201,18 @@ private:
intf_thread_t
*
p_intf
;
};
#include
<QLabel>
#include
<QMouseEvent>
class
TimeLabel
:
public
QLabel
{
Q_OBJECT
void
mousePressEvent
(
QMouseEvent
*
event
)
{
if
(
event
->
button
()
==
Qt
::
LeftButton
)
emit
timeLabelClicked
();
}
signals:
void
timeLabelClicked
();
};
/******************** Playlist Widgets ****************/
#include
<QModelIndex>
...
...
modules/gui/qt4/main_interface.cpp
View file @
230b1c05
...
...
@@ -137,7 +137,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
* TODO: do we add a label for the current Volume ?
**/
b_remainingTime
=
false
;
timeLabel
=
new
Q
Label
;
timeLabel
=
new
Time
Label
;
nameLabel
=
new
QLabel
;
speedLabel
=
new
QLabel
(
"1.00x"
);
timeLabel
->
setFrameStyle
(
QFrame
::
Sunken
|
QFrame
::
Panel
);
...
...
@@ -147,7 +147,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
statusBar
()
->
addPermanentWidget
(
timeLabel
,
2
);
speedLabel
->
setContextMenuPolicy
(
Qt
::
CustomContextMenu
);
timeLabel
->
setContextMenuPolicy
(
Qt
::
CustomContextMenu
);
timeLabel
->
installEventFilter
(
this
);
CONNECT
(
timeLabel
,
timeLabelClicked
(),
this
,
toggleTimeDisplay
()
);
CONNECT
(
speedLabel
,
customContextMenuRequested
(
QPoint
),
this
,
showSpeedMenu
(
QPoint
)
);
CONNECT
(
timeLabel
,
customContextMenuRequested
(
QPoint
),
...
...
@@ -675,6 +675,7 @@ void MainInterface::setDisplayPosition( float pos, int time, int length )
void
MainInterface
::
toggleTimeDisplay
()
{
msg_Dbg
(
p_intf
,
"coincoin"
);
b_remainingTime
=
(
b_remainingTime
?
false
:
true
);
}
...
...
@@ -697,7 +698,7 @@ void MainInterface::setStatus( int status )
void
MainInterface
::
setRate
(
int
rate
)
{
QString
str
;
str
.
setNum
(
(
1000
/
(
double
)
rate
),
'f'
,
2
);
str
.
setNum
(
(
1000
/
(
double
)
rate
),
'f'
,
2
);
str
.
append
(
"x"
);
speedLabel
->
setText
(
str
);
speedControl
->
updateControls
(
rate
);
...
...
@@ -932,12 +933,6 @@ void MainInterface::customEvent( QEvent *event )
}
}
bool
MainInterface
::
eventFilter
(
QObject
*
obj
,
QEvent
*
event
)
{
if
(
(
obj
==
timeLabel
)
&&
(
event
->
type
()
==
QEvent
::
MouseButtonPress
)
)
toggleTimeDisplay
();
}
void
MainInterface
::
keyPressEvent
(
QKeyEvent
*
e
)
{
int
i_vlck
=
qtEventToVLCKey
(
e
);
...
...
modules/gui/qt4/main_interface.hpp
View file @
230b1c05
...
...
@@ -72,8 +72,6 @@ protected:
void
dragLeaveEvent
(
QDragLeaveEvent
*
);
void
closeEvent
(
QCloseEvent
*
);
bool
eventFilter
(
QObject
*
obj
,
QEvent
*
event
);
friend
class
VolumeClickHandler
;
private:
QSettings
*
settings
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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