[atlantik-cvs] CVS: kdegames/atlantik/libatlantikui estatedetails.cpp, 1.25, 1.25.2.1

[email protected] Tue, 25 Nov 2003 02:25:35 +0100 (CET)
Newsgroups gmane.comp.kde.devel.atlantik
Message-ID <[email protected]>
Update of /home/kde/kdegames/atlantik/libatlantikui
In directory office:/tmp/cvs-serv31606/libatlantikui

Modified Files:
      Tag: atlantik_3_3_branch
	estatedetails.cpp 
Log Message:
color buttons again, and make sure the text is readable (#52935)

Index: estatedetails.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantikui/estatedetails.cpp,v
retrieving revision 1.25
retrieving revision 1.25.2.1
diff -u -d -r1.25 -r1.25.2.1
--- estatedetails.cpp	12 Nov 2003 18:08:54 -0000	1.25
+++ estatedetails.cpp	25 Nov 2003 01:25:31 -0000	1.25.2.1
@@ -215,6 +215,15 @@
 	m_buttonCommandMap[(QObject *)button] = command;
 	m_buttonBox->addWidget(button);
 
+	if (m_estate)
+	{
+		QColor bgColor, fgColor;
+		bgColor = m_estate->bgColor().light(110);
+		fgColor = ( bgColor.red() + bgColor.green() + bgColor.blue() < 255 ) ? Qt::white : Qt::black;
+
+		button->setPaletteForegroundColor( fgColor );
+		button->setPaletteBackgroundColor( bgColor );
+	}
 	button->setEnabled(enabled);
 	button->show();