From c0664eefcde176a015d21af4ef04f665d5a6b7dc Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 29 Oct 2006 12:13:56 +0000 Subject: 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 --- src/Fl_File_Browser.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') 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) { -- cgit v1.2.3