From ecc47d0cc3e1784e17ac94829202f2bdbd38a682 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sun, 22 Nov 2020 19:19:19 +0100 Subject: Refactor and simplify "arrow drawing" in widgets "Arrows" in widgets are those GUI elements mostly represented by triangles pointing in a particular direction as in scrollbars, choice widgets, some menus, valuators and Fl_Counter widgets. The code has been simplified and standardized such that all these GUI elements are drawn identically per FLTK scheme. Widget authors no longer need to write code to calculate arrow sizes and draw polygons etc. Different schemes can and do implement different drawing functions. Todo: see comments "FIXME_ARROW" in src/Fl_Menu_Button.cxx and src/Fl_Menu.cxx --- src/Fl_Menu_Button.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Fl_Menu_Button.cxx') diff --git a/src/Fl_Menu_Button.cxx b/src/Fl_Menu_Button.cxx index 5b69ea703..dadbaf55c 100644 --- a/src/Fl_Menu_Button.cxx +++ b/src/Fl_Menu_Button.cxx @@ -1,7 +1,7 @@ // // Menu button widget for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2019 by Bill Spitzak and others. +// Copyright 1998-2022 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -31,6 +31,7 @@ void Fl_Menu_Button::draw() { draw_label(x()+Fl::box_dx(box()), y(), X-x()+2, h()); if (Fl::focus() == this) draw_focus(); // ** if (box() == FL_FLAT_BOX) return; // for XForms compatibility + // FIXME_ARROW: use fl_draw_arrow() fl_color(active_r() ? FL_DARK3 : fl_inactive(FL_DARK3)); fl_line(X+H/2, Y+H, X, Y, X+H, Y); fl_color(active_r() ? FL_LIGHT3 : fl_inactive(FL_LIGHT3)); -- cgit v1.2.3