summaryrefslogtreecommitdiff
path: root/src/Fl_File_Input.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2005-12-30 15:45:38 +0000
committerMatthias Melcher <fltk@matthiasm.com>2005-12-30 15:45:38 +0000
commita5b959a3df039439234011213c2ee5b949e95a06 (patch)
treecd0fa2023a3c1f6d4c280b547069b2670240ca4e /src/Fl_File_Input.cxx
parent0ea6761db282d3354fd4a5465785c26071aad6a9 (diff)
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
Diffstat (limited to 'src/Fl_File_Input.cxx')
-rw-r--r--src/Fl_File_Input.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Fl_File_Input.cxx b/src/Fl_File_Input.cxx
index b8ec08548..45625b5ee 100644
--- a/src/Fl_File_Input.cxx
+++ b/src/Fl_File_Input.cxx
@@ -167,9 +167,14 @@ void
Fl_File_Input::draw() {
Fl_Boxtype b = box();
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());
- 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);
+ // 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,
+ w()-Fl::box_dw(b)-6, h()-Fl::box_dh(b)-DIR_HEIGHT);
}