1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Support both mouse and touch input in GUIs in a single binary (#14146)

This commit is contained in:
grorp 2023-12-27 22:37:36 +01:00 committed by GitHub
parent 4f1dbb127a
commit 32e492837c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 95 additions and 83 deletions

View file

@ -152,10 +152,10 @@ void GUIInventoryList::draw()
// Add hovering tooltip
bool show_tooltip = !item.empty() && hovering && !selected_item;
#ifdef HAVE_TOUCHSCREENGUI
// Make it possible to see item tooltips on touchscreens
show_tooltip |= hovering && selected && m_fs_menu->getSelectedAmount() != 0;
#endif
if (m_fs_menu->getPointerType() == PointerType::Touch) {
show_tooltip |= hovering && selected && m_fs_menu->getSelectedAmount() != 0;
}
if (show_tooltip) {
std::string tooltip = orig_item.getDescription(client->idef());
if (m_fs_menu->doTooltipAppendItemname())