diff options
| author | Greg Ercolano <erco@seriss.com> | 2016-07-21 00:51:14 +0000 |
|---|---|---|
| committer | Greg Ercolano <erco@seriss.com> | 2016-07-21 00:51:14 +0000 |
| commit | e92fa6914b0a3f50621aa57bdf9b7e59a22904fc (patch) | |
| tree | d211329ebf90db738d2ff742f350291021512b93 /src | |
| parent | aa5ac8656d89626841f1e236d0883577537736db (diff) | |
Bringing over fix [r11840] from 1.3 current to the porting branch.
Solves STR#3294; added methods to let user set the userdeicon,
and removed the performance degrading automatic deicon creation.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11841 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Tree_Item.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Fl_Tree_Item.cxx b/src/Fl_Tree_Item.cxx index 3472f8e99..9b0239617 100644 --- a/src/Fl_Tree_Item.cxx +++ b/src/Fl_Tree_Item.cxx @@ -95,7 +95,7 @@ Fl_Tree_Item::~Fl_Tree_Item() { } _widget = 0; // Fl_Group will handle destruction _usericon = 0; // user handled allocation - if ( _userdeicon ) delete _userdeicon; // delete our copy (if any) for deactivated icon + _userdeicon = 0; // user handled allocation // focus item? set to null if ( _tree && this == _tree->_item_focus ) { _tree->_item_focus = 0; } @@ -1108,12 +1108,12 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Tree_Item *itemfocus, // Item has user icon? Use it int uicon_y = item_y_center - (usericon()->h() >> 1); if ( active ) usericon()->draw(uicon_x,uicon_y); - else userdeicon()->draw(uicon_x,uicon_y); + else if ( userdeicon() ) userdeicon()->draw(uicon_x,uicon_y); } else if ( render && prefs.usericon() ) { // Prefs has user icon? Use it int uicon_y = item_y_center - (prefs.usericon()->h() >> 1); if ( active ) prefs.usericon()->draw(uicon_x,uicon_y); - else prefs.userdeicon()->draw(uicon_x,uicon_y); + else if ( prefs.userdeicon() ) prefs.userdeicon()->draw(uicon_x,uicon_y); } // Draw item's content xmax = draw_item_content(render); |
