Ignore:
Timestamp:
May 3, 2016, 5:25:45 PM (9 years ago)
Author:
Silvan Scherrer
Message:

smplayer: update trunk to version 16.4

Location:
smplayer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • smplayer/trunk

  • smplayer/trunk/src/skingui/skingui.cpp

    r170 r176  
    11/*  smplayer, GUI front-end for mplayer.
    2     Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net>
     2    Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net>
    33
    44    This program is free software; you can redistribute it and/or modify
     
    8888        statusBar()->hide();
    8989
    90         changeStyleSheet(pref->iconset);
     90        applyStyles();
    9191        mediaBarPanel->setVolume(50);
    9292}
     
    9494SkinGui::~SkinGui() {
    9595        saveConfig();
    96 }
    97 
    98 void SkinGui::changeStyleSheet(QString style) {
    99         if (style.isEmpty())  {
    100                 qApp->setStyleSheet("");
    101         }
    102         else {
    103                 QString qss = Images::styleSheet();
    104 #ifdef USE_RESOURCES
    105                 Images::setTheme(pref->iconset);
    106                 QString path = ":/" + pref->iconset;
    107 #else
    108                 QDir current = QDir::current();
    109                 QString td = Images::themesDirectory();
    110                 QString path = current.relativeFilePath(td);
    111 #endif
    112                 qss.replace(QRegExp("url\\s*\\(\\s*([^\\);]+)\\s*\\)", Qt::CaseSensitive, QRegExp::RegExp2),
    113                                                         QString("url(%1\\1)").arg(path + "/"));
    114                 //qDebug("SkinGui::changeStyleSheet: qss: %s", qss.toLatin1().constData());
    115                 qApp->setStyleSheet(qss);
    116         }
    11796}
    11897
     
    153132        viewVideoInfoAct = new MyAction(this, "toggle_video_info_skingui" );
    154133        viewVideoInfoAct->setCheckable(true);
     134
     135        scrollTitleAct = new MyAction(this, "toggle_scroll_title_skingui" );
     136        scrollTitleAct->setCheckable(true);
    155137}
    156138
     
    171153        volumeslider_action->disable();
    172154}
     155#endif // AUTODISABLE_ACTIONS
    173156
    174157void SkinGui::togglePlayAction(Core::State state) {
     
    183166        }
    184167}
    185 #endif // AUTODISABLE_ACTIONS
    186168
    187169void SkinGui::createMenus() {
     
    206188        statusbar_menu = new QMenu(this);
    207189        statusbar_menu->addAction(viewVideoInfoAct);
     190        statusbar_menu->addAction(scrollTitleAct);
    208191        optionsMenu->addMenu(statusbar_menu);
    209192}
     
    226209        toolbar1->setObjectName("toolbar");
    227210        toolbar1->setMovable(false);
    228         toolbar1->setFixedHeight(35);
     211        //toolbar1->setFixedHeight(35);
    229212        addToolBar(Qt::TopToolBarArea, toolbar1);
    230213#if USE_CONFIGURABLE_TOOLBARS
     
    317300             mediaBarPanel, SLOT(setResolutionVisible(bool)) );
    318301
     302        connect( scrollTitleAct, SIGNAL(toggled(bool)),
     303             mediaBarPanel, SLOT(setScrollingEnabled(bool)) );
     304
    319305        mediaBarPanelAction = controlwidget->addWidget(mediaBarPanel);
    320306}
     
    420406
    421407        viewVideoInfoAct->change(Images::icon("view_video_info"), tr("&Video info") );
     408        scrollTitleAct->change(Images::icon("scroll_title"), tr("&Scroll title") );
    422409}
    423410
     
    430417
    431418        switch (state) {
    432                 case Core::Playing:             mediaBarPanel->displayMessage( tr("Playing %1").arg(core->mdat.filename)); break;
     419                //case Core::Playing:           mediaBarPanel->displayMessage( tr("Playing %1").arg(core->mdat.filename)); break;
     420                case Core::Playing:             mediaBarPanel->displayMessage( tr("Playing") ); break;
    433421                case Core::Paused:              mediaBarPanel->displayMessage( tr("Pause") ); break;
    434422                case Core::Stopped:             mediaBarPanel->displayMessage( tr("Stop") ); break;
     423                case Core::Buffering:   /* mediaBarPanel->displayMessage( tr("Buffering...") ); */ break;
    435424        }
    436425}
     
    480469        floating_control->setActivationArea( (AutohideWidget::Activation) pref->floating_activation_area);
    481470        floating_control->setHideDelay(pref->floating_hide_delay);
    482         QTimer::singleShot(500, floating_control, SLOT(activate()));
     471        QTimer::singleShot(100, floating_control, SLOT(activate()));
    483472
    484473
     
    540529
    541530        set->setValue("video_info", viewVideoInfoAct->isChecked());
     531        set->setValue("scroll_title", scrollTitleAct->isChecked());
    542532
    543533        set->setValue("fullscreen_toolbar1_was_visible", fullscreen_toolbar1_was_visible);
     
    562552        set->setValue("toolbar1_version", TOOLBAR_VERSION);
    563553        set->endGroup();
     554
     555        set->beginGroup("toolbars_icon_size");
     556        set->setValue("toolbar1", toolbar1->iconSize());
     557        #if defined(SKIN_EDITABLE_CONTROL)
     558        set->setValue("floating_control", iw->iconSize());
     559        #endif
     560        set->endGroup();
    564561#endif
    565562
     
    575572
    576573        viewVideoInfoAct->setChecked(set->value("video_info", false).toBool());
     574        scrollTitleAct->setChecked(set->value("scroll_title", false).toBool());
    577575
    578576        fullscreen_toolbar1_was_visible = set->value("fullscreen_toolbar1_was_visible", fullscreen_toolbar1_was_visible).toBool();
     
    613611        #endif
    614612        set->endGroup();
     613
     614        set->beginGroup("toolbars_icon_size");
     615        toolbar1->setIconSize(set->value("toolbar1", toolbar1->iconSize()).toSize());
     616        #if defined(SKIN_EDITABLE_CONTROL)
     617        iw->setIconSize(set->value("floating_control", iw->iconSize()).toSize());
     618        #endif
     619        set->endGroup();
    615620#endif
    616621
Note: See TracChangeset for help on using the changeset viewer.