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

WIP - Introduce new all_widgets.rs example that actually uses all widgets. Use this same gui between different backend examples for easier testing and comparison. #851

Merged
merged 5 commits into from
Nov 3, 2016

Conversation

mitchmindtree
Copy link
Contributor

WIP

The old all_widgets.rs example has been renamed to old_demo.rs.

The idea behind this new example is to:

  1. Actually demonstrate all widgets in a single example that is easy to add to as we add more widgets and
  2. Abstract the DemoApp, gui function and Theme used into their own module so that they can be re-used between the all_widgets.rs, glutin_glium.rs and glutin_gfx.rs examples. This should make it easier to get the glutin_glium.rs and glutin_gfx.rs examples going, as we can refer to the all_widgets.rs as a "correct" example. Related to Draw the remaining render::Primitives within the glutin_glium.rs example #752.

The new example is a small, vertically scrollable window which demonstrates each widget under their own heading for clarity. It begins with primitive widgets before showing more complex widgets.

The new example can be seen by cloning this fork and executing this command:

cargo run --release --example all_widgets

Widgets included so far:

  • Text
  • Rectangle
  • Oval
  • Circle
  • Line
  • PointPath
  • Polygon
  • Image (rust logo)
  • Canvas
  • NumberDialer
  • PlotPath
  • Button
  • XYPad
  • Toggle
  • Scrollbar
  • Image (demonstrate use of each color channel)
  • DropDownList
  • EnvelopeEditor
  • List
  • ListSelect
  • Matrix
  • RangeSlider
  • Slider
  • TextBox
  • TextEdit
  • TitleBar

@clicketyclack I haven't added all widgets to this yet, but maybe we can merge this anyway for now as I believe all the primitives are demo'd and they're probably the most important ones for testing on your fork? Interested to see how similar the examples are on your fork!

Note: While putting this together I noticed that the Scroll event in the conrod::backend::glutin is broken (it always scrolls downwards by big jumps, despite the direction of input), but that could probably be fixed in a follow up PR.

… provided by support module (the same GUI used in all_widgets.rs).
…rovided by support module (the same GUI used in all_widgets.rs).
@mitchmindtree
Copy link
Contributor Author

Not sure why travis is failing on cargo test here, as the support/mod.rs file should be ignored as it's in a nested directory. Running all of the examples standalone works fine.

@mitchmindtree
Copy link
Contributor Author

Ahh, the problem was that the mod support; line was not feature gated in the glutin_glium.rs and glutin_gfx.rs examples. Fixed now, though travis will probably still fail due to rust-lang/rust#37352.

@clicketyclack
Copy link
Contributor

I'm fine with a merge. My contribution schedule may be infrequent.

@mitchmindtree
Copy link
Contributor Author

Okydoke, merging for now, shall do the remaining widgets in a future PR.

@mitchmindtree mitchmindtree merged commit ff672c9 into PistonDevelopers:master Nov 3, 2016
@mitchmindtree mitchmindtree mentioned this pull request Nov 3, 2016
@mitchmindtree mitchmindtree deleted the all_widgets branch November 23, 2016 09:56
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

Successfully merging this pull request may close these issues.

2 participants