Skip to content

Commit

Permalink
Fix wrong assumption & replace outdated todo with useful comment
Browse files Browse the repository at this point in the history
  • Loading branch information
grorp committed Nov 24, 2023
1 parent d5a50f4 commit 8c2d629
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gui/guiFormSpecMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3633,7 +3633,7 @@ void GUIFormSpecMenu::drawMenu()
NULL, m_client, IT_ROT_HOVERED);
}

/* TODO find way to show tooltips on touchscreen */
// On touchscreens, m_pointer is set by GUIModalMenu::preprocessEvent instead.
#ifndef HAVE_TOUCHSCREENGUI
m_pointer = RenderingEngine::get_raw_device()->getCursorControl()->getPosition();
#endif
Expand Down
3 changes: 1 addition & 2 deletions src/gui/guiInventoryList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ void GUIInventoryList::draw()
bool show_tooltip = !item.empty() && hovering && !selected_item;
#ifdef HAVE_TOUCHSCREENGUI
// Make it possible to see item tooltips on touchscreens
// Note that the selected item can't be empty during drawing.
show_tooltip |= hovering && selected;
show_tooltip |= hovering && selected && m_fs_menu->getSelectedAmount() != 0;
#endif
if (show_tooltip) {
std::string tooltip = orig_item.getDescription(client->idef());
Expand Down

0 comments on commit 8c2d629

Please sign in to comment.