Merge branch 'hotfix-1.7' of https://github.com/ErrorFlynn/nana into ErrorFlynn-hotfix-1.7

This commit is contained in:
Jinhao 2019-05-07 00:29:04 +08:00
commit dfc3cf0cbd
2 changed files with 5 additions and 13 deletions

View File

@ -1568,7 +1568,7 @@ the nana::detail::basic_window member pointer scheme
* @param img_collapsed An icon displayed in front of category title when the category is collapsed.
* @return the reference of *this.
*/
listbox& category_icon(const paint::image& img_expanded, const paint::image&& img_collapsed);
listbox& category_icon(const paint::image& img_expanded, const paint::image& img_collapsed);
/// Returns first visible element
/**

View File

@ -1199,23 +1199,15 @@ namespace nana
return{};
}
/// return a ref to the real item object at display!!! position pos using current sorting only if it is active, and at absolute position if no sorting is currently active.
/// return a ref to the real item object at display position
category_t::container::value_type& at(const index_pair& pos)
{
auto acc_pos = pos.item;
if (npos != sort_attrs_.column)
acc_pos = index_cast(pos, true).item; //convert display position to absolute position
return get(pos.cat)->items.at(acc_pos);
return get(pos.cat)->items.at(index_cast(pos, true).item);
}
const category_t::container::value_type& at(const index_pair& pos) const
{
auto acc_pos = pos.item;
if (npos != sort_attrs_.column)
acc_pos = index_cast(pos, true).item; //convert display position to absolute position
return get(pos.cat)->items.at(acc_pos);
return get(pos.cat)->items.at(index_cast(pos, true).item);
}
std::vector<cell> at_model(const index_pair& pos) const
@ -6043,7 +6035,7 @@ namespace nana
return *this;
}
listbox& listbox::category_icon(const paint::image& img_expanded, const paint::image&& img_collapsed)
listbox& listbox::category_icon(const paint::image& img_expanded, const paint::image& img_collapsed)
{
internal_scope_guard lock;
_m_ess().ctg_icon_renderer = [img_expanded, img_collapsed](paint::graphics& graph, const rectangle& rt_icon, bool expanded)