return QString( "%1 (%2)" ).arg( v ).arg( texts[v] );
}
+VLCQDial::VLCQDial( QWidget *parent ) : QDial( parent )
+{
+
+}
+
+void VLCQDial::paintEvent( QPaintEvent *event )
+{
+ QDial::paintEvent( event );
+ QPainter painter( this );
+ painter.setPen( QPen( palette().color( QPalette::WindowText ) ) );
+ float radius = 0.5 * 0.707106 * qMin( size().width(), size().height() );
+ painter.drawText( QRectF( rect().center().x() + radius,
+ rect().center().y() + radius,
+ size().width(),
+ size().height() ),
+ 0, QString::number( value() ), 0 );
+ painter.end();
+}
+
/***************************************************************************
* Hotkeys converters
***************************************************************************/
{ Qt::Key_Enter, '\r' }, // numeric pad
{ Qt::Key_Insert, KEY_INSERT },
{ Qt::Key_Delete, KEY_DELETE },
- // Qt::Key_Pause
- // Qt::Key_Print
+ { Qt::Key_Pause, KEY_PAUSE },
+ { Qt::Key_Print, KEY_PRINT },
// Qt::Key_SysReq
// Qt::Key_Clear
{ Qt::Key_Home, KEY_HOME },
// Qt::Key_LaunchMail
// Qt::Key_LaunchMedia
/* Qt::Key_Launch0 through Qt::Key_LaunchF */
- // Qt::Key_MediaLast
+ /* ... */
+ { Qt::Key_Reload, KEY_BROWSER_REFRESH },
};
static int keycmp( const void *a, const void *b )
return i_vlck;
}
-QString VLCKeyToString( unsigned val )
+QString VLCKeyToString( unsigned val, bool locale )
{
- char *base = vlc_keycode2str (val, true);
+ char *base = vlc_keycode2str (val, locale);
if (base == NULL)
return qtr( "Unset" );
return r;
}
-PixmapAnimator::PixmapAnimator( QWidget *parent, QList<QString> frames )
- : QAbstractAnimation( parent ), current_frame( 0 )
-{
- foreach( QString name, frames )
- pixmaps.append( new QPixmap( name ) );
- currentPixmap = pixmaps.at( 0 );
- setFps( frames.count() ); /* default to 1 sec loop */
- setLoopCount( -1 );
-}
-
-void PixmapAnimator::updateCurrentTime( int msecs )
-{
- int i = msecs / interval;
- if ( i >= pixmaps.count() ) i = pixmaps.count() - 1; /* roundings */
- if ( i != current_frame )
- {
- current_frame = i;
- currentPixmap = pixmaps.at( current_frame );
- emit pixmapReady( *currentPixmap );
- }
-}
-
/* Animated Icon implementation */
SpinningIcon::SpinningIcon( QWidget *parent ) : QLabel( parent )
{
else if( shortClick )
emit shortClicked();
}
+
+YesNoCheckBox::YesNoCheckBox( QWidget *parent ) : QCheckBox( parent )
+{
+ setEnabled( false );
+ setStyleSheet("\
+ QCheckBox::indicator:unchecked:hover,\
+ QCheckBox::indicator:unchecked {\
+ image: url(:/menu/quit);\
+ }\
+ QCheckBox::indicator:checked:hover,\
+ QCheckBox::indicator:checked {\
+ image: url(:/valid);\
+ }\
+ ");
+}