New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it possible again to see item tooltips on Android #14029
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks good to me.
Minetest-Android-tooltips.mp4
Probably off-topic
There are some problems (outside this PR) that makes it somewhat annoying to use, but those are for another PR. For example, needing to tap back to put it into the original/source slot (which happens quite often in Android, especially with this PR, for seeing tooltip). Maybe making the tooltip stays drawn until the selected stack is put back down? (I do not know how to do it.)
8c2d629
to
db713ab
Compare
That would be possible, but I'm worried that it would make the tooltips (especially those with a lot of text) too annoying. Also, I find it confusing that the highlight is gone, but the tooltip is still there. If we do this, we should make sure that the highlight stays visible as long as the tooltip is still displayed. diff --git a/src/gui/guiFormSpecMenu.h b/src/gui/guiFormSpecMenu.h
index 5641e39a9a..8df1caee87 100644
--- a/src/gui/guiFormSpecMenu.h
+++ b/src/gui/guiFormSpecMenu.h
@@ -286,6 +286,8 @@ class GUIFormSpecMenu : public GUIModalMenu
bool getAndroidUIInput();
#endif
+ v2s32 getPointerPos() { return m_pointer; };
+
protected:
v2s32 getBasePos() const
{
diff --git a/src/gui/guiInventoryList.cpp b/src/gui/guiInventoryList.cpp
index 6f1d28e0b0..86b0f2b798 100644
--- a/src/gui/guiInventoryList.cpp
+++ b/src/gui/guiInventoryList.cpp
@@ -154,7 +154,8 @@ void GUIInventoryList::draw()
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;
+ show_tooltip |= rect.isPointInside(m_fs_menu->getPointerPos()) &&
+ selected && m_fs_menu->getSelectedAmount() != 0;
#endif
if (show_tooltip) {
std::string tooltip = orig_item.getDescription(client->idef()); |
I agree. That was my random thought on this issue. It is good as it is now for me. By the way, what does the last commit (db713ab) do? |
|
👍 LGTM |
This change is a quick fix so that item tooltips show again on Android.
This change is a quick fix so that item tooltips show again on Android.
This PR is a quick fix so that item tooltips show again on Android. Fixes (<- Github, don't link this please) #13822 (comment), a regression from #13146.
Please test this PR and let me know whether you think that the new behavior of the tooltips makes sense.
To do
This PR is a Ready for Review.
How to test
Play Minetest on a desktop computer. Verify that item tooltips still work the same as before.
Play Minetest on Android. Verify that it is possible to see item tooltips.