Synchronize all arrow colors and inactive drawing (#791)

This commit is contained in:
Matthias Melcher 2023-10-11 22:25:52 +01:00 committed by GitHub
parent e2c2ba7773
commit 33b601e574
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 8 deletions

View File

@ -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();
}

View File

@ -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_) {

View File

@ -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);
}

View File

@ -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) {

View File

@ -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);
}
/**