Ignore:
Timestamp:
Aug 31, 2016, 5:31:04 PM (9 years ago)
Author:
Silvan Scherrer
Message:

smplayer: update trunk to version 16.8.0

Location:
smplayer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • smplayer/trunk

  • smplayer/trunk/src/mpcgui/mpcgui.cpp

    r176 r181  
    4545        createStatusBar();
    4646        createFloatingControl();
     47        populateMainMenu();
    4748
    4849        retranslateStrings();
     
    7071        volumeslider_action = createVolumeSliderAction(this);
    7172        volumeslider_action->disable();
    72     volumeslider_action->setCustomStyle( new MpcVolumeSlideStyle() );
    73     volumeslider_action->setFixedSize( QSize(50,18) );
     73        volumeslider_action->setCustomStyle( new MpcVolumeSlideStyle() );
     74        volumeslider_action->setFixedSize( QSize(50,18) );
    7475        volumeslider_action->setTickPosition( QSlider::NoTicks );
    7576#endif
    76 
    77         time_label_action = new TimeLabelAction(this);
    78         time_label_action->setObjectName("timelabel_action");
    79 
    80         connect( this, SIGNAL(timeChanged(QString)),
    81              time_label_action, SLOT(setText(QString)) );
    8277}
    8378
     
    133128void MpcGui::createFloatingControl() {
    134129        // Floating control
    135         floating_control = new AutohideWidget(panel);
     130        floating_control = new AutohideWidget(mplayerwindow);
    136131        floating_control->setAutoHide(true);
    137132        floating_control->hide();
     
    141136        floating_control_time->setAlignment(Qt::AlignRight);
    142137        floating_control_time->setAutoFillBackground(true);
     138        floating_control_time->setObjectName("floating_control_time");
     139#ifdef CHANGE_WIDGET_COLOR
    143140        ColorUtils::setBackgroundColor( floating_control_time, QColor(0,0,0) );
    144141        ColorUtils::setForegroundColor( floating_control_time, QColor(255,255,255) );
    145 
     142#endif
     143
     144        connect(this, SIGNAL(timeChanged(QString)), floating_control_time, SLOT(setText(QString)));
    146145}
    147146
     
    152151        timeslidewidget->setWindowTitle( tr("Seek bar") );
    153152
    154     setupIcons();
     153        setupIcons();
    155154}
    156155
     
    288287
    289288                if (!DesktopInfo::isInsideScreen(this)) {
    290                         move(0,0);
    291                         qWarning("MpcGui::loadConfig: window is outside of the screen, moved to 0x0");
     289                        QPoint tl = DesktopInfo::topLeftPrimaryScreen();
     290                        move(tl);
     291                        qWarning("DefaultGui::loadConfig: window is outside of the screen, moved to %d x %d", tl.x(), tl.y());
    292292                }
    293293        }
     
    316316    playAct->setCheckable(true);
    317317    stopAct->setCheckable(true);
     318
    318319        connect( muteAct, SIGNAL(toggled(bool)),
    319320             this, SLOT(muteIconChange(bool)) );
     
    322323             this, SLOT(updateAudioChannels()) );
    323324
    324     connect( core , SIGNAL(stateChanged(Core::State)),
     325        connect( core , SIGNAL(stateChanged(Core::State)),
    325326             this, SLOT(iconChange(Core::State)) );
    326327}
     
    369370
    370371void MpcGui::createStatusBar() {
    371 
    372372    // remove frames around statusbar items
    373373    statusBar()->setStyleSheet("QStatusBar::item { border: 0px solid black }; ");
     
    381381    audiochannel_display->setMaximumSize(audiochannel_display->sizeHint());
    382382    audiochannel_display->setPixmap( QPixmap("") );
    383    
     383
    384384        time_display = new QLabel( statusBar() );
    385385        time_display->setAlignment(Qt::AlignRight);
    386386        time_display->setText(" 88:88:88 / 88:88:88 ");
    387387        time_display->setMinimumSize(time_display->sizeHint());
    388     time_display->setContentsMargins(15,2,1,1);
     388        time_display->setContentsMargins(15,2,1,1);
    389389
    390390        frame_display = new QLabel( statusBar() );
     
    392392        frame_display->setText("88888888");
    393393        frame_display->setMinimumSize(frame_display->sizeHint());
    394     frame_display->setContentsMargins(15,2,1,1);
    395 
    396         statusBar()->setAutoFillBackground(TRUE);   
    397 
     394        frame_display->setContentsMargins(15,2,1,1);
     395
     396        statusBar()->setAutoFillBackground(true);
     397
     398#ifdef CHANGE_WIDGET_COLOR
    398399        ColorUtils::setBackgroundColor( statusBar(), QColor(0,0,0) );
    399400        ColorUtils::setForegroundColor( statusBar(), QColor(255,255,255) );
     
    404405        ColorUtils::setBackgroundColor( audiochannel_display, QColor(0,0,0) );
    405406        ColorUtils::setForegroundColor( audiochannel_display, QColor(255,255,255) );
    406         statusBar()->setSizeGripEnabled(FALSE);
    407 
    408    
     407#endif
     408
     409        statusBar()->setSizeGripEnabled(false);
    409410
    410411        statusBar()->addPermanentWidget( frame_display, 0 );
    411412        frame_display->setText( "0" );
    412413
    413     statusBar()->addPermanentWidget( time_display, 0 );
     414        statusBar()->addPermanentWidget( time_display, 0 );
    414415        time_display->setText(" 00:00:00 / 00:00:00 ");
    415416
    416     statusBar()->addPermanentWidget( audiochannel_display, 0 );
     417        statusBar()->addPermanentWidget( audiochannel_display, 0 );
    417418
    418419        time_display->show();
    419420        frame_display->hide();
    420421
    421         connect( this, SIGNAL(timeChanged(QString)),
    422              this, SLOT(displayTime(QString)) );
    423 
    424         connect( this, SIGNAL(frameChanged(int)),
    425              this, SLOT(displayFrame(int)) );
    426 }
    427 
    428 void MpcGui::displayTime(QString text) {
    429         time_display->setText( text );
    430         time_label_action->setText(text );
    431         floating_control_time->setText(text);
     422        connect(this, SIGNAL(timeChanged(QString)), time_display, SLOT(setText(QString)));
     423        connect(this, SIGNAL(frameChanged(int)), this, SLOT(displayFrame(int)));
    432424}
    433425
     
    452444        !pref->compact_mode )
    453445    {
    454             controlwidget->show();
     446        controlwidget->show();
    455447        timeslidewidget->show();
    456448        statusBar()->show();
     
    501493
    502494void MpcGui::updateWidgets() {
    503 
    504     BaseGui::updateWidgets();
     495        BaseGui::updateWidgets();
    505496
    506497        // Frame counter
Note: See TracChangeset for help on using the changeset viewer.