diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-10-11 22:25:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-11 23:25:52 +0200 |
| commit | 33b601e57404fcef058a992ba7767f2c4f16a81b (patch) | |
| tree | 15747e586b76618734442db6054e219b1af4511b | |
| parent | e2c2ba777362f9d231e8b7281c764132038b8d61 (diff) | |
Synchronize all arrow colors and inactive drawing (#791)
| -rw-r--r-- | src/Fl_Input_Choice.cxx | 4 | ||||
| -rw-r--r-- | src/Fl_Menu.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_Menu_Button.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_Spinner.cxx | 5 | ||||
| -rw-r--r-- | src/Fl_Tabs.cxx | 5 |
5 files changed, 10 insertions, 8 deletions
diff --git a/src/Fl_Input_Choice.cxx b/src/Fl_Input_Choice.cxx index 059a1cc2d..fcb9f9c55 100644 --- a/src/Fl_Input_Choice.cxx +++ b/src/Fl_Input_Choice.cxx @@ -136,10 +136,10 @@ Fl_Input_Choice::InputMenuButton::InputMenuButton(int x,int y,int w,int h,const void Fl_Input_Choice::InputMenuButton::draw() { draw_box(); - fl_color(active_r() ? labelcolor() : fl_inactive(labelcolor())); + Fl_Color arrow_color = parent()->active_r() ? parent()->labelcolor() : fl_inactive(parent()->labelcolor()); Fl_Rect ab(this); ab.inset(1); - fl_draw_arrow(ab, FL_ARROW_CHOICE, FL_ORIENT_NONE, fl_color()); + fl_draw_arrow(ab, FL_ARROW_CHOICE, FL_ORIENT_NONE, arrow_color); if (Fl::focus() == this) draw_focus(); } diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index f3400bd9a..a213978d3 100644 --- a/src/Fl_Menu.cxx +++ b/src/Fl_Menu.cxx @@ -561,7 +561,7 @@ void menuwindow::drawentry(const Fl_Menu_Item* m, int n, int eraseit) { int x1 = xx + ww - sz - 2; int y1 = yy + (hh-sz)/2 + 1; - // draw an arrow whose style dependends on the active scheme + // draw an arrow whose style depends on the active scheme fl_draw_arrow(Fl_Rect(x1, y1, sz, sz), FL_ARROW_SINGLE, FL_ORIENT_RIGHT, fl_color()); } else if (m->shortcut_) { diff --git a/src/Fl_Menu_Button.cxx b/src/Fl_Menu_Button.cxx index df30ce2de..22a85f52d 100644 --- a/src/Fl_Menu_Button.cxx +++ b/src/Fl_Menu_Button.cxx @@ -41,7 +41,7 @@ void Fl_Menu_Button::draw() { // draw the arrow (choice button) - Fl_Color arrow_color = active_r() ? FL_DARK3 : fl_inactive(FL_DARK3); + Fl_Color arrow_color = active_r() ? labelcolor() : fl_inactive(labelcolor()); fl_draw_arrow(Fl_Rect(ax, ay, aw, ah), FL_ARROW_SINGLE, FL_ORIENT_DOWN, arrow_color); } diff --git a/src/Fl_Spinner.cxx b/src/Fl_Spinner.cxx index 3fa102d9c..39b626b50 100644 --- a/src/Fl_Spinner.cxx +++ b/src/Fl_Spinner.cxx @@ -132,13 +132,14 @@ void Fl_Spinner::draw() { Fl_Group::draw(); // draw up/down arrows over the button's empty labels + Fl_Color arrow_color = active_r() ? labelcolor() : fl_inactive(labelcolor()); Fl_Rect up(up_button_); up.inset(up_button_.box()); - fl_draw_arrow(up, FL_ARROW_SINGLE, FL_ORIENT_UP, labelcolor()); + fl_draw_arrow(up, FL_ARROW_SINGLE, FL_ORIENT_UP, arrow_color); Fl_Rect down(down_button_); down.inset(down_button_.box()); - fl_draw_arrow(down, FL_ARROW_SINGLE, FL_ORIENT_DOWN, labelcolor()); + fl_draw_arrow(down, FL_ARROW_SINGLE, FL_ORIENT_DOWN, arrow_color); } int Fl_Spinner::handle(int event) { diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx index f984f6e2e..ed6b45a5c 100644 --- a/src/Fl_Tabs.cxx +++ b/src/Fl_Tabs.cxx @@ -438,9 +438,10 @@ void Fl_Tabs::draw_overflow_menu_button() { X = x() + w() - H; Y = y() + h() - H - 1; } - fl_draw_box(box(), X, Y, H, H, color()); + draw_box(box(), X, Y, H, H, color()); Fl_Rect r(X, Y, H, H); - fl_draw_arrow(r, FL_ARROW_CHOICE, FL_ORIENT_NONE, fl_contrast(FL_BLACK, color())); + Fl_Color arrow_color = active_r() ? labelcolor() : fl_inactive(labelcolor()); + fl_draw_arrow(r, FL_ARROW_CHOICE, FL_ORIENT_NONE, arrow_color); } /** |
