Skip to content
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 a simple example to the README #11

Open
philpax opened this issue Sep 23, 2024 · 4 comments
Open

Add a simple example to the README #11

philpax opened this issue Sep 23, 2024 · 4 comments

Comments

@philpax
Copy link

philpax commented Sep 23, 2024

Hiya!

Thanks for the crate; I've successfully spruced up my egui UI with it 🙂

That being said, it took a bit of looking around to figure out how to use it; I had to look through egui-dashboard-template to find the relevant code, and found that a bit difficult as it doesn't document where things are.

To help with that, I'd suggest:

  • adding a simple example of how to use the crate in the README - this can just be a few lines where the trait's imported and set_style is called with Aesthetix::custom_style on one of the styles
  • indicating that egui-dashboard-template is a more complete example with runtime theme selection
  • documenting egui-dashboard-template further so that it's obvious where a developer might look to find egui-aesthetix-related code
@Resonanz
Copy link

Yeah, the example code is way to complicated. A simple example would be super helpful :-)

@philpax
Copy link
Author

philpax commented Oct 26, 2024

For others on this journey, it basically just boils down to this (where ctx is your egui::Context):

ctx.set_style(Arc::new(egui_aesthetix::themes::NordDark.custom_style()));

@thebashpotato
Copy link
Owner

Thanks for the feedback, I'm starting on refactoring the code base today, and adding examples etc.

@saturn77
Copy link

For others on this journey, it basically just boils down to this (where ctx is your egui::Context):

ctx.set_style(Arc::new(egui_aesthetix::themes::NordDark.custom_style()));

@philpax Thanks for this example, was looking for the single one line instantiation of a theme. Definitely would suggest adding this to the examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants