Skip to content

Commit

Permalink
Clip text in file list properly.
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2196 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed May 6, 2002
1 parent 10351f0 commit 070a404
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES
@@ -1,6 +1,7 @@
CHANGES IN FLTK 1.1.0rc2

- Portability fixes.
- Fl_File_Browser didn't clip items to the column width.
- Fl_Window::draw() cleared the window label but didn't
restore it, so windows could lose their titles.
- Eliminated multiple definitions of dirent structure
Expand Down
17 changes: 14 additions & 3 deletions src/Fl_File_Browser.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_File_Browser.cxx,v 1.1.2.14 2002/05/02 14:31:10 easysw Exp $"
// "$Id: Fl_File_Browser.cxx,v 1.1.2.15 2002/05/06 04:11:50 easysw Exp $"
//
// Fl_File_Browser routines.
//
Expand Down Expand Up @@ -342,7 +342,18 @@ Fl_File_Browser::item_draw(void *p, // I - List item data
// Tab - nul terminate this fragment and draw it...
*ptr = '\0';

fl_draw(fragment, x + width, y, w - width, fl_height(),
int cW = w - width; // Clip width...

if (columns)
{
// Try clipping inside this column...
for (i = 0; i < column && columns[i]; i ++);

if (columns[i])
cW = columns[i];
}

fl_draw(fragment, x + width, y, cW, fl_height(),
(Fl_Align)(FL_ALIGN_LEFT | FL_ALIGN_CLIP), 0, 0);

// Advance to the next column...
Expand Down Expand Up @@ -627,5 +638,5 @@ Fl_File_Browser::filter(const char *pattern) // I - Pattern string


//
// End of "$Id: Fl_File_Browser.cxx,v 1.1.2.14 2002/05/02 14:31:10 easysw Exp $".
// End of "$Id: Fl_File_Browser.cxx,v 1.1.2.15 2002/05/06 04:11:50 easysw Exp $".
//

0 comments on commit 070a404

Please sign in to comment.