author | simon <simon> | 2002-12-09 21:43:32 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 21:43:32 (UTC) |
commit | 40ff6884f079a55fcf219b2d032c7be4da385bc1 (patch) (unidiff) | |
tree | fd13c702652ee0f22201eb6145b10e67f9580aeb /noncore/multimedia/opieplayer2/videowidget.cpp | |
parent | a9015ff25ddec67983f78f2a75346f21b7d062c5 (diff) | |
download | opie-40ff6884f079a55fcf219b2d032c7be4da385bc1.zip opie-40ff6884f079a55fcf219b2d032c7be4da385bc1.tar.gz opie-40ff6884f079a55fcf219b2d032c7be4da385bc1.tar.bz2 |
- hah, the improved design pays off :) switching skins at run-time now
only reloads the pixmaps and no more requires a restart or re-creation
of the audio/video widgets and the xine control (which involved slow
xine initialization)
Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index d1efaad..a03d43e 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -81,3 +81,2 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye | |||
81 | 81 | ||
82 | |||
83 | videoFrame = new XineVideoWidget ( this, "Video frame" ); | 82 | videoFrame = new XineVideoWidget ( this, "Video frame" ); |
@@ -87,22 +86,5 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye | |||
87 | 86 | ||
88 | Config cfg("OpiePlayer"); | 87 | slider = 0; |
89 | cfg.setGroup("Options"); | ||
90 | skin = cfg.readEntry("Skin","default"); | ||
91 | 88 | ||
92 | QString skinPath = "opieplayer2/skins/" + skin; | 89 | loadSkin(); |
93 | backgroundPixmap = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); | ||
94 | imgUp = QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) ); | ||
95 | imgDn = QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) ); | ||
96 | |||
97 | setupButtons( skinInfo, buttonCount, QPEApplication::qpeDir() + "/pics/" + skinPath + "/skinV_mask_", imgUp.size() ); | ||
98 | |||
99 | setBackgroundPixmap( backgroundPixmap ); | ||
100 | |||
101 | slider = new QSlider( Qt::Horizontal, this ); | ||
102 | slider->setMinValue( 0 ); | ||
103 | slider->setMaxValue( 1 ); | ||
104 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); | ||
105 | //slider->setFocusPolicy( QWidget::NoFocus ); | ||
106 | |||
107 | resizeEvent( NULL ); | ||
108 | 90 | ||
@@ -203,2 +185,27 @@ void VideoWidget::setDisplayType( MediaPlayerState::DisplayType displayType ) | |||
203 | 185 | ||
186 | void VideoWidget::loadSkin() | ||
187 | { | ||
188 | Config cfg("OpiePlayer"); | ||
189 | cfg.setGroup("Options"); | ||
190 | skin = cfg.readEntry("Skin","default"); | ||
191 | |||
192 | QString skinPath = "opieplayer2/skins/" + skin; | ||
193 | backgroundPixmap = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); | ||
194 | imgUp = QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) ); | ||
195 | imgDn = QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) ); | ||
196 | |||
197 | setupButtons( skinInfo, buttonCount, QPEApplication::qpeDir() + "/pics/" + skinPath + "/skinV_mask_", imgUp.size() ); | ||
198 | |||
199 | setBackgroundPixmap( backgroundPixmap ); | ||
200 | |||
201 | delete slider; | ||
202 | slider = new QSlider( Qt::Horizontal, this ); | ||
203 | slider->setMinValue( 0 ); | ||
204 | slider->setMaxValue( 1 ); | ||
205 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); | ||
206 | //slider->setFocusPolicy( QWidget::NoFocus ); | ||
207 | |||
208 | resizeEvent( 0 ); | ||
209 | } | ||
210 | |||
204 | void VideoWidget::updateSlider( long i, long max ) { | 211 | void VideoWidget::updateSlider( long i, long max ) { |