Bug 144048 - Legends ignore font colour
Summary: Legends ignore font colour
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Unclassified
Component: general (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-10 23:44 UTC by D. V. Wiebe
Modified: 2007-04-12 19:52 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Proposed patch (1.56 KB, patch)
2007-04-11 20:27 UTC, Andrew Walker
Details
Proposed patch (1.56 KB, patch)
2007-04-11 20:40 UTC, Andrew Walker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description D. V. Wiebe 2007-04-10 23:44:56 UTC
Version:           1.4.0_svn_647607 (using KDE KDE 3.5.6)
Installed from:    Compiled From Sources
Compiler:          gcc (GCC) 4.1.2 
OS:                Linux

Legend text always is drawn in black, even when another font colour is requested in the Edit Legend dialog.

Steps to reproduce:

1. Plot a curve
2. Add a legend to the plot
3. Right click on the legend -> Edit...
4. In the Edit Legend dialog, change the font colour to something that isn't black.
5. "OK"

Results:

  The colour of the legend text remains black.

Expected results:

  The colour of the legend text should be the colour chosen in the Edit Legend dialog.
Comment 1 Andrew Walker 2007-04-11 20:27:07 UTC
Created attachment 20233 [details]
Proposed patch
Comment 2 Andrew Walker 2007-04-11 20:40:23 UTC
Created attachment 20234 [details]
Proposed patch
Comment 3 Adam Treat 2007-04-12 18:09:29 UTC
Looks fine, but everything should go into 1.5 branch now
Comment 4 Netterfield 2007-04-12 18:36:24 UTC
But this should be back-ported to 1.4.1 once it is re-opened.

I am keeping track in RELEASE_PLAN what bugs need to be backported to 1.4.1 
once resolved.

> ------- Additional Comments From treat kde org  2007-04-12 18:09 -------
> Looks fine, but everything should go into 1.5 branch now

Comment 5 Andrew Walker 2007-04-12 19:52:25 UTC
SVN commit 653135 by arwalker:

BUG:144048 Make legend respect font color

 M  +12 -0     kstviewlegend.cpp  


--- branches/work/kst/1.5/kst/src/libkstapp/kstviewlegend.cpp #653134:653135
@@ -245,6 +245,9 @@
       rc.x = 0;
       rc.y = _ascent;
       rc.xStart = rc.x;
+      if (_parsedTitle->chunk) {
+        _parsedTitle->chunk->attributes.color = foregroundColor();
+      }
       renderLabel(rc, _parsedTitle->chunk, _vectorsUsed, _scalarsUsed, _stringsUsed);
       i = 1;
       p.restore();
@@ -260,6 +263,9 @@
         rc.x = 0;
         rc.y = _ascent;
         rc.xStart = rc.x;
+        if ((*it)->parsedLegendTag()->chunk) {
+          (*it)->parsedLegendTag()->chunk->attributes.color = foregroundColor();
+        }
         renderLabel(rc, (*it)->parsedLegendTag()->chunk, _vectorsUsed, _scalarsUsed, _stringsUsed);
       }
       p.restore();
@@ -272,6 +278,9 @@
       rc.x = 0;
       rc.y = _ascent;
       rc.xStart = rc.x;
+      if (_parsedTitle->chunk) {
+        _parsedTitle->chunk->attributes.color = foregroundColor();
+      }
       renderLabel(rc, _parsedTitle->chunk, _vectorsUsed, _scalarsUsed, _stringsUsed);
       p.translate(_titleWidth + _ascent,0);
     }
@@ -285,6 +294,9 @@
         rc.x = 0;
         rc.y = _ascent;
         rc.xStart = rc.x;
+        if ((*it)->parsedLegendTag()->chunk) {
+          (*it)->parsedLegendTag()->chunk->attributes.color = foregroundColor();
+        }
         renderLabel(rc, (*it)->parsedLegendTag()->chunk, _vectorsUsed, _scalarsUsed, _stringsUsed);
         p.translate((*it)->legendLabelSize().width() + _ascent,0);
       }