Commit 2ec741cc authored by Clément Stenac's avatar Clément Stenac

Cleanup

parent f183c686
...@@ -47,6 +47,10 @@ ...@@ -47,6 +47,10 @@
#define PREF_H 125 #define PREF_H 125
#endif #endif
#define BUTTON_SET( button, image, tooltip ) ui.button##Button->setText(""); \
ui.button##Button->setIcon( QIcon( ":/pixmaps/"#image ) ); \
ui.button##Button->setToolTip( tooltip );
static int InteractCallback( vlc_object_t *, const char *, vlc_value_t, static int InteractCallback( vlc_object_t *, const char *, vlc_value_t,
vlc_value_t, void *); vlc_value_t, void *);
/* Video handling */ /* Video handling */
...@@ -137,6 +141,10 @@ void MainInterface::handleMainUi( QSettings *settings ) ...@@ -137,6 +141,10 @@ void MainInterface::handleMainUi( QSettings *settings )
slider = new InputSlider( Qt::Horizontal, NULL ); slider = new InputSlider( Qt::Horizontal, NULL );
ui.hboxLayout->insertWidget( 0, slider ); ui.hboxLayout->insertWidget( 0, slider );
BUTTON_SET( prev, previous.png, qtr( "Previous" ) );
BUTTON_SET( next, next.png , qtr( "Next" ) );
BUTTON_SET( play, play.png , qtr( "Play" ) );
BUTTON_SET( stop, stop.png , qtr( "Stop" ) );
ui.discFrame->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); ui.discFrame->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
#define SET( button, image ) ui.button##Button->setText(""); \ #define SET( button, image ) ui.button##Button->setText(""); \
...@@ -165,6 +173,9 @@ void MainInterface::handleMainUi( QSettings *settings ) ...@@ -165,6 +173,9 @@ void MainInterface::handleMainUi( QSettings *settings )
playlistEmbeddedFlag = true; playlistEmbeddedFlag = true;
/// \todo fetch playlist settings /// \todo fetch playlist settings
BUTTON_SET( playlist, volume-low.png, playlistEmbeddedFlag ?
qtr( "Show playlist" ) :
qtr( "Open playlist" ) );
/* Set initial size */ /* Set initial size */
resize ( PREF_W, PREF_H ); resize ( PREF_W, PREF_H );
...@@ -173,7 +184,7 @@ void MainInterface::handleMainUi( QSettings *settings ) ...@@ -173,7 +184,7 @@ void MainInterface::handleMainUi( QSettings *settings )
if( videoEmbeddedFlag ) if( videoEmbeddedFlag )
{ {
videoWidget = new VideoWidget( p_intf ); videoWidget = new VideoWidget( p_intf );
videoWidget->widgetSize = QSize( 1, 1 ); videoWidget->widgetSize = QSize( PREF_W, 1 );
videoWidget->resize( videoWidget->widgetSize ); videoWidget->resize( videoWidget->widgetSize );
videoWidget->hide(); videoWidget->hide();
ui.vboxLayout->insertWidget( 0, videoWidget ); ui.vboxLayout->insertWidget( 0, videoWidget );
...@@ -194,6 +205,7 @@ void MainInterface::handleMainUi( QSettings *settings ) ...@@ -194,6 +205,7 @@ void MainInterface::handleMainUi( QSettings *settings )
// visualSelector->hide(); // visualSelector->hide();
calculateInterfaceSize(); calculateInterfaceSize();
fprintf( stderr, "Resize to %ix%i\n", mainSize.width(), mainSize.height() );
resize( mainSize ); resize( mainSize );
mainSize = size(); mainSize = size();
...@@ -225,6 +237,11 @@ void MainInterface::calculateInterfaceSize() ...@@ -225,6 +237,11 @@ void MainInterface::calculateInterfaceSize()
height = videoWidget->widgetSize.height(); height = videoWidget->widgetSize.height();
fprintf( stderr, "Video Size %ix%i\n", videoWidget->widgetSize.width(), videoWidget->widgetSize.height() ); fprintf( stderr, "Video Size %ix%i\n", videoWidget->widgetSize.width(), videoWidget->widgetSize.height() );
} }
else
{
width = PREF_W - addSize.width();
height = PREF_H - addSize.height();
}
mainSize.setWidth( width + addSize.width() ); mainSize.setWidth( width + addSize.width() );
mainSize.setHeight( height + addSize.height() ); mainSize.setHeight( height + addSize.height() );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment