Bug 146584 - headings & progress indicators in infowidget don't respect colorscheme
Summary: headings & progress indicators in infowidget don't respect colorscheme
Status: RESOLVED FIXED
Alias: None
Product: ktorrent
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-09 14:10 UTC by Stefan Monov
Modified: 2007-06-19 19:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
bad colors (22.67 KB, image/png)
2007-06-09 14:11 UTC, Stefan Monov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Monov 2007-06-09 14:10:56 UTC
Version:           2.1 (using KDE 3.5.6, Kubuntu (feisty) 4:3.5.6-0ubuntu14)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.20-16-lowlatency

In infowidget:

The headings use lightblue no matter what. This should probably be changed to standard groupboxes or even just bold text.

The progress indicators use white for parts not yet downloaded. I guess this should be changed to the "selected foreground" color, as this is certain to contrast with the "selected background" used for the rest of the progress indicator.

Screenshot to follow.
Comment 1 Stefan Monov 2007-06-09 14:11:25 UTC
Created attachment 20818 [details]
bad colors
Comment 2 Joris Guisson 2007-06-19 19:19:45 UTC
SVN commit 677664 by guisson:

Do not use hardcoded colors like wihte and lightgray, instead use QColorGroup

BUG: 146584



 M  +7 -6      chunkbar.cpp  
 M  +6 -0      statustab.cpp  
 M  +7 -7      statustabbase.ui  


--- branches/extragear/kde3/network/ktorrent/plugins/infowidget/chunkbar.cpp #677663:677664
@@ -71,7 +71,7 @@
 		QMimeSourceFactory* factory = QMimeSourceFactory::defaultFactory();
 		
 		QImage excluded(16, 16, 32);
-		FillAndFrameBlack(&excluded, Qt::lightGray.pixel(), 16);
+		FillAndFrameBlack(&excluded, bar->colorGroup().color(QColorGroup::Mid).pixel(), 16);
 		factory->setImage("excluded_color", excluded);
 		
 		QImage available(16, 16, 32);
@@ -121,7 +121,7 @@
 		//	PROFILE("ChunkBar::updateBar");
 		//	Out() << "Pixmap : " << s.width() << " " << s.height() << endl;
 			pixmap.resize(s);
-			pixmap.fill(Qt::white);
+			pixmap.fill(colorGroup().color(QColorGroup::Base));
 			QPainter painter(&pixmap);
 			drawBarContents(&painter);
 			update();
@@ -148,7 +148,7 @@
 		QSize s = contentsRect().size();
 		//Out() << "Pixmap : " << s.width() << " " << s.height() << endl;
 		pixmap.resize(s);
-		pixmap.fill(Qt::white);
+		pixmap.fill(colorGroup().color(QColorGroup::Base));
 		QPainter painter(&pixmap);
 		drawBarContents(&painter);
 		update();
@@ -172,12 +172,13 @@
 	
 			if (show_excluded && s.num_chunks_excluded > 0)
 			{
+				QColor c = colorGroup().color(QColorGroup::Mid);
 				if (curr_ebs.allOn())
-					drawAllOn(p,Qt::lightGray);
+					drawAllOn(p,c);
 				else if (s.total_chunks > w)
-					drawMoreChunksThenPixels(p,curr_ebs,Qt::lightGray);
+					drawMoreChunksThenPixels(p,curr_ebs,c);
 				else
-					drawEqual(p,curr_ebs,Qt::lightGray);
+					drawEqual(p,curr_ebs,c);
 			}
 		}
 		p->restoreWorldMatrix();
--- branches/extragear/kde3/network/ktorrent/plugins/infowidget/statustab.cpp #677663:677664
@@ -37,6 +37,12 @@
 	StatusTab::StatusTab(QWidget* parent, const char* name, WFlags fl)
 			: StatusTabBase(parent,name,fl),curr_tc(0)
 	{
+		QColorGroup cg = colorGroup();
+		// do not use hardcoded colors
+		m_info_caption->setPaletteBackgroundColor(cg.mid());
+		m_chunks_caption->setPaletteBackgroundColor(cg.mid());
+		m_sharing_caption->setPaletteBackgroundColor(cg.mid()); 
+		
 		maxRatio->setMinValue(0.0f);
 		maxRatio->setMaxValue(100.0f);
 		maxRatio->setStep(0.1f);
--- branches/extragear/kde3/network/ktorrent/plugins/infowidget/statustabbase.ui #677663:677664
@@ -21,7 +21,7 @@
         </property>
         <widget class="QLabel">
             <property name="name">
-                <cstring>textLabel1_4</cstring>
+                <cstring>m_info_caption</cstring>
             </property>
             <property name="paletteBackgroundColor">
                 <color>
@@ -290,7 +290,7 @@
                                 </property>
                                 <widget class="QLabel">
                                     <property name="name">
-                                        <cstring>textLabel1_8</cstring>
+                                        <cstring>m_chunks_caption</cstring>
                                     </property>
                                     <property name="sizePolicy">
                                         <sizepolicy>
@@ -439,7 +439,7 @@
                         </property>
                         <widget class="QLabel">
                             <property name="name">
-                                <cstring>textLabel1</cstring>
+                                <cstring>m_sharing_caption</cstring>
                             </property>
                             <property name="paletteBackgroundColor">
                                 <color>
@@ -659,9 +659,9 @@
 </images>
 <layoutdefaults spacing="6" margin="11"/>
 <includehints>
-    <includehint>downloadedchunkbar.h</includehint>
-    <includehint>availabilitychunkbar.h</includehint>
-    <includehint>floatspinbox.h</includehint>
-    <includehint>floatspinbox.h</includehint>
+    <includehint>kt::downloadedchunkbar.h</includehint>
+    <includehint>kt::availabilitychunkbar.h</includehint>
+    <includehint>kt::floatspinbox.h</includehint>
+    <includehint>kt::floatspinbox.h</includehint>
 </includehints>
 </UI>