DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2272
Version: 1.3-feature


I noticed that when the "gtk+" scheme is used, Fl_Round_Button doesn't obey
the selection_color(). I believe this is intensional, but I don't
understand why. Perhaps, by definition, "gtk+" always uses the system's
selection colour (FL_SELECTION_COLOR)?

The attached patch is a PoC and not intended to be used verbatim. The
patch simply comments out the colour calls to with FL_SELECTION_COLOR and
replaces them with 'col'. 'col' is defined at the top of draw() and used
for the other schemes.

Are Fl_Round_Buttons that obey selection_color(Fl_Color c) wanted/desired
by FLTK-proper?


Link: http://www.fltk.org/str.php?L2272
Version: 1.3-feature
Index: src/Fl_Light_Button.cxx
===================================================================
--- src/Fl_Light_Button.cxx     (revision 6919)
+++ src/Fl_Light_Button.cxx     (working copy)
@@ -59,11 +59,11 @@
         // Check box...
         draw_box(down_box(), x()+dx, y()+dy, W, W, FL_BACKGROUND2_COLOR);
        if (value()) {
-         if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) {
-           fl_color(FL_SELECTION_COLOR);
-         } else {
+         //if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) {
+         //  fl_color(FL_SELECTION_COLOR);
+         //} else {
            fl_color(col);
-         }
+         //}
          int tx = x() + dx + 3;
          int tw = W - 6;
          int d1 = tw/3;
@@ -86,11 +86,13 @@
          int tdy = dy + (W - tW) / 2;
 
          if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) {
-           fl_color(FL_SELECTION_COLOR);
+           //fl_color(FL_SELECTION_COLOR);
+               fl_color(col);
            tW --;
            fl_pie(x() + tdx - 1, y() + tdy - 1, tW + 3, tW + 3, 0.0, 360.0);
            fl_arc(x() + tdx - 1, y() + tdy - 1, tW + 3, tW + 3, 0.0, 360.0);
-           fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.2f));
+           //fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.2f));
+               fl_color(fl_color_average(FL_WHITE, col, 0.2f));
          } else fl_color(col);
 
          switch (tW) {
@@ -120,7 +122,8 @@
          }
 
          if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) {
-           fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.5));
+           //fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.5));
+           fl_color(fl_color_average(FL_WHITE, col, 0.5));
            fl_arc(x() + tdx, y() + tdy, tW + 1, tW + 1, 60.0, 180.0);
          }
        }
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to