#define PREF_W 410
#define PREF_H 151
#else
- #define PREF_W 450
- #define PREF_H 160
+ #define PREF_W 400
+ #define PREF_H 140
#endif
#define SET_WIDTH(i,j) i->widgetSize.setWidth(j)
* TODO: do we add a label for the current Volume ?
**/
b_remainingTime = false;
- timeLabel = new QLabel;
+ timeLabel = new TimeLabel;
nameLabel = new QLabel;
- speedLabel = new QLabel( "1.0x" );
+ speedLabel = new QLabel( "1.00x" );
timeLabel->setFrameStyle( QFrame::Sunken | QFrame::Panel );
speedLabel->setFrameStyle( QFrame::Sunken | QFrame::Panel );
statusBar()->addWidget( nameLabel, 8 );
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 ),
/* It is also connected to the control->slider, see the ControlsWidget */
CONNECT( THEMIM->getIM(), positionUpdated( float, int, int ),
this, setDisplayPosition( float, int, int ) );
-
+
CONNECT( THEMIM->getIM(), rateChanged( int ), this, setRate( int ) );
-
+
/** Connects on nameChanged() */
/* Naming in the controller statusbar */
CONNECT( THEMIM->getIM(), nameChanged( QString ), this,
****************************************************************************/
void MainInterface::showSpeedMenu( QPoint pos )
{
- speedControlMenu->exec( QCursor::pos() );
+ speedControlMenu->exec( QCursor::pos() - pos + QPoint( 0, speedLabel->height() ) );
}
void MainInterface::showTimeMenu( QPoint pos )
QMenu menu( this );
menu.addAction( qtr("Elapsed Time") , this, SLOT( setElapsedTime() ) );
menu.addAction( qtr("Remaining Time") , this, SLOT( setRemainTime() ) );
- menu.exec( QCursor::pos() );
+ menu.exec( QCursor::pos() - pos +QPoint( 0, timeLabel->height() ) );
}
/****************************************************************************
void MainInterface::toggleMenus()
{
- msg_Dbg( p_intf, "I HAS HERE, HIDING YOUR MENUZ: \\_o<~~ coin coin" );
TOGGLEV( controls );
TOGGLEV( statusBar() );
updateGeometry();
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 );
QVLCMenu::updateSystrayMenu( this, p_intf, true );
sysTray->show();
- CONNECT( sysTray, activated( QSystemTrayIcon::ActivationReason ),
+ CONNECT( sysTray, activated( QSystemTrayIcon::ActivationReason ),
this, handleSystrayClick( QSystemTrayIcon::ActivationReason ) );
}
show();
activateWindow();
}
+ else if( isMinimized() )
+ {
+ showNormal();
+ activateWindow();
+ }
else
{
#ifdef WIN32
else
{
sysTray->setToolTip( name );
- if( notificationEnabled )
+ if( notificationEnabled && ( isHidden() || isMinimized() ) )
{
sysTray->showMessage( qtr( "VLC media player" ), name,
QSystemTrayIcon::NoIcon, 4000 );
}
}
-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 );