toolbar: show text inside the button

Added function/method both to toolbar and item_proxy:
void textout(size_type index, bool show); ///< Show/Hide the text inside the button

Before: button without image weren't display
Now: button without image is display as empty square. In case the textout is on the text is show
This commit is contained in:
besh81
2019-05-09 09:44:37 +02:00
parent 5422c43002
commit 67f5d1743f
2 changed files with 47 additions and 12 deletions

View File

@@ -55,6 +55,8 @@ namespace nana
std::string toggle_group() const; ///< Returns the toggle group associated with the tool (only if tool style is toggle).
item_proxy& toggle_group(const ::std::string& group); ///< Adds the tool to a toggle group (only if tool style is toggle).
item_proxy& textout(bool show); ///< Show/Hide the text inside the button
private:
nana::toolbar* const tb_;
std::size_t const pos_;
@@ -73,6 +75,8 @@ namespace nana
bool toggle{ false };
std::string group;
bool textout{ false };
item_type(const std::string& text, const nana::paint::image& img, tool_type type)
:text(text), image(img), type(type)
{}
@@ -148,6 +152,8 @@ namespace nana
std::string toggle_group(size_type index) const; ///< Returns the toggle group associated with the tool (only if tool style is toggle).
void toggle_group(size_type index, const ::std::string& group); ///< Adds the tool to a toggle group (only if tool style is toggle).
void textout(size_type index, bool show); ///< Show/Hide the text inside the button
void scale(unsigned s); ///< Sets the scale of control button.
/// Enable to place buttons at right part. After calling it, every new button is right aligned.