Re: [fltk.development] [RFE] STR #2942: Buttons keep the same color when clicked

2013-04-08 Thread Albrecht Schlosser

[STR Closed w/o Resolution]

Link: http://www.fltk.org/str.php?L2942
Version: 1.3-feature
Fix Version: 1.3-current


No, sorry. We won't set anything (e.g. selection_color) w/o the user
explicitly requesting it. This would also break apps that have the colors
set as-is. The usual default is to use the selection_color(), and this is
taken from a system color. As I wrote before, the setting you proposed
would also be sub-optimal for other FLTK schemes.

I'm closing this STR now.


Link: http://www.fltk.org/str.php?L2942
Version: 1.3-feature
Fix Version: 1.3-current

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2942: Buttons keep the same color when clicked

2013-04-02 Thread Albrecht Schlosser
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Pending]

Link: http://www.fltk.org/str.php?L2942
Version: 1.3-feature
Fix Version: 1.3-current


Edmanuel, I recommend not to use this down_button_color...patch, because
this would *remove* the user's ability to set the selection color.

Please see attached patch gleam_button_selection_color.diff how to set the
selection color in the unittest_scheme.cxx file. If you want to use
fl_darker() or another color you can do it this way as well.

I'll close this STR within the next few days, as agreed by the OP, but
leave it open now for feedback.


Link: http://www.fltk.org/str.php?L2942
Version: 1.3-feature
Fix Version: 1.3-currentIndex: test/unittest_schemes.cxx
===
--- test/unittest_schemes.cxx   (Revision 9855)
+++ test/unittest_schemes.cxx   (Arbeitskopie)
@@ -62,14 +62,14 @@
 schemechoice-add(none);
 schemechoice-add(plastic);
 schemechoice-add(gtk+);
-//schemechoice-add(gleam);
+schemechoice-add(gleam);
 schemechoice-value(0);
 schemechoice-labelfont(FL_HELVETICA_BOLD);
 const char *name = Fl::scheme();
 if ( name ) {
if ( strcmp(name, plastic) == 0) { schemechoice-value(1); }
   else if ( strcmp(name, gtk+)== 0) { schemechoice-value(2); }
-  //else if ( strcmp(name, gleam)   == 0) { schemechoice-value(3); }
+  else if ( strcmp(name, gleam)   == 0) { schemechoice-value(3); }
 }
 schemechoice-callback(SchemeChoice_CB, (void*)this);
 
@@ -80,21 +80,25 @@
   { Fl_Button* o = new Fl_Button(10, 9, 90, 25, button);
o-box(FL_UP_BOX);
o-color((Fl_Color)101);
+   o-selection_color(o-color());
o-labelfont(5);
   } // Fl_Button* o
   { Fl_Button* o = new Fl_Button(10, 36, 90, 25, button);
o-box(FL_UP_BOX);
o-color((Fl_Color)179);
+   // o-selection_color(o-color());
o-labelfont(4);
o-labelcolor(FL_BACKGROUND2_COLOR);
   } // Fl_Button* o
   { Fl_Button* o = new Fl_Button(10, 63, 90, 25, button);
o-box(FL_UP_BOX);
o-color((Fl_Color)91);
+   o-selection_color(o-color());
   } // Fl_Button* o
   { Fl_Button* o = new Fl_Button(10, 90, 90, 25, button);
o-box(FL_UP_BOX);
o-color(FL_INACTIVE_COLOR);
+   o-selection_color(o-color());
o-labelcolor(FL_BACKGROUND2_COLOR);
   } // Fl_Button* o
   { Fl_Tabs* o = new Fl_Tabs(10, 120, 320, 215);
___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2942: Buttons keep the same color when clicked

2013-04-02 Thread Albrecht Schlosser

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

[STR Pending]

Link: http://www.fltk.org/str.php?L2942
Version: 1.3-feature
Fix Version: 1.3-current


FTR: the changes in test/unittest_schemes.cxx change the selection_color()
for 3 of 4 buttons to show the effect more clearly. The blue (2nd) button
is unaffected by this patch.

The functionality is the same for all schemes, so this is all okay.

Note: for some schemes (including gtk+) it would maybe be better not to
use the same color for selection_color(), because the border changes don't
make a big difference in the overall appearance, hence using fl_darker()
might be useful. However, you can see the effect...


Link: http://www.fltk.org/str.php?L2942
Version: 1.3-feature
Fix Version: 1.3-current

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2942: Buttons keep the same color when clicked

2013-04-02 Thread Edmanuel Torres

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

[STR Pending]

Link: http://www.fltk.org/str.php?L2942
Version: 1.3-feature
Fix Version: 1.3-current


Thanks Albrecht!


Link: http://www.fltk.org/str.php?L2942
Version: 1.3-feature
Fix Version: 1.3-current

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2942: Buttons keep the same color when clicked

2013-04-02 Thread Edmanuel Torres
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Pending]

