PistonDevelopers / conrod

An easy-to-use, 2D GUI library written entirely in Rust.
Other
3.35k stars 296 forks source link

`Theme` checklist. #140

Open mitchmindtree opened 9 years ago

mitchmindtree commented 9 years ago

Basic Themes are now implemented #139, but there's still a lot of stuff left to do.

If you think of something feel free to add a comment and I'll add it to the list.

Spencer-H commented 8 years ago

Is yml the preferred theme format? Or would it be reasonable to use CSS, perhaps the crates from Servo for dealing with CSS parsing?

mitchmindtree commented 8 years ago

Hey @Spencer-H, sorry again for missing this and thanks for trying to push this discussion along!

I think fully supporting CSS might be overkill for conrod, however I personally don't have enough experience with it to see how we would map it to the Theme type.

.yml as you mentioned could be a nice possibility. However, if we do opt for de-serialization as the way to write custom Themes, I think my personal preference would be to use the .toml format, seeing as most rustaceans should be familiar with it due to it's use with cargo.

That said, I'm currently leaning towards writing a macro to solve custom themes. Some benefits would include:

Would be great to get your thoughts if you're still interested!

Spencer-H commented 8 years ago

It's fine. And as for macros and toml, I assumed that themes would be meant to be something dropped in for a whole system like Qt and GTK themes, I didn't realize we meant for them to be application specific and static. In that case though, a macro makes plenty of sense.

On Aug 28, 2016 4:24 AM, "mitchmindtree" notifications@github.com wrote:

Hey @Spencer-H https://github.com/Spencer-H, sorry again for missing this and thanks for trying to push this discussion along!

I think fully supporting CSS might be overkill for conrod, however I personally don't have enough experience with it to see how we would map it to the Theme type.

.yml as you mentioned could be a nice possibility. However, if we do opt for de-serialization as the way to write custom Themes, I think my personal preference would be to use the .toml format, seeing as most rustaceans should be familiar with it due to it's use with cargo.

That said, I'm currently leaning towards writing a macro to solve custom themes. Some benefits would include:

  • We could make its syntax as ergonomic (or at least close to) the other serialization formats mentioned above.
  • We wouldn't require any 3rd party crate dependencies
  • The custom Theme could be loaded at compile time rather than from a separate file during run time.
  • The user doesn't have to leave rust or learn any other configuration formats.

Would be great to get your thoughts if you're still interested!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PistonDevelopers/conrod/issues/140#issuecomment-242962812, or mute the thread https://github.com/notifications/unsubscribe-auth/AOQ2a5XxumOUtk8w5P7ZipX6a804VIalks5qkUXUgaJpZM4Cu7re .

louy2 commented 7 years ago

+1 for CSS. Maybe also a step in the direction of a XML based layout description language that's all the hype these days in GUI dev, from WAML.C# to HTML.Electron to QML.QtQuick.

drunkwcodes commented 5 years ago

There is a Rust implementation of CSS Syntax Level 3.

https://github.com/servo/rust-cssparser