Making the UX closer to popular OS & APPs

salborrelli
Posts: 8
Joined: Mon Nov 23, 2015 4:33 pm
Location: Italy
Contact:

Re: Making the UX closer to popular OS & APPs

Post by salborrelli »

impaktor wrote:It would be very valuable with input from robn here, I suspect, or jpab who seems to understand that newUI stuff as well.

Keep in mind: I don't know what I'm talking about, but I had the notion of pioneer's Lua-newUI stacking windows on top of each other, so pressing ESC should just close the top one and the next one is revealed. The only special case might be WorldView, where we might want the settings dialogue box. Maybe I can poke robn in the weekend.
A stack of windows would make things far easier indeed, but from a quick check into the code I haven't been able to locate such structure. Sure there is a GuiStack class which could be a good candidate, but it seems this class is unused at the moment.

Could someone clarify if there is really a stack of View objects that I can use for switching from the current view to the previous one? If there is no such view then I can always go on with the approach which I have specified into the Excel: less flexible but working and certainly enough from the point of view of enhancing the UX.
jpab
Posts: 77
Joined: Thu Jul 18, 2013 12:30 pm
Location: UK

Re: Making the UX closer to popular OS & APPs

Post by jpab »

Sorry for the long delay in response.

There isn't a stack of View objects, but the new-ui root object (the 'UI::Context' class) holds a stack of UI::Layer objects. Only the top Layer receives input. Layers are currently used for implementing modal dialogs (e.g., look at the implementation of doLoadDialog in data/ui/MainMenu.lua) and similar things. I recommend reading the comment blocks in src/ui/Context.h, src/ui/Widget.h and src/ui/Container.h, which provide some overview of the structure.
salborrelli
Posts: 8
Joined: Mon Nov 23, 2015 4:33 pm
Location: Italy
Contact:

Re: Making the UX closer to popular OS & APPs

Post by salborrelli »

Thank you for the explanation jpab, it will be useful for ESCaping from the mission details dialog at the very least. At this point I think I've enough information to start the project, but I'll contact you for sure if I have further questions.
salborrelli
Posts: 8
Joined: Mon Nov 23, 2015 4:33 pm
Location: Italy
Contact:

Re: Making the UX closer to popular OS & APPs

Post by salborrelli »

For completeness, I have finally published a PR containing a new behaviour for the ESC button. For anyone whom might be interested, you can check the details here:

https://github.com/pioneerspacesim/pioneer/pull/3618
Post Reply