Skip to content

Commit

Permalink
Selection color fixes, widget screenshot added to top of docs.
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8420 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
erco77 committed Feb 13, 2011
1 parent 83fab91 commit d0d159d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions FL/Fl_Tree.H
Expand Up @@ -45,6 +45,9 @@
///
/// \brief Tree widget.
///
/// \image html tree-simple.png "Fl_Tree example program"
/// \image latex tree-simple.png "Fl_Tree example program" width=4cm
///
/// \code
/// Fl_Tree // Top level widget
/// |--- Fl_Tree_Item // Items in the tree
Expand Down
Binary file added documentation/src/tree-simple.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Fl_Tree.cxx
Expand Up @@ -93,7 +93,7 @@ Fl_Tree::Fl_Tree(int X, int Y, int W, int H, const char *L) : Fl_Group(X,Y,W,H,L
_callback_reason = FL_TREE_REASON_NONE;
_scrollbar_size = 0; // 0: uses Fl::scrollbar_size()
box(FL_DOWN_BOX);
color(FL_WHITE);
color(FL_BACKGROUND2_COLOR, FL_SELECTION_COLOR);
when(FL_WHEN_CHANGED);
_vscroll = new Fl_Scrollbar(0,0,0,0); // will be resized by draw()
_vscroll->hide();
Expand Down
12 changes: 6 additions & 6 deletions src/Fl_Tree_Item.cxx
Expand Up @@ -562,12 +562,12 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Widget *tree,
W += prefs.openicon()->w();
}
// Colors, fonts
Fl_Color fg = _selected ? _labelbgcolor : _labelfgcolor; // selected uses bgcolor, unselected uses fgcolor
Fl_Color bg = _selected ? tree->selection_color() : _labelbgcolor; // selected uses selectcolor, unselected uses bgcolor
if ( ! _active ) {
fg = fl_inactive(fg);
if ( _selected ) bg = fl_inactive(bg);
}
Fl_Color fg = _selected ? fl_contrast(_labelfgcolor, tree->selection_color())
: _active ? _labelfgcolor
: fl_inactive(_labelfgcolor);
Fl_Color bg = _selected ? _active ? tree->selection_color()
: fl_inactive(tree->selection_color())
: _labelbgcolor;
// Update the xywh of this item
_xywh[0] = X;
_xywh[1] = Y;
Expand Down

0 comments on commit d0d159d

Please sign in to comment.