-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Add UI element that displays status updates #856
Comments
Is it alright if I take a stab at this? |
Of course, go ahead! Let me know, if you have any questions. Thank you for your interest! |
Hey, Is there an easy way to force the window (if possible only the config part) to redraw in order to reflect the newest status update? |
That shouldn't be necessary. The window is redrawn every frame, so hopefully 60 times for second (or slower, depending on your hardware). It shouldn't be necessary to force a redraw, because the next one should be happening in a few milliseconds anyway. egui is an immediate-mode GUI, meaning there isn't any state in the UI components. The whole UI is rebuilt every frame, so it shouldn't be necessary to do anything special to have it reflect the latest status. Please note that I haven't done our egui integration, nor have I worked with this code so far. I might be missing some subtleties. What specifically is your problem? Maybe there's something else going on that isn't related to redrawing? |
Hmm in that case it might be my struct isn't being updated for some reason? For some reason only the first message is being drawn in the ui. |
Sounds reasonable. If you want, you can open a pull request and mark it as a draft, and I'll have a look. |
Sure I will do that shortly |
I opened #911 |
This has been addressed in #911 and #919. Thank you, @devanlooches! Closing. |
Right now, a lot of what's happening with the Fornjot app is only visible on the command-line. This is not user-friendly, since the Fornjot app opens a window, and the user might not expect to receive important information anywhere else. Depending on how the app is started, the user might not even have access to the command-line output.
There are certainly many ways to display status updates in a user-friendly way, but I'd like to start with a single UI element that is flexible enough to display all kinds of status updates: some kind of scrollable text field (I'm sure
egui
provides a suitable widget).Off the top of my head, here's what status updates I think should go into that text field:
Since this information comes from places like
fj-host
, which doesn't have any concept of UI, it probably makes sense to have some kind of struct with methods likereport_error
,report_status_update
(just suggestions; not to be taken too literally) that just stores the message as a string, and can then be used to display the message where appropriate.In the regular UI use case, that would mean
fj-viewer
queries that struct for messages and displays them in the aforementioned text field. When runningfj-app
on the command-line with the--export
argument, which would not result in a window being opened,fj-app
could use the same struct to display the messages on the command-line.I think the appropriate place for that struct would be in
fj-interop
.The text was updated successfully, but these errors were encountered: