Commit 4510ffa7 authored by Petri Hintukainen's avatar Petri Hintukainen Committed by Jean-Baptiste Kempf

qt: show menu button even if there are no chapters

Move chapter buttons and menu buttons to separate frames.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent b434daa8
...@@ -372,7 +372,6 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options ) ...@@ -372,7 +372,6 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
break; break;
case MENU_BUTTONS: case MENU_BUTTONS:
widget = discFrame(); widget = discFrame();
widget->hide();
break; break;
case TELETEXT_BUTTONS: case TELETEXT_BUTTONS:
widget = telexFrame(); widget = telexFrame();
...@@ -539,29 +538,44 @@ QFrame *AbstractController::discFrame() ...@@ -539,29 +538,44 @@ QFrame *AbstractController::discFrame()
QHBoxLayout *discLayout = new QHBoxLayout( discFrame ); QHBoxLayout *discLayout = new QHBoxLayout( discFrame );
discLayout->setSpacing( 0 ); discLayout->setMargin( 0 ); discLayout->setSpacing( 0 ); discLayout->setMargin( 0 );
QToolButton *prevSectionButton = new QToolButton( discFrame );
QFrame *chapFrame = new QFrame( discFrame );
QHBoxLayout *chapLayout = new QHBoxLayout( chapFrame );
chapLayout->setSpacing( 0 ); chapLayout->setMargin( 0 );
QToolButton *prevSectionButton = new QToolButton( chapFrame );
setupButton( prevSectionButton ); setupButton( prevSectionButton );
BUTTON_SET_BAR2( prevSectionButton, toolbar/dvd_prev, BUTTON_SET_BAR2( prevSectionButton, toolbar/dvd_prev,
qtr("Previous Chapter/Title" ) ); qtr("Previous Chapter/Title" ) );
discLayout->addWidget( prevSectionButton ); chapLayout->addWidget( prevSectionButton );
QToolButton *menuButton = new QToolButton( discFrame );
setupButton( menuButton );
discLayout->addWidget( menuButton );
BUTTON_SET_BAR2( menuButton, toolbar/dvd_menu, qtr( "Menu" ) );
QToolButton *nextSectionButton = new QToolButton( discFrame ); QToolButton *nextSectionButton = new QToolButton( chapFrame );
setupButton( nextSectionButton ); setupButton( nextSectionButton );
discLayout->addWidget( nextSectionButton );
BUTTON_SET_BAR2( nextSectionButton, toolbar/dvd_next, BUTTON_SET_BAR2( nextSectionButton, toolbar/dvd_next,
qtr("Next Chapter/Title" ) ); qtr("Next Chapter/Title" ) );
chapLayout->addWidget( nextSectionButton );
discLayout->addWidget( chapFrame );
chapFrame->hide();
QFrame *menuFrame = new QFrame( discFrame );
QHBoxLayout *menuLayout = new QHBoxLayout( menuFrame );
menuLayout->setSpacing( 0 ); menuLayout->setMargin( 0 );
QToolButton *menuButton = new QToolButton( menuFrame );
setupButton( menuButton );
menuLayout->addWidget( menuButton );
BUTTON_SET_BAR2( menuButton, toolbar/dvd_menu, qtr( "Menu" ) );
discLayout->addWidget( menuFrame );
menuFrame->hide();
/* Change the navigation button display when the IM /* Change the navigation button display when the IM
navigation changes */ navigation changes */
CONNECT( THEMIM->getIM(), chapterChanged( bool ), CONNECT( THEMIM->getIM(), chapterChanged( bool ),
discFrame, setVisible( bool ) ); chapFrame, setVisible( bool ) );
CONNECT( THEMIM->getIM(), titleChanged( bool ), CONNECT( THEMIM->getIM(), titleChanged( bool ),
menuButton, setVisible( bool ) ); menuFrame, setVisible( bool ) );
/* Changes the IM navigation when triggered on the nav buttons */ /* Changes the IM navigation when triggered on the nav buttons */
CONNECT( prevSectionButton, clicked(), THEMIM->getIM(), CONNECT( prevSectionButton, clicked(), THEMIM->getIM(),
sectionPrev() ); sectionPrev() );
......
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