[chronojump] Fixed colorizing of RadioButton label (like all the widgets colorized today)



commit 22c7eb8fffd8610b92b54fd2db9947df4a899012
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Apr 1 18:06:11 2020 +0200

    Fixed colorizing of RadioButton label (like all the widgets colorized today)

 src/utilGtk.cs | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/utilGtk.cs b/src/utilGtk.cs
index 6526aff1..845513de 100644
--- a/src/utilGtk.cs
+++ b/src/utilGtk.cs
@@ -644,20 +644,21 @@ public class UtilGtk
                                w.GetType() == typeof(Gtk.Table) ||
                                w.GetType() == typeof(Gtk.Notebook) ||
                                w.GetType() == typeof(Gtk.Frame) ||
-                               w.GetType() == typeof(Gtk.CheckButton) //||
-                               // Gtk.RadioButton is not working, so solutions are
-                               // 1 have them inside a new viewport (recommended)
-                               // 2 have it without the radio (will be a button and no need to colorize)
-                               //w.GetType() == typeof(Gtk.RadioButton) );
+                               w.GetType() == typeof(Gtk.CheckButton) ||
+                               w.GetType() == typeof(Gtk.RadioButton)
                        );
        }
 
        public static void LabelDoContrastColor (Gtk.Viewport v, Gtk.Label l)
        {
                if(ColorIsDark(v.Style.Background(StateType.Normal)))
+               {
                        l.ModifyFg(StateType.Normal, YELLOW_LIGHT);
-               else
+                       l.ModifyFg(StateType.Active, YELLOW_LIGHT); //needed for CheckButton and RadioButton
+               } else {
                        l.ModifyFg(StateType.Normal, BLACK);
+//                     l.ModifyFg(StateType.Active, BLACK);
+               }
        }
        
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]