From 067d1d8a61a53723f286e12059ccc168ea8e98c9 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 30 Oct 2005 17:42:21 +0000 Subject: [PATCH] Updated the default label and text colors of all widgets to use FL_FOREGROUND_COLOR instead of FL_BLACK (STR #1052) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4609 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 3 +++ fluid/CodeEditor.cxx | 14 +++++++------- fluid/Fl_Menu_Type.cxx | 2 +- fluid/Fl_Type.cxx | 4 ++-- src/Fl_Adjuster.cxx | 2 +- src/Fl_Chart.cxx | 2 +- src/Fl_Check_Button.cxx | 2 +- src/Fl_Menu.cxx | 4 ++-- src/Fl_Menu_.cxx | 2 +- src/Fl_Value_Output.cxx | 2 +- src/Fl_Value_Slider.cxx | 2 +- src/Fl_Widget.cxx | 2 +- 12 files changed, 22 insertions(+), 19 deletions(-) diff --git a/CHANGES b/CHANGES index 24bef0e8a..dc1eb972c 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,9 @@ CHANGES IN FLTK 1.1.7 - Documentation fixes (STR #571, STR #648, STR #692, STR #730, STR #744, STR #745, STR #931, STR #942, STR #960, STR #969) + - Updated the default label and text colors of all widgets + to use FL_FOREGROUND_COLOR instead of FL_BLACK (STR + #1052) - Fl::set_fonts() now works with Xft (STR #1012) - Fl_Value_Input now uses the screen-absolute position instead of the window-relative position when dragging diff --git a/fluid/CodeEditor.cxx b/fluid/CodeEditor.cxx index ed3ad3f8b..a6590ce62 100644 --- a/fluid/CodeEditor.cxx +++ b/fluid/CodeEditor.cxx @@ -38,13 +38,13 @@ Fl_Text_Display::Style_Table_Entry CodeEditor:: styletable[] = { // Style table - { FL_BLACK, FL_COURIER, 11 }, // A - Plain - { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // B - Line comments - { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // C - Block comments - { FL_BLUE, FL_COURIER, 11 }, // D - Strings - { FL_DARK_RED, FL_COURIER, 11 }, // E - Directives - { FL_DARK_RED, FL_COURIER_BOLD, 11 }, // F - Types - { FL_BLUE, FL_COURIER_BOLD, 11 } // G - Keywords + { FL_FOREGROUND_COLOR, FL_COURIER, 11 }, // A - Plain + { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // B - Line comments + { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // C - Block comments + { FL_BLUE, FL_COURIER, 11 }, // D - Strings + { FL_DARK_RED, FL_COURIER, 11 }, // E - Directives + { FL_DARK_RED, FL_COURIER_BOLD, 11 }, // F - Types + { FL_BLUE, FL_COURIER_BOLD, 11 } // G - Keywords }; const char * const CodeEditor:: code_keywords[] = { // Sorted list of C/C++ keywords... diff --git a/fluid/Fl_Menu_Type.cxx b/fluid/Fl_Menu_Type.cxx index 9beaa62b2..a99187093 100644 --- a/fluid/Fl_Menu_Type.cxx +++ b/fluid/Fl_Menu_Type.cxx @@ -524,7 +524,7 @@ Fl_Menu_Bar_Type Fl_Menu_Bar_type; void Shortcut_Button::draw() { if (value()) draw_box(FL_DOWN_BOX, (Fl_Color)9); else draw_box(FL_UP_BOX, FL_WHITE); - fl_font(FL_HELVETICA,14); fl_color(FL_BLACK); + fl_font(FL_HELVETICA,14); fl_color(FL_FOREGROUND_COLOR); fl_draw(fl_shortcut_label(svalue),x()+6,y(),w(),h(),FL_ALIGN_LEFT); } diff --git a/fluid/Fl_Type.cxx b/fluid/Fl_Type.cxx index 01d5da7d5..222444cd5 100644 --- a/fluid/Fl_Type.cxx +++ b/fluid/Fl_Type.cxx @@ -248,8 +248,8 @@ extern const char* subclassname(Fl_Type*); void Widget_Browser::item_draw(void *v, int X, int Y, int, int) const { Fl_Type *l = (Fl_Type *)v; X += 3 + 18 + l->level * 12; - if (l->new_selected) fl_color(fl_contrast(FL_BLACK,FL_SELECTION_COLOR)); - else fl_color(FL_BLACK); + if (l->new_selected) fl_color(fl_contrast(FL_FOREGROUND_COLOR,FL_SELECTION_COLOR)); + else fl_color(FL_FOREGROUND_COLOR); Fl_Pixmap *pm = pixmap[l->pixmapID()]; if (pm) pm->draw(X-18, Y); if (l->is_public() == 0) lock_pixmap.draw(X - 17, Y); diff --git a/src/Fl_Adjuster.cxx b/src/Fl_Adjuster.cxx index 18b0dcdc5..5c5e46f3a 100644 --- a/src/Fl_Adjuster.cxx +++ b/src/Fl_Adjuster.cxx @@ -161,7 +161,7 @@ Fl_Adjuster::Fl_Adjuster(int X, int Y, int W, int H, const char* l) : Fl_Valuator(X, Y, W, H, l) { box(FL_UP_BOX); step(1, 10000); - selection_color(FL_BLACK); + selection_color(FL_SELECTION_COLOR); drag = 0; soft_ = 1; } diff --git a/src/Fl_Chart.cxx b/src/Fl_Chart.cxx index a7bab2076..fce4bf045 100644 --- a/src/Fl_Chart.cxx +++ b/src/Fl_Chart.cxx @@ -296,7 +296,7 @@ Fl_Widget(X,Y,W,H,l) { min = max = 0; textfont_ = FL_HELVETICA; textsize_ = 10; - textcolor_ = FL_BLACK; + textcolor_ = FL_FOREGROUND_COLOR; entries = (FL_CHART_ENTRY *)calloc(sizeof(FL_CHART_ENTRY), FL_CHART_MAX + 1); } diff --git a/src/Fl_Check_Button.cxx b/src/Fl_Check_Button.cxx index 2fa990445..ba8f22fcb 100644 --- a/src/Fl_Check_Button.cxx +++ b/src/Fl_Check_Button.cxx @@ -36,5 +36,5 @@ Fl_Check_Button::Fl_Check_Button(int X, int Y, int W, int H, const char *l) : Fl_Light_Button(X, Y, W, H, l) { box(FL_NO_BOX); down_box(FL_DOWN_BOX); - selection_color(FL_BLACK); + selection_color(FL_SELECTION_COLOR); } diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index 533811c72..aa532e672 100644 --- a/src/Fl_Menu.cxx +++ b/src/Fl_Menu.cxx @@ -122,7 +122,7 @@ int Fl_Menu_Item::measure(int* hp, const Fl_Menu_* m) const { l.type = labeltype_; l.font = labelsize_ || labelfont_ ? labelfont_ : uchar(m ? m->textfont() : FL_HELVETICA); l.size = labelsize_ ? labelsize_ : m ? m->textsize() : (uchar)FL_NORMAL_SIZE; - l.color = FL_BLACK; // this makes no difference? + l.color = FL_FOREGROUND_COLOR; // this makes no difference? fl_draw_shortcut = 1; int w = 0; int h = 0; l.measure(w, hp ? *hp : h); @@ -140,7 +140,7 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m, l.type = labeltype_; l.font = labelsize_ || labelfont_ ? labelfont_ : uchar(m ? m->textfont() : FL_HELVETICA); l.size = labelsize_ ? labelsize_ : m ? m->textsize() : (uchar)FL_NORMAL_SIZE; - l.color = labelcolor_ ? labelcolor_ : m ? m->textcolor() : int(FL_BLACK); + l.color = labelcolor_ ? labelcolor_ : m ? m->textcolor() : int(FL_FOREGROUND_COLOR); if (!active()) l.color = fl_inactive((Fl_Color)l.color); Fl_Color color = m ? m->color() : FL_GRAY; if (selected) { diff --git a/src/Fl_Menu_.cxx b/src/Fl_Menu_.cxx index 4b1edb4e1..f5b3c61a2 100644 --- a/src/Fl_Menu_.cxx +++ b/src/Fl_Menu_.cxx @@ -176,7 +176,7 @@ Fl_Menu_::Fl_Menu_(int X,int Y,int W,int H,const char* l) selection_color(FL_SELECTION_COLOR); textfont(FL_HELVETICA); textsize((uchar)FL_NORMAL_SIZE); - textcolor(FL_BLACK); + textcolor(FL_FOREGROUND_COLOR); down_box(FL_NO_BOX); } diff --git a/src/Fl_Value_Output.cxx b/src/Fl_Value_Output.cxx index 0594e3d10..6574bf106 100644 --- a/src/Fl_Value_Output.cxx +++ b/src/Fl_Value_Output.cxx @@ -94,7 +94,7 @@ Fl_Value_Output::Fl_Value_Output(int X, int Y, int W, int H,const char *l) align(FL_ALIGN_LEFT); textfont_ = FL_HELVETICA; textsize_ = (uchar)FL_NORMAL_SIZE; - textcolor_ = FL_BLACK; + textcolor_ = FL_FOREGROUND_COLOR; soft_ = 0; } diff --git a/src/Fl_Value_Slider.cxx b/src/Fl_Value_Slider.cxx index 834eba74c..ac7ca2efb 100644 --- a/src/Fl_Value_Slider.cxx +++ b/src/Fl_Value_Slider.cxx @@ -35,7 +35,7 @@ Fl_Value_Slider::Fl_Value_Slider(int X, int Y, int W, int H, const char*l) step(1,100); textfont_ = FL_HELVETICA; textsize_ = 10; - textcolor_ = FL_BLACK; + textcolor_ = FL_FOREGROUND_COLOR; } void Fl_Value_Slider::draw() { diff --git a/src/Fl_Widget.cxx b/src/Fl_Widget.cxx index a94764346..3c637767b 100644 --- a/src/Fl_Widget.cxx +++ b/src/Fl_Widget.cxx @@ -88,7 +88,7 @@ Fl_Widget::Fl_Widget(int X, int Y, int W, int H, const char* L) { label_.type = FL_NORMAL_LABEL; label_.font = FL_HELVETICA; label_.size = (uchar)FL_NORMAL_SIZE; - label_.color = FL_BLACK; + label_.color = FL_FOREGROUND_COLOR; tooltip_ = 0; callback_ = default_callback; user_data_ = 0;