LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File kdm-fix-labelcolors.diff of Package kdebase4-workspace (Project openSUSE:11.4)

Subject: Fix broken KDM layout with fingerprint support
From: Lubos Lunak
Patch-upstream: yes
Bug: bnc#533189
Relates: kdm-fix-generic-greeter.diff, same-pam-generic-classic.diff

Index: kdebase-workspace-4.6.0/kdm/kfrontend/themer/kdmlabel.h
===================================================================
--- kdebase-workspace-4.6.0.orig/kdm/kfrontend/themer/kdmlabel.h
+++ kdebase-workspace-4.6.0/kdm/kfrontend/themer/kdmlabel.h
@@ -61,6 +61,8 @@ protected:
 
     virtual void doPlugActions(bool plug);
 
+    virtual void updatePalette( QWidget *w );
+
     virtual void setWidget(QWidget *widget);
 
     struct LabelStruct {
Index: kdebase-workspace-4.6.0/kdm/kfrontend/themer/kdmitem.h
===================================================================
--- kdebase-workspace-4.6.0.orig/kdm/kfrontend/themer/kdmitem.h
+++ kdebase-workspace-4.6.0/kdm/kfrontend/themer/kdmitem.h
@@ -199,7 +199,7 @@ protected:
 
     bool eventFilter(QObject *o, QEvent *e);
     void setWidgetAttribs(QWidget *);
-    void updatePalette(QWidget *w);
+    virtual void updatePalette(QWidget *w);
 
     void updateThisVisible();
 
Index: kdebase-workspace-4.6.0/kdm/kfrontend/themer/kdmlabel.cpp
===================================================================
--- kdebase-workspace-4.6.0.orig/kdm/kfrontend/themer/kdmlabel.cpp
+++ kdebase-workspace-4.6.0/kdm/kfrontend/themer/kdmlabel.cpp
@@ -221,6 +221,8 @@ KdmLabel::statusChanged(bool descend)
     if ((state == Sprelight && !label.prelight.present) ||
         (state == Sactive && !label.active.present))
         return;
+    if( myWidget )
+        updatePalette( myWidget );
     updateWidgetAttribs();
     needUpdate();
 }
@@ -362,4 +364,19 @@ KdmLabel::updateWidgetAttribs()
     myWidget->setPalette(p);
 }
 
+void
+KdmLabel::updatePalette( QWidget *w )
+{
+	struct LabelStruct::LabelClass *l = &label.normal;
+	if (state == Sactive && label.active.present)
+		l = &label.active;
+	else if (state == Sprelight && label.prelight.present)
+		l = &label.prelight;
+	w->setFont( l->font.font );
+	QPalette p = w->palette();
+	p.setColor( QPalette::WindowText, l->color );
+	w->setPalette( p );
+	KdmItem::updatePalette( w );
+}
+
 #include "kdmlabel.moc"