Changeset 176 for smplayer/trunk/src/skingui/skingui.cpp
- Timestamp:
- May 3, 2016, 5:25:45 PM (9 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 175
- Property svn:mergeinfo changed
-
smplayer/trunk/src/skingui/skingui.cpp
r170 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 88 88 statusBar()->hide(); 89 89 90 changeStyleSheet(pref->iconset);90 applyStyles(); 91 91 mediaBarPanel->setVolume(50); 92 92 } … … 94 94 SkinGui::~SkinGui() { 95 95 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_RESOURCES105 Images::setTheme(pref->iconset);106 QString path = ":/" + pref->iconset;107 #else108 QDir current = QDir::current();109 QString td = Images::themesDirectory();110 QString path = current.relativeFilePath(td);111 #endif112 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 }117 96 } 118 97 … … 153 132 viewVideoInfoAct = new MyAction(this, "toggle_video_info_skingui" ); 154 133 viewVideoInfoAct->setCheckable(true); 134 135 scrollTitleAct = new MyAction(this, "toggle_scroll_title_skingui" ); 136 scrollTitleAct->setCheckable(true); 155 137 } 156 138 … … 171 153 volumeslider_action->disable(); 172 154 } 155 #endif // AUTODISABLE_ACTIONS 173 156 174 157 void SkinGui::togglePlayAction(Core::State state) { … … 183 166 } 184 167 } 185 #endif // AUTODISABLE_ACTIONS186 168 187 169 void SkinGui::createMenus() { … … 206 188 statusbar_menu = new QMenu(this); 207 189 statusbar_menu->addAction(viewVideoInfoAct); 190 statusbar_menu->addAction(scrollTitleAct); 208 191 optionsMenu->addMenu(statusbar_menu); 209 192 } … … 226 209 toolbar1->setObjectName("toolbar"); 227 210 toolbar1->setMovable(false); 228 toolbar1->setFixedHeight(35);211 //toolbar1->setFixedHeight(35); 229 212 addToolBar(Qt::TopToolBarArea, toolbar1); 230 213 #if USE_CONFIGURABLE_TOOLBARS … … 317 300 mediaBarPanel, SLOT(setResolutionVisible(bool)) ); 318 301 302 connect( scrollTitleAct, SIGNAL(toggled(bool)), 303 mediaBarPanel, SLOT(setScrollingEnabled(bool)) ); 304 319 305 mediaBarPanelAction = controlwidget->addWidget(mediaBarPanel); 320 306 } … … 420 406 421 407 viewVideoInfoAct->change(Images::icon("view_video_info"), tr("&Video info") ); 408 scrollTitleAct->change(Images::icon("scroll_title"), tr("&Scroll title") ); 422 409 } 423 410 … … 430 417 431 418 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; 433 421 case Core::Paused: mediaBarPanel->displayMessage( tr("Pause") ); break; 434 422 case Core::Stopped: mediaBarPanel->displayMessage( tr("Stop") ); break; 423 case Core::Buffering: /* mediaBarPanel->displayMessage( tr("Buffering...") ); */ break; 435 424 } 436 425 } … … 480 469 floating_control->setActivationArea( (AutohideWidget::Activation) pref->floating_activation_area); 481 470 floating_control->setHideDelay(pref->floating_hide_delay); 482 QTimer::singleShot( 500, floating_control, SLOT(activate()));471 QTimer::singleShot(100, floating_control, SLOT(activate())); 483 472 484 473 … … 540 529 541 530 set->setValue("video_info", viewVideoInfoAct->isChecked()); 531 set->setValue("scroll_title", scrollTitleAct->isChecked()); 542 532 543 533 set->setValue("fullscreen_toolbar1_was_visible", fullscreen_toolbar1_was_visible); … … 562 552 set->setValue("toolbar1_version", TOOLBAR_VERSION); 563 553 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(); 564 561 #endif 565 562 … … 575 572 576 573 viewVideoInfoAct->setChecked(set->value("video_info", false).toBool()); 574 scrollTitleAct->setChecked(set->value("scroll_title", false).toBool()); 577 575 578 576 fullscreen_toolbar1_was_visible = set->value("fullscreen_toolbar1_was_visible", fullscreen_toolbar1_was_visible).toBool(); … … 613 611 #endif 614 612 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(); 615 620 #endif 616 621
Note:
See TracChangeset
for help on using the changeset viewer.