From d82e30730d03774b7dc7c1dca93778ea4e487189 Mon Sep 17 00:00:00 2001 From: Jorge Arellano Cid Date: Fri, 5 Aug 2011 21:39:27 -0400 Subject: Fixed CustLightButton "light" color deactivation When hiding, or leaving a highlighted button into another tab, the "light" state lingered. This was specially nasty on deactivated buttons as there was no easy way to recover the normal state. e.g. * Keep the mouse over Stop until the page fully loads. * With mouse over Forw, go forward with keyboard until the end. * Mouse over Home, Ctrl-t, mouse click previous tab. * Start loading a page, mouse over Stop, Ctrl-t, wait for the page to fully load, go back to the loading tab * Mouse ove Home, hide panels, move mouse, show panels. * etc. --- src/ui.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ui.hh b/src/ui.hh index 3b61f69b..775a35ed 100644 --- a/src/ui.hh +++ b/src/ui.hh @@ -129,10 +129,13 @@ public: if (e == FL_ENTER) { color(light_color); // {17,26,51} redraw(); - } else if (e == FL_LEAVE || e == FL_RELEASE) { + } else if (e == FL_LEAVE || e == FL_RELEASE || e == FL_HIDE) { color(norm_color); redraw(); } + } else if (e == FL_DEACTIVATE && color() != norm_color) { + color(norm_color); + redraw(); } return Fl_Button::handle(e); } -- cgit v1.2.3