Fix broken thumbnail butto tooltips

This commit is contained in:
Ingo Weyrich
2019-07-29 15:21:23 +02:00
parent f523149582
commit 0f0dc03849
5 changed files with 19 additions and 12 deletions

View File

@@ -745,20 +745,24 @@ void ThumbBrowserBase::Internal::on_realize()
bool ThumbBrowserBase::Internal::on_query_tooltip (int x, int y, bool keyboard_tooltip, const Glib::RefPtr<Gtk::Tooltip>& tooltip)
{
// Gtk signals automatically acquire the GUI (i.e. this method is enclosed by gdk_thread_enter and gdk_thread_leave)
Glib::ustring ttip = "";
Glib::ustring ttip;
boolean useMarkup = false;
{
MYREADERLOCK(l, parent->entryRW);
for (size_t i = 0; i < parent->fd.size(); i++)
if (parent->fd[i]->drawable && parent->fd[i]->inside (x, y)) {
ttip = parent->fd[i]->getToolTip (x, y);
std::tie(ttip, useMarkup) = parent->fd[i]->getToolTip (x, y);
break;
}
}
if (!ttip.empty()) {
tooltip->set_text(ttip);
if (useMarkup) {
tooltip->set_markup(ttip);
} else {
tooltip->set_text(ttip);
}
return true;
} else {
return false;