Changeset 181 for smplayer/trunk/src/mpcgui
- Timestamp:
- Aug 31, 2016, 5:31:04 PM (9 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 179
- Property svn:mergeinfo changed
-
smplayer/trunk/src/mpcgui/mpcgui.cpp
r176 r181 45 45 createStatusBar(); 46 46 createFloatingControl(); 47 populateMainMenu(); 47 48 48 49 retranslateStrings(); … … 70 71 volumeslider_action = createVolumeSliderAction(this); 71 72 volumeslider_action->disable(); 72 73 73 volumeslider_action->setCustomStyle( new MpcVolumeSlideStyle() ); 74 volumeslider_action->setFixedSize( QSize(50,18) ); 74 75 volumeslider_action->setTickPosition( QSlider::NoTicks ); 75 76 #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)) );82 77 } 83 78 … … 133 128 void MpcGui::createFloatingControl() { 134 129 // Floating control 135 floating_control = new AutohideWidget( panel);130 floating_control = new AutohideWidget(mplayerwindow); 136 131 floating_control->setAutoHide(true); 137 132 floating_control->hide(); … … 141 136 floating_control_time->setAlignment(Qt::AlignRight); 142 137 floating_control_time->setAutoFillBackground(true); 138 floating_control_time->setObjectName("floating_control_time"); 139 #ifdef CHANGE_WIDGET_COLOR 143 140 ColorUtils::setBackgroundColor( floating_control_time, QColor(0,0,0) ); 144 141 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))); 146 145 } 147 146 … … 152 151 timeslidewidget->setWindowTitle( tr("Seek bar") ); 153 152 154 153 setupIcons(); 155 154 } 156 155 … … 288 287 289 288 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()); 292 292 } 293 293 } … … 316 316 playAct->setCheckable(true); 317 317 stopAct->setCheckable(true); 318 318 319 connect( muteAct, SIGNAL(toggled(bool)), 319 320 this, SLOT(muteIconChange(bool)) ); … … 322 323 this, SLOT(updateAudioChannels()) ); 323 324 324 325 connect( core , SIGNAL(stateChanged(Core::State)), 325 326 this, SLOT(iconChange(Core::State)) ); 326 327 } … … 369 370 370 371 void MpcGui::createStatusBar() { 371 372 372 // remove frames around statusbar items 373 373 statusBar()->setStyleSheet("QStatusBar::item { border: 0px solid black }; "); … … 381 381 audiochannel_display->setMaximumSize(audiochannel_display->sizeHint()); 382 382 audiochannel_display->setPixmap( QPixmap("") ); 383 383 384 384 time_display = new QLabel( statusBar() ); 385 385 time_display->setAlignment(Qt::AlignRight); 386 386 time_display->setText(" 88:88:88 / 88:88:88 "); 387 387 time_display->setMinimumSize(time_display->sizeHint()); 388 388 time_display->setContentsMargins(15,2,1,1); 389 389 390 390 frame_display = new QLabel( statusBar() ); … … 392 392 frame_display->setText("88888888"); 393 393 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 398 399 ColorUtils::setBackgroundColor( statusBar(), QColor(0,0,0) ); 399 400 ColorUtils::setForegroundColor( statusBar(), QColor(255,255,255) ); … … 404 405 ColorUtils::setBackgroundColor( audiochannel_display, QColor(0,0,0) ); 405 406 ColorUtils::setForegroundColor( audiochannel_display, QColor(255,255,255) ); 406 statusBar()->setSizeGripEnabled(FALSE); 407 408 407 #endif 408 409 statusBar()->setSizeGripEnabled(false); 409 410 410 411 statusBar()->addPermanentWidget( frame_display, 0 ); 411 412 frame_display->setText( "0" ); 412 413 413 414 statusBar()->addPermanentWidget( time_display, 0 ); 414 415 time_display->setText(" 00:00:00 / 00:00:00 "); 415 416 416 417 statusBar()->addPermanentWidget( audiochannel_display, 0 ); 417 418 418 419 time_display->show(); 419 420 frame_display->hide(); 420 421 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))); 432 424 } 433 425 … … 452 444 !pref->compact_mode ) 453 445 { 454 446 controlwidget->show(); 455 447 timeslidewidget->show(); 456 448 statusBar()->show(); … … 501 493 502 494 void MpcGui::updateWidgets() { 503 504 BaseGui::updateWidgets(); 495 BaseGui::updateWidgets(); 505 496 506 497 // Frame counter -
smplayer/trunk/src/mpcgui/mpcgui.h
r176 r181 27 27 class TimeSliderAction; 28 28 class VolumeSliderAction; 29 class TimeLabelAction;30 29 class AutohideWidget; 31 30 class QSpacerItem; … … 49 48 void updateAudioChannels(); 50 49 51 void displayTime(QString text);52 50 void displayFrame(int frame); 53 51 void showFullscreenControls(); … … 98 96 VolumeSliderAction * volumeslider_action; 99 97 #endif 100 TimeLabelAction * time_label_action;101 98 }; 102 99 -
smplayer/trunk/src/mpcgui/mpcstyles.cpp
r139 r181 19 19 #include "mpcstyles.h" 20 20 21 #include <Q WindowsStyle>21 #include <QProxyStyle> 22 22 #include <QStyleOptionToolBar> 23 23 #include <QSlider> 24 24 #include <QPainter> 25 25 #include <qdrawutil.h> 26 26 27 27 void … … 79 79 else 80 80 { 81 Q WindowsStyle::drawControl(control,toolbar, painter, widget);81 QProxyStyle::drawControl(control,toolbar, painter, widget); 82 82 } 83 83 } … … 85 85 else 86 86 { 87 Q WindowsStyle::drawControl(control,option, painter, widget);87 QProxyStyle::drawControl(control,option, painter, widget); 88 88 } 89 89 } … … 109 109 }; 110 110 QPen oldPen = p->pen(); 111 111 112 112 p->setPen(slider->palette.dark().color()); 113 113 p->drawLine(QPoint(points[0].x(), points[0].y() -2 ),QPoint(points[2].x(), points[2].y())); … … 128 128 129 129 if (slider->subControls & SC_SliderHandle) { 130 /* 130 131 const QColor c0 = slider->palette.shadow().color(); 131 132 const QColor c1 = slider->palette.dark().color(); … … 133 134 const QColor c3 = slider->palette.midlight().color(); 134 135 const QColor c4 = slider->palette.light().color(); 136 */ 135 137 QBrush handleBrush; 136 138 … … 164 166 else 165 167 { 166 Q WindowsStyle::drawComplexControl(cc,opt,p,widget);168 QProxyStyle::drawComplexControl(cc,opt,p,widget); 167 169 } 168 170 } … … 197 199 198 200 if (slider->subControls & SC_SliderHandle) { 201 /* 199 202 const QColor c0 = slider->palette.shadow().color(); 200 203 const QColor c1 = slider->palette.dark().color(); … … 202 205 const QColor c3 = slider->palette.midlight().color(); 203 206 const QColor c4 = slider->palette.light().color(); 207 */ 204 208 QBrush handleBrush; 205 209 … … 234 238 else 235 239 { 236 Q WindowsStyle::drawComplexControl(cc,opt,p,widget);240 QProxyStyle::drawComplexControl(cc,opt,p,widget); 237 241 } 238 242 } -
smplayer/trunk/src/mpcgui/mpcstyles.h
r176 r181 20 20 #define MPC_STYLES_H 21 21 22 #include <Q WindowsStyle>22 #include <QProxyStyle> 23 23 #include <QStyleOptionToolBar> 24 #include <QStyleFactory> 24 25 25 26 enum QSliderDirection { SlUp, SlDown, SlLeft, SlRight }; 26 27 27 class MpcToolbarStyle : public Q WindowsStyle28 class MpcToolbarStyle : public QProxyStyle 28 29 { 29 30 Q_OBJECT 30 31 31 32 public: 32 MpcToolbarStyle() { };33 MpcToolbarStyle() { setBaseStyle(QStyleFactory::create("windows")); }; 33 34 void drawControl(ControlElement control, const QStyleOption *option, 34 35 QPainter *painter, const QWidget *widget) const; 35 36 }; 36 37 37 class MpcTimeSlideStyle : public Q WindowsStyle38 class MpcTimeSlideStyle : public QProxyStyle 38 39 { 39 40 Q_OBJECT 40 41 41 42 public: 42 MpcTimeSlideStyle() { };43 MpcTimeSlideStyle() { setBaseStyle(QStyleFactory::create("windows")); }; 43 44 void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, 44 45 QPainter *p, const QWidget *widget) const; 45 46 }; 46 47 47 class MpcVolumeSlideStyle : public Q WindowsStyle48 class MpcVolumeSlideStyle : public QProxyStyle 48 49 { 49 50 Q_OBJECT 50 51 51 52 public: 52 MpcVolumeSlideStyle() { };53 MpcVolumeSlideStyle() { setBaseStyle(QStyleFactory::create("windows")); }; 53 54 void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, 54 55 QPainter *p, const QWidget *widget) const;
Note:
See TracChangeset
for help on using the changeset viewer.