From 4cca8c129012c9988e79a20c3f276f3478689e8d Mon Sep 17 00:00:00 2001 From: natureh Date: Sat, 4 Aug 2012 04:10:16 +0200 Subject: [PATCH] Small bugfix: the tooltip of the curve's button was fully initialized only after switching to another type --- rtgui/popupcommon.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rtgui/popupcommon.cc b/rtgui/popupcommon.cc index b4ae794d9..9c0ee4d66 100644 --- a/rtgui/popupcommon.cc +++ b/rtgui/popupcommon.cc @@ -138,8 +138,14 @@ void PopUpCommon::show() { } void PopUpCommon::setButtonHint() { - Glib::ustring hint = !buttonHint.empty() ? buttonHint + " " + sItems.at(selected) : sItems.at(selected); -// if (hasMenu) hint += "\n(" + M("POPUPBUTTON_SELECTOPTIONHINT") + ")"; + Glib::ustring hint; + if (!buttonHint.empty()) { + hint = buttonHint; + if (selected > -1) + hint += " "; + } + if (selected > -1) + hint += sItems.at(selected); button->set_tooltip_markup(hint); } @@ -149,4 +155,5 @@ void PopUpCommon::showMenu(GdkEventButton* event) { void PopUpCommon::set_tooltip_text (const Glib::ustring &text) { buttonHint = text; + setButtonHint(); }