summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2006-10-29 12:13:56 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2006-10-29 12:13:56 +0000
commitc0664eefcde176a015d21af4ef04f665d5a6b7dc (patch)
treec58215123479f74637ace49261cefa28d5af01fc
parentcec43a6cb1d889b16c0b1e872e81c08e71045663 (diff)
Fl_File_Browser did not calculate the width of directory items
correctly (STR #1470) src/Fl_File_Browser.cxx: - Fl_File_Browser::item_width(): Use a bold font for directory items. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5529 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES2
-rw-r--r--src/Fl_File_Browser.cxx11
2 files changed, 9 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index f04d8ed73..5e7239730 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.8
+ - Fl_File_Browser did not calculate the width of
+ directory items correctly (STR #1470)
- Fl_Pack incorrectly started widgets at an offset of 1/2
the spacing value.
- FLUID did not generate correct window class code if
diff --git a/src/Fl_File_Browser.cxx b/src/Fl_File_Browser.cxx
index a09a61984..abb6ff697 100644
--- a/src/Fl_File_Browser.cxx
+++ b/src/Fl_File_Browser.cxx
@@ -3,7 +3,7 @@
//
// Fl_File_Browser routines.
//
-// Copyright 1999-2005 by Michael Sweet.
+// Copyright 1999-2006 by Michael Sweet.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -167,13 +167,16 @@ Fl_File_Browser::item_width(void *p) const // I - List item data
const int *columns; // Columns
- // Set the font and size...
- fl_font(textfont(), textsize());
-
// Scan for newlines...
line = (FL_BLINE *)p;
columns = column_widths();
+ // Set the font and size...
+ if (line->txt[strlen(line->txt) - 1] == '/')
+ fl_font(textfont() | FL_BOLD, textsize());
+ else
+ fl_font(textfont(), textsize());
+
if (strchr(line->txt, '\n') == NULL &&
strchr(line->txt, column_char()) == NULL)
{