View Issue Details

IDProjectCategoryView StatusLast Update
0036398PackagesPackagespublic2020-05-17 15:44
ReporterBernd Kreuss Assigned ToBalázs Székely  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.0.7 (SVN) 
Summary0036398: Online Package Manager not using theme color, text unreadable on dark theme
DescriptionOn desktops with a dark theme the online package manager text font appears black and unreadable, it is not using the theme color.

See attached screenshot.

In this example I am using KDE (Kubuntu Bionic) and Breeze Dark theme. Everything else in the IDE is matching the theme colors beautifully, except for the online package manager.
TagsNo tags attached.
Fixed in Revisionr 62325
LazTarget-
WidgetsetGTK 2
Attached Files

Relationships

related to 0033440 new Lazarus [FEATURE REQUEST] Change the theme of entire IDE 

Activities

Bernd Kreuss

2019-12-04 15:25

reporter  

package_manager_dark.png (124,541 bytes)   
package_manager_dark.png (124,541 bytes)   

Zeljan Rikalo

2019-12-04 15:42

developer   ~0119615

That is because Canvas.Font.Color := SomeColor does not check for clDefault in VirtualTrees. I've attached my own patch for VT 4.8, so maybe it can be applied to the OPM VirtualTrees, but maybe it needs some manual coding :)
virtualtrees_4_8_font_color_diff.diff (2,735 bytes)   
--- trunk/VirtualTrees/VirtualTrees.pas	2017/10/26 11:59:31	2445
+++ trunk/VirtualTrees/VirtualTrees.pas	2018/01/17 13:25:16	2491
@@ -5585,6 +5585,8 @@
               DoPaintText(Node, Self.Canvas, Column, ttNormal);
           //force the default hint font color
           Canvas.Font.Color := Screen.HintFont.Color;
+          if Canvas.Font.Color = clDefault then
+            Canvas.Font.Color := clInfoText;
         end;
 
         //let THintWindow do the job
@@ -7547,7 +7549,12 @@
     if Hot then
       SetTextColor(DC, ColorToRGB(FHeader.Treeview.FColors.HeaderHotColor))
     else
-      SetTextColor(DC, ColorToRGB(FHeader.FFont.Color));
+    begin
+      if FHeader.FFont.Color = clDefault then
+        SetTextColor(DC, ColorToRGB(FHeader.Treeview.GetDefaultColor(dctFont)))
+      else
+        SetTextColor(DC, ColorToRGB(FHeader.FFont.Color));
+    end;
     DrawText(DC, PChar(Caption), Length(Caption), Bounds, DrawFormat);
   end;
 end;
@@ -8561,6 +8568,8 @@
   with PaintInfo, TargetCanvas do
   begin
     Font := FHeader.FFont;
+    if Font.Color = clDefault then
+      Font.Color := FHeader.Treeview.GetDefaultColor(dctFont);
 
     RaisedButtonStyle := 0;
     RaisedButtonFlags := 0;
@@ -31181,6 +31190,9 @@
     // Set default font values first.
     Canvas.Font := Font;
 
+    if Font.Color = clDefault then
+      Canvas.Font.Color := GetDefaultColor(dctFont);
+
     if (toHotTrack in FOptions.FPaintOptions) and (Node = FCurrentHotNode) then
     begin
       if not IsWinVistaOrAbove or not (tsUseThemes in FStates) or
@@ -31319,6 +31331,8 @@
   with PaintInfo do
   begin
     Canvas.Font := Font;
+    if Font.Color = clDefault then
+      Canvas.Font.Color := GetDefaultColor(dctFont);
     if toFullRowSelect in FOptions.FSelectionOptions then
     begin
       if Node = FDropTargetNode then
@@ -31326,7 +31340,12 @@
         if (FLastDropMode = dmOnNode) or (vsSelected in Node.States)then
           Canvas.Font.Color := clHighlightText
         else
-          Canvas.Font.Color := Font.Color;
+        begin
+          if Font.Color = clDefault then
+            Canvas.Font.Color := GetDefaultColor(dctFont)
+          else
+            Canvas.Font.Color := Font.Color;
+        end;
       end
       else
         if vsSelected in Node.States then
@@ -31334,7 +31353,12 @@
           if Focused or (toPopupMode in FOptions.FPaintOptions) then
             Canvas.Font.Color := clHighlightText
           else
-            Canvas.Font.Color := Font.Color;
+          begin
+            if Font.Color = clDefault then
+              Canvas.Font.Color := GetDefaultColor(dctFont)
+            else
+              Canvas.Font.Color := Font.Color;
+           end;
         end;
     end;
 

Balázs Székely

2019-12-05 07:50

developer   ~0119618

@Zeljko
Thanks for the patch.

@Bernd
Please test with r. 62325 and close if it's OK. Thanks for the feedback.

Balázs Székely

2019-12-05 08:06

developer  

OPM.png (76,152 bytes)   
OPM.png (76,152 bytes)   

Issue History

Date Modified Username Field Change
2019-12-04 15:25 Bernd Kreuss New Issue
2019-12-04 15:25 Bernd Kreuss File Added: package_manager_dark.png
2019-12-04 15:42 Zeljan Rikalo File Added: virtualtrees_4_8_font_color_diff.diff
2019-12-04 15:42 Zeljan Rikalo Note Added: 0119615
2019-12-05 07:48 Balázs Székely Assigned To => Balázs Székely
2019-12-05 07:48 Balázs Székely Status new => assigned
2019-12-05 07:50 Balázs Székely Note Added: 0119618
2019-12-05 07:51 Balázs Székely Status assigned => resolved
2019-12-05 07:51 Balázs Székely Resolution open => fixed
2019-12-05 07:51 Balázs Székely Fixed in Revision => r 62325
2019-12-05 07:51 Balázs Székely LazTarget => -
2019-12-05 07:51 Balázs Székely Widgetset GTK 2 => GTK 2
2019-12-05 08:06 Balázs Székely File Added: OPM.png
2020-05-17 15:44 Juha Manninen Relationship added related to 0033440