mirror of
https://github.com/fltk/fltk.git
synced 2026-06-05 08:06:35 +08:00
STR #1133: if the FIle_input did not have focus and have no text inside and have the BAR changed flags set, it would draw a bogus and shifted second background box on top of the original one.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4728 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -167,7 +167,12 @@ void
|
|||||||
Fl_File_Input::draw() {
|
Fl_File_Input::draw() {
|
||||||
Fl_Boxtype b = box();
|
Fl_Boxtype b = box();
|
||||||
if (damage() & (FL_DAMAGE_BAR | FL_DAMAGE_ALL)) draw_buttons();
|
if (damage() & (FL_DAMAGE_BAR | FL_DAMAGE_ALL)) draw_buttons();
|
||||||
if (damage() & FL_DAMAGE_ALL) draw_box(b,x(),y()+DIR_HEIGHT,w(),h()-DIR_HEIGHT,color());
|
// this flag keeps Fl_Input_::drawtext from drawing a bogus box!
|
||||||
|
char must_trick_fl_input_ =
|
||||||
|
Fl::focus()!=this && !size() && !(damage()&FL_DAMAGE_ALL);
|
||||||
|
if ((damage() & FL_DAMAGE_ALL) || must_trick_fl_input_)
|
||||||
|
draw_box(b,x(),y()+DIR_HEIGHT,w(),h()-DIR_HEIGHT,color());
|
||||||
|
if (!must_trick_fl_input_)
|
||||||
Fl_Input_::drawtext(x()+Fl::box_dx(b)+3, y()+Fl::box_dy(b)+DIR_HEIGHT,
|
Fl_Input_::drawtext(x()+Fl::box_dx(b)+3, y()+Fl::box_dy(b)+DIR_HEIGHT,
|
||||||
w()-Fl::box_dw(b)-6, h()-Fl::box_dh(b)-DIR_HEIGHT);
|
w()-Fl::box_dw(b)-6, h()-Fl::box_dh(b)-DIR_HEIGHT);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user