-
Notifications
You must be signed in to change notification settings - Fork 173
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
Fix:gui/internal:Handling resize/rotation #682
Conversation
Resize/rotate is now working on HTML menus and on widget-constructed menus as well (these are handled differently). |
Will it also be possible to get a signal about the rotation for use in changes of the osd layouts? |
@hoehnp: yes, we should be able to get a generic notification about resize (thus also handling rotation for fixed-size displays). |
I think gui_internal_resize is a bit ambiguous. So far to my knowledge it was not possible to catch it and use it for rescaling of osd elements. My idea would be to do it similarly like the click event, which calls a separate function, e.g. navit/navit/osd/core/osd_core.c Line 943 in c094186
|
Yes, definitely, if there is a hook to implement, it should be outside of internal GUI, because the way the map is displayed (and thus OSD items on top of it), is really separate from the GUI implemented in my opinion. |
I still have some work to do on handling table and box resize properly, this is impacting virtual keyboard that is currently not rescaled properly. |
I'm almost there but the code around widget packing is quite complex. |
I'm not an expert, but if you share code/screenshots maybe we can figure it out. |
I had to actually write some code to debug the internal GUI boxes (highlight them in red). I wrote "was" because, in the meantime, I have made progress on this, and it now seems solved by my last commit 91e6a05 (now resizing while displaying the virtual keyboard seems to work). However, I think handling resize properly would actually need to be developped on a per-GUI menu basis. And it seems to me that I could extend the issue with virtual keyboard to all cases where a box is not aligned to the top left (which was the case for the virtual keyboard that is aligned with the bottom of the window). Fortunately, this may be caught properly by the resize handler I wrote (for box widgets), because this handler actually recursively repacks all children of a widget. |
In any case, it seems that the code in this PR is actually working as expected and solves the issue initially targetted (resize/rotation). |
nice work. I think for OSD designers the code with the red lines is for sure a useful patch. |
I'll submit the debugging patch (red lines) in a separate request but this is only active on menus (drawn by the internal GUI), not for OSD items on the map. |
I have tested on Android, and it is actually fixing the rotation also (you don't return to the main menu, or loose anything that you might start typing). |
I still need to do some testing on table widget resizing and this PR should then be ready. |
Development is finsihed for this PR. Please test and tell me if there are corner cases of menus in the internal GUI.
I have submitted the visual debugging in PR #715 |
This patch should handle the issue covered by trac ticket 1149: |
Is this ready to be merged? Would be cool if so, because this fixes something really annoying. |
@metalstrolch, tes, it should be ready, I have tested this on Android and Linux builds. Please let me know if this works correctly for you. |
It's OK for me, tested this under sailfish/et5 on desktop as well. Unfortunately it triggers an old bug in graphics_qt5 that sometimes does not redraw the screen after rotation. But that's clearly NOT an issue of this task. So I think we can merge this. |
Thank you, good work. |
Unfortunately I cannot close the trac ticket, as I don't know how and don't have credentials. |
This change allows dynamically resizing windows using the internal GUI.
Initially, I guess this GUI was targeted for embedded touchscreen devices, but it is also used for Android (probably until the Qt5 GUI is available).
The issue with the internal GUI is that it does not really handle resizing when navigating inside menus and submenus, it merely moves back to the main menu each time there is a resize (and rotation on Android implies resize which is annoying).
Issue #433 has been open to track this.
This PR aims to solve this resize problem, allowing to continue wherever the user is (inside the menus/submenus) in the menu after a resize/rotation.