Cope better with long package names#216
Cope better with long package names#216DigitalBrains1 wants to merge 2 commits intoSHA2017-badge:masterfrom
Conversation
Remaining bugs;
- If moving to a package below a long package, and the package moved to
is partly out of view, the list does not scroll to get it fully in view.
- Even though it appears that ugfx computes ugfx.get_string_width() the
same way, adding the widths of ugfx.get_char_width() together still
sometimes produces overly long strings, for instance for this package:
;;)''2303211-2194523023klfrsdkfdlk;df;;''''{}{}{[[]]]]])))(()_)}}./.,////\\\\
(No, that wasn't my cat on the keyboard, that's the name of the
package! It's in "uncategorised")
|
I guess we need to disable the 'center vertically' in C code. This code is then probably a nice addition. |
esp32/modules/installer.py
Outdated
| def move_sel(active,dir_): | ||
| if active: | ||
| sel = options.selected_index() | ||
| print("Ingoing:", sel) |
There was a problem hiding this comment.
(and several other print statements)
This looks like debugging. Do we really need it?
There was a problem hiding this comment.
Oops, yes, I forgot to remove that. Fixed.
I think that would entail changing the gdispGFillStringBox() call to a gdispGDrawString() inside BWgwinListDefaultDraw(), file esp32/ugfx_widgets.c. The background is already cleared I think, so that functionality won't be missed. However, it does mean handling clipping separately and the exact position of the text might need to be changed. |
|
In a long list with multiple multi-line items, the cursor doesn't stay on the screen when scrolling down. (e..g installer -> uncategorised) Is it possible to select both lines when a multi-line item is selected? |
Yes, it is a variation on the theme of the first bug I mentioned in the PR. When you change the selection through "ugfx.List.selected_index(i)", the list is not scrolled like it does when it is moved because of a JOY_UP or JOY_DOWN event. It doesn't seem fixable in Python code, and I haven't studied the related C code in depth.
The ugfx list widget supports multi-selection, but I don't think the Python bindings support it: micropython-esp32/esp32/ugfx_widgets.c Line 687 in 6756a75 Maybe this whole thing needs to be fixed in the C side, where the selection bar drawing comes for free. PR #221 could be extended to render the multiple lines in C, and draw them selected. Or maybe PR #221 should be the whole fix, just cutting off everything. |
This fixes a large part of the issue SHA2017-badge/Firmware#192 : it spreads long app titles over multiple lines. When the cursor moves, it moves several lines at once for these long names.
Remaining bugs:
;;)''2303211-2194523023klfrsdkfdlk;df;;''''{}{}{[[]]]]])))(()_)}}./.,////\\
(No, that wasn't my cat on the keyboard, that's the name of the package! It's in "uncategorised".)
I don't readily know how to fix these bugs, which explains them still being there.
Also, the list of installed apps in the launcher suffers from the same issue, I noticed belatedly. So perhaps the better fix is in the C code.