Small bugfix: the tooltip of the curve's button was fully initialized only after switching to another type

This commit is contained in:
natureh
2012-08-04 04:10:16 +02:00
parent 21d7685d89
commit 4cca8c1290

View File

@@ -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();
}