diff --git a/include/nana/gui/widgets/listbox.hpp b/include/nana/gui/widgets/listbox.hpp index 34c0dfcd..36b2ffb9 100644 --- a/include/nana/gui/widgets/listbox.hpp +++ b/include/nana/gui/widgets/listbox.hpp @@ -1149,9 +1149,11 @@ namespace nana : public widget_geometrics { color_proxy header_bgcolor{static_cast(0xf1f2f4)}; + color_proxy header_fgcolor{ static_cast(0x000000) }; color_proxy header_grabbed{ static_cast(0x8BD6F6)}; color_proxy header_floated{ static_cast(0xBABBBC)}; color_proxy item_selected{ static_cast(0xD5EFFC) }; + color_proxy item_highlighted{ static_cast(0xD5EFFC) }; /// The max column width which is generated by fit_content is allowed. It is ignored when it is 0, or a max value is passed to fit_content. unsigned max_fit_content{ 0 }; @@ -1454,7 +1456,7 @@ the nana::detail::basic_window member pointer scheme export_options& def_export_options(); private: drawerbase::listbox::essence & _m_ess() const; - nana::any* _m_anyobj(size_type cat, size_type index, bool allocate_if_empty) const; + nana::any* _m_anyobj(size_type cat, size_type index, bool allocate_if_empty) const override; drawerbase::listbox::category_t* _m_assoc(std::shared_ptr, bool create_if_not_exists); void _m_erase_key(nana::detail::key_interface*); }; diff --git a/include/nana/gui/widgets/menu.hpp b/include/nana/gui/widgets/menu.hpp index 02372079..c6bc81a7 100644 --- a/include/nana/gui/widgets/menu.hpp +++ b/include/nana/gui/widgets/menu.hpp @@ -144,6 +144,7 @@ namespace nana /// Closes the menu. It does not destroy the menu; just close the window for the menu. void close(); void image(std::size_t pos, const paint::image& icon); + void change_text(std::size_t pos, const std::string& text); void check_style(std::size_t pos, checks); void checked(std::size_t pos, bool); bool checked(std::size_t pos) const; diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index cd40636f..ce211cc4 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -3393,7 +3393,7 @@ namespace nana const auto border_color = essence_->scheme_ptr->header_bgcolor.get_color().blend(colors::black, 0.8); int text_top = (r.height - essence_->scheme_ptr->text_height) / 2 + r.y; - auto text_color = essence_->lister.wd_ptr()->fgcolor(); + auto text_color = essence_->scheme_ptr->header_fgcolor.get_color(); auto state = item_state::normal; //check whether grabing an item, if item_spliter_ != npos, that indicates the grab item is a spliter. @@ -3784,7 +3784,7 @@ namespace nana if (item.flags.selected) bgcolor = bgcolor.blend(colors::black, 0.98); // or "selected" else - bgcolor = bgcolor.blend(essence_->scheme_ptr->item_selected, 0.7); /// \todo create a parametre for amount of blend + bgcolor = bgcolor.blend(essence_->scheme_ptr->item_highlighted, 0.7); /// \todo create a parametre for amount of blend } unsigned show_w = (std::min)(content_r.width, width - essence_->scroll.x_offset()); diff --git a/source/gui/widgets/menu.cpp b/source/gui/widgets/menu.cpp index 05c428ce..e3addb5c 100644 --- a/source/gui/widgets/menu.cpp +++ b/source/gui/widgets/menu.cpp @@ -1158,6 +1158,11 @@ namespace nana impl_->mbuilder.data().items.at(index).image = img; } + void menu::change_text(std::size_t index, const std::string& text) + { + impl_->mbuilder.data().items.at(index).text = text; + } + bool menu::link(std::size_t index, menu& menu_obj) { if(impl_->mbuilder.set_sub_menu(index, menu_obj.impl_->mbuilder.data()))