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:
5 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
  • smplayer/trunk/src/mpcgui/mpcgui.h

    r176 r181  
    2727class TimeSliderAction;
    2828class VolumeSliderAction;
    29 class TimeLabelAction;
    3029class AutohideWidget;
    3130class QSpacerItem;
     
    4948    void updateAudioChannels();
    5049
    51     void displayTime(QString text);
    5250    void displayFrame(int frame);
    5351    void showFullscreenControls();
     
    9896        VolumeSliderAction * volumeslider_action;
    9997#endif
    100         TimeLabelAction * time_label_action;
    10198};
    10299
  • smplayer/trunk/src/mpcgui/mpcstyles.cpp

    r139 r181  
    1919#include "mpcstyles.h"
    2020
    21 #include <QWindowsStyle>
     21#include <QProxyStyle>
    2222#include <QStyleOptionToolBar>
    2323#include <QSlider>
    2424#include <QPainter>
    25 
     25#include <qdrawutil.h>
    2626
    2727void
     
    7979            else
    8080            {
    81                 QWindowsStyle::drawControl(control,toolbar, painter, widget);
     81                QProxyStyle::drawControl(control,toolbar, painter, widget);
    8282            }
    8383        }
     
    8585    else
    8686    {
    87         QWindowsStyle::drawControl(control,option, painter, widget);
     87        QProxyStyle::drawControl(control,option, painter, widget);
    8888    }
    8989}
     
    109109                            };
    110110                    QPen oldPen = p->pen();
    111                    
     111
    112112                    p->setPen(slider->palette.dark().color());
    113113                    p->drawLine(QPoint(points[0].x(), points[0].y() -2 ),QPoint(points[2].x(), points[2].y()));
     
    128128
    129129            if (slider->subControls & SC_SliderHandle) {
     130                /*
    130131                const QColor c0 = slider->palette.shadow().color();
    131132                const QColor c1 = slider->palette.dark().color();
     
    133134                const QColor c3 = slider->palette.midlight().color();
    134135                const QColor c4 = slider->palette.light().color();
     136                */
    135137                QBrush handleBrush;
    136138
     
    164166    else
    165167    {
    166         QWindowsStyle::drawComplexControl(cc,opt,p,widget);
     168        QProxyStyle::drawComplexControl(cc,opt,p,widget);
    167169    }
    168170}
     
    197199
    198200            if (slider->subControls & SC_SliderHandle) {
     201                /*
    199202                const QColor c0 = slider->palette.shadow().color();
    200203                const QColor c1 = slider->palette.dark().color();
     
    202205                const QColor c3 = slider->palette.midlight().color();
    203206                const QColor c4 = slider->palette.light().color();
     207                */
    204208                QBrush handleBrush;
    205209
     
    234238    else
    235239    {
    236         QWindowsStyle::drawComplexControl(cc,opt,p,widget);
     240        QProxyStyle::drawComplexControl(cc,opt,p,widget);
    237241    }
    238242}
  • smplayer/trunk/src/mpcgui/mpcstyles.h

    r176 r181  
    2020#define MPC_STYLES_H
    2121
    22 #include <QWindowsStyle>
     22#include <QProxyStyle>
    2323#include <QStyleOptionToolBar>
     24#include <QStyleFactory>
    2425
    2526enum QSliderDirection { SlUp, SlDown, SlLeft, SlRight };
    2627
    27 class MpcToolbarStyle : public QWindowsStyle
     28class MpcToolbarStyle : public QProxyStyle
    2829{
    2930    Q_OBJECT
    3031
    3132public:
    32     MpcToolbarStyle() {};
     33    MpcToolbarStyle() { setBaseStyle(QStyleFactory::create("windows")); };
    3334    void drawControl(ControlElement control, const QStyleOption *option,
    3435                      QPainter *painter, const QWidget *widget) const;
    3536};
    3637
    37 class MpcTimeSlideStyle : public QWindowsStyle
     38class MpcTimeSlideStyle : public QProxyStyle
    3839{
    3940    Q_OBJECT
    4041
    4142public:
    42     MpcTimeSlideStyle() {};
     43    MpcTimeSlideStyle() { setBaseStyle(QStyleFactory::create("windows")); };
    4344    void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
    4445                                       QPainter *p, const QWidget *widget) const;
    4546};
    4647
    47 class MpcVolumeSlideStyle : public QWindowsStyle
     48class MpcVolumeSlideStyle : public QProxyStyle
    4849{
    4950    Q_OBJECT
    5051
    5152public:
    52     MpcVolumeSlideStyle() {};
     53    MpcVolumeSlideStyle() { setBaseStyle(QStyleFactory::create("windows")); };
    5354    void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
    5455                                       QPainter *p, const QWidget *widget) const;
Note: See TracChangeset for help on using the changeset viewer.