List Info

Thread: extragear/multimedia/kmplayer/src




extragear/multimedia/kmplayer/src
user name
2006-02-15 18:09:11
SVN commit 509855 by vriezen:

When setPalette is set on the container widget, make sure to
update the
controlpanel's icons.

CCMAIL: kfm-develkde.org

On uitzendinggemist.nl (moz UA only), the plugin's widget
gets a setPalette
w/ a foreground color of #ffffff and bgcolor of #efefef
(latter likely my
normal bg color). In khtml::RenderWidget::updateFromElement
there is no
code to prevent this for non-khtml type of widgets.
The question is, should they get these setPalette calls and,
if so, where
does the above go wrong (the pictures and text are hardly
readable)?
Note that kmplayer can handle these calls nicely, though
does expect a
palette with some contrast.



 M  +25 -4     kmplayercontrolpanel.cpp  
 M  +2 -1      kmplayercontrolpanel.h  
 M  +8 -0      kmplayerview.cpp  
 M  +1 -0      kmplayerview.h  


---
trunk/extragear/multimedia/kmplayer/src/kmplayercontrolpanel
.cpp #509854:509855
 -357,10
+357,10 
     m_buttons[button_config] = new KMPlayerMenuButton
(this, m_buttonbox, config_xpm);
     m_buttons[button_playlist] = ctrlButton (this,
m_buttonbox, playlist_xpm);
     m_buttons[button_back] = ctrlButton (this, m_buttonbox,
back_xpm);
-    m_buttons[button_play] = ctrlButton (this, m_buttonbox,
play_xpm, Qt::Key_R);
+    m_buttons[button_play] = ctrlButton(this, m_buttonbox,
play_xpm, Qt::Key_R);
     m_buttons[button_forward] = ctrlButton (this,
m_buttonbox, forward_xpm);
-    m_buttons[button_stop] = ctrlButton (this, m_buttonbox,
stop_xpm, Qt::Key_S);
-    m_buttons[button_pause] = ctrlButton (this,
m_buttonbox, pause_xpm, Qt::Key_P);
+    m_buttons[button_stop] = ctrlButton(this, m_buttonbox,
stop_xpm, Qt::Key_S);
+    m_buttons[button_pause]=ctrlButton(this, m_buttonbox,
pause_xpm, Qt::Key_P);
     m_buttons[button_record] = ctrlButton (this,
m_buttonbox, record_xpm);
     m_buttons[button_broadcast] = ctrlButton (this,
m_buttonbox, broadcast_xpm);
     m_buttons[button_language] = new KMPlayerMenuButton
(this, m_buttonbox, language_xpm);
 -390,7
+390,7 
     m_zoomMenu->insertItem (i18n ("100%"),
menu_zoom100);
     m_zoomMenu->insertItem (i18n ("150%"),
menu_zoom150);
     m_popupMenu->insertItem (KGlobal::iconLoader
()->loadIconSet (QString ("viewmag"),
KIcon::Small, 0, false), i18n ("&Zoom"),
m_zoomMenu, menu_zoom);
-    m_popupMenu->insertItem (KGlobal::iconLoader
()->loadIconSet (QString
("window_fullscreen"), KIcon::Small, 0, true),
i18n ("&Full Screen"), menu_fullscreen);
+    m_popupMenu->insertItem
(KGlobal::iconLoader()->loadIconSet (QString
("window_fullscreen"), KIcon::Small, 0, true),
i18n ("&Full Screen"), menu_fullscreen);
     m_popupMenu->setAccel (QKeySequence (Qt::Key_F),
menu_fullscreen);
     m_popupMenu->insertSeparator ();
     m_colorMenu = new KMPlayerPopupMenu (this);
 -436,6
+436,27 
     connect (m_audioMenu, SIGNAL (mouseLeft ()), this, SLOT
(menuMouseLeft ()));
 }
 