Link: http://www.fltk.org/str.php?L2942
Version: 1.3-feature
Fix Version: 1.3-current


Attached file down_button_color_r2.patch...


Link: http://www.fltk.org/str.php?L2942
Version: 1.3-feature
Fix Version: 1.3-currentIndex: fluid/Fl_Widget_Type.cxx
===
--- fluid/Fl_Widget_Type.cxx(revision 9857)
+++ fluid/Fl_Widget_Type.cxx(working copy)
@@ -2438,6 +2438,8 @@
 write_string(color %d, o-color());
   if (o-selection_color()!=tplate-selection_color())
 write_string(selection_color %d, o-selection_color());
+  else
+write_string(selection_color %d, o-color());
   if (o-labeltype()!=tplate-labeltype()) {
 write_string(labeltype);
 write_word(item_name(labeltypemenu, o-labeltype()));
___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2942: Buttons keep the same color when clicked

2013-04-02 Thread Edmanuel Torres

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

[STR Pending]

Link: http://www.fltk.org/str.php?L2942
Version: 1.3-feature
Fix Version: 1.3-current


In the updated patch (r2) FLUID set selection_color to color by default. I
think I like this way instead to do it by hand everywhere.


Link: http://www.fltk.org/str.php?L2942
Version: 1.3-feature
Fix Version: 1.3-current

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2942: Buttons keep the same color when clicked

2013-04-01 Thread Greg Ercolano

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

[STR New]

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


Hmm, doesn't that patch take /away/ the current control
an app has over the button pushed color via selection_color()?

selection_color() can be changed by the app to control what color
a button is when it's pressed, and the patch seems to comment that out
and replace it with the fl_darker() algorithm. Seems like a step away
from what we want.

Perhaps Albrecht's comments are more to do specifically with the
theme code not taking into account the current selection_color(),
as opposed to Fl_Button's existing default draw code..?


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2942: Buttons keep the same color when clicked

2013-04-01 Thread Albrecht Schlosser

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

[STR New]

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


Yes, indeed, I hadn't looked at the code and thus missed that
selection_color() bit. Edmanuel, I apologize for the confusion...

So, if it's in the user's control (via selection_color()) then we should
NOT use this patch.

Any objections to closing *this* STR ?


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2942: Buttons keep the same color when clicked

2013-04-01 Thread Edmanuel Torres

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

[STR New]

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


Thanks for your analysis, I think this patch should be closed. However, I
will use it until a better one is out.


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2942: Buttons keep the same color when clicked

2013-03-31 Thread Edmanuel Torres
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

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


Attached file down_button_color_r1.patch...


Link: http://www.fltk.org/str.php?L2942
Version: 1.3-featureIndex: src/Fl_Button.cxx
===
--- src/Fl_Button.cxx   (revision 9855)
+++ src/Fl_Button.cxx   (working copy)
@@ -68,7 +68,8 @@
 
 void Fl_Button::draw() {
   if (type() == FL_HIDDEN_BUTTON) return;
-  Fl_Color col = value() ? selection_color() : color();
+  //Fl_Color col = value() ? selection_color() : color();
+  Fl_Color col = value() ? fl_darker(color()) : color();
   draw_box(value() ? (down_box()?down_box():fl_down(box())) : box(), col);
   draw_backdrop();
   if (labeltype() == FL_NORMAL_LABEL  value()) {
___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev