-
Notifications
You must be signed in to change notification settings - Fork 344
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
[Ready to Merge] UIModeController Class #295
Conversation
I can get that working for you, later tonight, should add an UTF8Util.cpp/h that does the conversion both ways. If it might be useful in other places, if it's just for these 4 then I can easely get you the utf-8 hex for those 4 arrows. ( that u-2191 is utf-16 hex and as utf-8 hex it's e28691 ) You could try doing: And no, it's more complicated than just replacing 21 with e286, that the 90, 91, 92 and 93 stayed the same was just pure conincidence. |
@zigurana Yeah I know, and I think it should be split out to a Unicode.cpp or whatever, with the ability to convert both ways. It does utf-8 to utf-16 ( kinda ), and for this you needed utf-16 to utf-8 ( kinda ) I'll look into it tonight. |
Note this need rebasing currently due to other PRs. Also #306 if accepted would probably affect this PR. |
The unicode characters for arrows are not included in the default ES font, and the default fallback font is not installed. |
An odd suggestion, but perhaps worth considering. Have you tried actually pasting the arrow character in the string in the code directly? I recall doing something like that for a special character for the help popup in OMX Player (I think the "bullet" one) and it worked well. See here: Just a thought. |
Yeah, I tried it, but it causes the whole file to be saved with a different code-page character encoding, and I had no idea what effect that could have. Also, it still does not work, if the font used for rendering does not support the glyph. But thank you for the suggestion, it is indeed the easiest way to get the 'code' for that specific glyph in de string. |
717bb4a
to
8cc0dd9
Compare
Ok, this is now ready to go, I've fixed the fallback fonts to include some that are installed by default on the pi. |
Not sure what this PR does, but at a quick glance it does one big nono in coding, you access es-app code from es-core, that's something that should never be allowed :/ es-core is a support library for es-app, es-app requires es-core to function, but es-core should not require anything from es-app. |
es-core should not be dependent on es-app. I agree. |
I agree, but I have difficulty finding a good solution. To explain : I need to use the ViewController methods (es-app) to reload all views, but I also need the inputs at a very early stage (before they can be consumed by Guicomponents). That happens now in Window (es-core). As most of these components live in es-core (but not all!), it's difficult to find a clean cut there. As a side note : what is the benefit of this split between es-core and es-app? There is only a single user of core, and it seems unlikely that there will be any others soon. So, I am open to fix this, but I need some pointers. |
Ok, I think that I can safely move it to es-app, and hook into the ViewController::input() method, as that is the top of the GuiComponent stack anyways. I'll come with an alternative later today |
8cc0dd9
to
578105c
Compare
Ok, that was not as complicated as I thought. I've moved the UIModeController class to the same directory as ViewController (with which it has the closest interactions anyways). For the |
Wait, I think I have the non-saving settings thing as well, hold this for now please. |
Okay, just a few personal opinions: The CMakeLists, why tabs when everything else there use 4 spaces? And a really personal preference, when I cleaned up the header includes, I set it up in alphabetical order, folders first, then any external includes last. Also, always include files based on root folder, so folder/whatever.h instead of just whatever.h, it helps when several work on a project, and when a project grows, if everything is based on the root folder. Again, just my personal preference. |
Hi Tomaz, thanks for looking at this. Regarding the spaces: short reason: because my IDE at work has tabs set to 4 spaces, and I forgot. Longer reason, because we should decide on a type of formatting, start using Clang or something, and -never- talk about whitespaces again (only slightly joking). The I'll change the includes, I have zero preference, so I'll follow yours. |
ResourceManager::getInstance()->fileExists(path) does check if it's an embedded file that's being asked for, then it does a fs::exists, so I'd suggest you revert those changes for now. |
578105c
to
cf87103
Compare
Ok, updated the PR, reverted the changes to Font.cpp to call ResourceManager's fileExists() method again. UIMode settings are now saved after the popupbox has been shown (and accepted). |
cf87103
to
f3c208f
Compare
* Split out UIMode controller in separate class (in es-app). * Fix passphrase input for wX360 controllers by ignoring hat-inputs * Fix font fallback mechanism on rpi for non ascii characters using new Unicode2Chars() method. * Fix UIMode not being saved due to popup window.
f3c208f
to
1ed075a
Compare
@tomaz82, if you don't have any other concerns, I think this is ready to merge, agreed? |
@joolswills Might know why the split was introduced |
I don't recall anything. Probably was before we forked it? |
No matter, I am not changing it for this PR, that's for sure! |
I'm going to merge this a bit later - so if anyone has any comments - let me know asap. Thanks for your work on this @zigurana |
Thanks |
Allow gamelist subsets storage/customisations per system
[Ready to Merge] UIModeController Class
Refactoring: Split PasskeyListener and UI mode monitoring into new separate class: UIModeController (singleton).
The UIMode code started to end up in too many different locations for my liking, so I practiced implementing a singleton class for it.
The one functional improvement this brings, is that the passkey phrase (as reported by the new popup when changing the UI mode) is now pulled from the passkey actually stored in
settings.xml
:Otherwise, this PR should have no functional changes.
I have one open question for anyone with an interest in this:
I was trying to insert the unicode glyph for the arrow symbols here, but I have no idea how to get that working, anyone has an idea?