+KDE_NO_EXPORT void ControlPanel::setPalette (const QPalette
& pal) {
+    QWidget::setPalette (pal);
+    QColor c = paletteForegroundColor ();
+    strncpy (xpm_fg_color, QString().sprintf(".     
c #%02x%02x%02x", c.red(),
c.green(),c.blue()).ascii(), 31);
+    xpm_fg_color[31] = 0;
+    m_buttons[button_config]->setIconSet (QIconSet
(QPixmap (config_xpm)));
+    m_buttons[button_playlist]->setIconSet (QIconSet
(QPixmap (playlist_xpm)));
+    m_buttons[button_back]->setIconSet (QIconSet
(QPixmap (back_xpm)));
+    m_buttons[button_play]->setIconSet (QIconSet
(QPixmap (play_xpm)));
+    m_buttons[button_forward]->setIconSet (QIconSet
(QPixmap (forward_xpm)));
+    m_buttons[button_stop]->setIconSet (QIconSet
(QPixmap (stop_xpm)));
+    m_buttons[button_pause]->setIconSet (QIconSet
(QPixmap (pause_xpm)));
+    m_buttons[button_record]->setIconSet (QIconSet
(QPixmap (record_xpm)));
+    m_buttons[button_broadcast]->setIconSet (QIconSet
(QPixmap (broadcast_xpm)));
+    m_buttons[button_language]->setIconSet (QIconSet
(QPixmap (language_xpm)));
+    m_buttons[button_red]->setIconSet (QIconSet (QPixmap
(red_xpm)));
+    m_buttons[button_green]->setIconSet (QIconSet
(QPixmap (green_xpm)));
+    m_buttons[button_yellow]->setIconSet (QIconSet
(QPixmap (yellow_xpm)));
+    m_buttons[button_blue]->setIconSet (QIconSet
(QPixmap (blue_xpm)));
+}
+
 KDE_NO_EXPORT void ControlPanel::timerEvent (QTimerEvent *
e) {
     if (e->timerId () == m_popup_timer) {
         m_popup_timer = 0;
---
trunk/extragear/multimedia/kmplayer/src/kmplayercontrolpanel
.h #509854:509855
 -41,7
+41,7 
 /*
  * A button from the controlpanel
  */
-class KMPlayerMenuButton : public QPushButton {
+class KMPLAYER_NO_EXPORT KMPlayerMenuButton : public
QPushButton {
     Q_OBJECT
 public:
     KMPlayerMenuButton (QWidget *, QBoxLayout *, const char
**, int = 0);
 -115,6
+115,7 
     void setPlaying (bool play);
     void setRecording (bool record);
     void setAutoControls (bool b);
+    void setPalette (const QPalette &);
     KDE_NO_EXPORT bool autoControls () const { return
m_auto_controls; }
     KDE_NO_EXPORT QSlider * positionSlider () const {
return m_posSlider; }
     KDE_NO_EXPORT QSlider * contrastSlider () const {
return m_contrastSlider; }
--- trunk/extragear/multimedia/kmplayer/src/kmplayerview.cpp
#509854:509855
 -1034,6
+1034,14 
         delete m_view_area;
 }
 
+KDE_NO_EXPORT void View::setEraseColor (const QColor &
color) {
+    KMediaPlayer::View::setEraseColor (color);
+    if (statusBar ()) {
+        statusBar ()->setEraseColor (color);
+        controlPanel ()->setEraseColor (color);
+    }
+}
+
 void View::setInfoMessage (const QString & msg) {
     bool ismain = m_dockarea->getMainDockWidget () ==
m_dock_infopanel;
     if (msg.isEmpty ()) {
--- trunk/extragear/multimedia/kmplayer/src/kmplayerview.h
#509854:509855
 -247,6
+247,7 
     void showWidget (WidgetType w);
     void setControlPanelMode (ControlPanelMode m);
     void setStatusBarMode (StatusBarMode m);
+    void setEraseColor (const QColor &);
     KDE_NO_EXPORT ControlPanelMode controlPanelMode ()
const { return m_controlpanel_mode; }
     KDE_NO_EXPORT StatusBarMode statusBarMode () const {
return m_statusbar_mode; }
     void delayedShowButtons (bool show);
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )