-
Notifications
You must be signed in to change notification settings - Fork 297
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
[Breaking Change] Replace elmesque crate with primitive graphics widgets (see comment for more details). #626
[Breaking Change] Replace elmesque crate with primitive graphics widgets (see comment for more details). #626
Conversation
The Perhaps this is an opportunity to move away from the rustc_serialize crate in favour of serde. |
I think moving to serde now is a good idea. |
Nice! Me like performance! Hulk Smash! |
One issue that I've come across regarding the use of Say that we have _a -> b_ where our child _b_ is a
There are a few issues that are easy to overlook here:
I think this clearly suggests that we need some way of describing that a widget can be a graphical element of some other widget. The question is, what is the ideal way of representing this within conrod? I think there are a few options:
API-wise, there are a couple of options for allowing the user to describe this relationship:
|
@mitchmindtree I like where this is going! As mentioned in #616 I played around with this today. This leads to my second question: I then tried to get rid of elmesque to get a feeling for what has to be done. I ended up calling widget::draw in ui::draw, assembling DrawState from Cache. This does the job but feels kind of messy. Do you already have an architecture in mind that minimizes the necessary changes in widgets? I'm really looking forward to that pull request being finished & merged, would be a pleasure to help! |
@mitchmindtree Thanks for the info! It was clear and well written. I think adding a |
…s_for method to describe when a widget is solely a graphical element of some other widget. Addresses comment in PistonDevelopers#626
Sorry about the wait everyone, will hopefully have this done in the next day or two! 🙏 |
@mitchmindtree No worries! Take your time. |
Nice! Could this be possibly used to create a fast Text Editor for Rust or will the Immediate mode GUI make it more slow and memory intensive? |
@pyros2097 it should be! Conrod is all retained under the hood (it re-uses allocations, strings, textures etc like regular GUIs) and provides ways for drawing lazily, so I don't see why we shouldn't be able to reach speeds close to that of regular retained GUIs, but we'll see 😅 |
@mitchmindtree This is going to be the most epic PR ever! |
This PR needs rebasing. |
…e completing Outline style variant
… label primitive widgets
…ng bounding box of a series of points
…ng their own graphics
@masche842 That would be awesome if you do get a chance (the minimalised |
…g updated_widgets between calls to Ui::set_widgets. Re-implement Ui::draw_if_changed properly
…raph module in order to keep a true-er instantiation order for use within the depth ordering algorithm.
…ct types instead)
Should be fiiiiinally ready 🎉 |
Wow! |
About to head to sleep but will merge and publish this when I wake up if no one beats me to it (or has any issues) 👍 |
…ly compare instantiation order in the following sort
[Breaking Change] Replace elmesque crate with primitive graphics widgets (see comment for more details).
Published as 0.24.0! |
Awesome work! 🎉 |
Thanks @mitchmindtree for this huge and awesome PR! As discussed before I added a sketch for a simple backend implementation here: #658 |
Epic |
This is a WIP - Do not merge just yet.This is quite a hefty change, and in turn is leaking into quite a few areas:
Widget
s will now compose themselves of primitive graphics widgets rather than drawing their ownElement
s orForm
s. This allows us to remove the elmesque crate and use our own graphics layout instead, in turn providing a far simpler (and more efficient) graphics backend.Theme
will now support custom widget styling (rather than hard-coded style types).Sizeable
trait that allow setting aWidget
's dimensions to match the dimensions of some otherWidget
.TitleBar
widget, whichCanvas
will now use instead of its own customTitleBar
type.Widget::picking_passthrough(bool)
method which allows a user to indicate whether their widget should be pick-able by the mouse or other widget picking methods. This is useful for primitive graphics widgets that are only designed to be used as graphical elements, and that are not themselves interactive.Graph::scroll_offset
where the behaviour would be incorrect if two widgets shared bothEdge::Depth
andEdge::Position
.Label
widget in favour of newText
primitive widget that handles automatic line-wrapping, line-spacing, etc.All-in-all I think this should be a massive API improvement, and allow conrod to be a lot simpler to work with regarding graphics (elmesque has been a common point of confusion). It should also be much faster than elmesque as drawing will no longer require near as many allocations.
Closes #421.
Closes #466.
Closes #506.
Closes #509.
Closes #522.
Closes #555.
Makes a start on #576.
Closes #581.
Closes #582.
Closes #616.
Closes #617.
Fixes #628.
Closes #629.