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

Egui widgets #318

Merged
merged 27 commits into from
Aug 2, 2022
Merged

Egui widgets #318

merged 27 commits into from
Aug 2, 2022

Conversation

Kryptos-FR
Copy link
Contributor

Add a bunch of egui widgets in shards. There are a few remaining and some optional behaviours are not yet implemented, but it should give a good starting point to design an UI with most of the layout and widgets already in place.

widget list

  • checkbox
  • radio button
  • menubar & menu
  • horizontal layout
  • vertical layout
  • separator
  • group
  • progress bar
  • spinner
  • int and float input
  • int and float slider
  • scroll area
  • hyperlink
  • collapsing header

Note that button and label were already implemented in #309.

As it follows #312 where text input is implemented, there are two shared commits here (until #312 is merged).

@Kryptos-FR Kryptos-FR added Project: Shards Scripting/runtime related Type: New Feature New feature or request labels Jul 15, 2022
@Kryptos-FR Kryptos-FR self-assigned this Jul 15, 2022
@codecov
Copy link

codecov bot commented Jul 15, 2022

Codecov Report

Merging #318 (a1bbaad) into devel (ffcbb6b) will decrease coverage by 31.23%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##            devel     #318       +/-   ##
===========================================
- Coverage   76.46%   45.22%   -31.24%     
===========================================
  Files         155      154        -1     
  Lines       25957    24928     -1029     
===========================================
- Hits        19847    11273     -8574     
- Misses       6110    13655     +7545     
Impacted Files Coverage Δ
src/core/shards/casting.cpp 38.48% <100.00%> (-49.25%) ⬇️
src/core/shards/ShaderFastMathLib.h 0.00% <0.00%> (-100.00%) ⬇️
src/core/shards/reflection.cpp 14.28% <0.00%> (-85.72%) ⬇️
src/core/edn/print.hpp 0.00% <0.00%> (-82.54%) ⬇️
src/extra/snappy.cpp 16.66% <0.00%> (-77.78%) ⬇️
src/extra/dsp.cpp 14.75% <0.00%> (-72.96%) ⬇️
src/extra/brotli.cpp 23.52% <0.00%> (-70.59%) ⬇️
src/core/shards/bigint.cpp 25.09% <0.00%> (-70.52%) ⬇️
src/core/shards/time.cpp 15.71% <0.00%> (-70.00%) ⬇️
src/core/shards/channels.cpp 14.71% <0.00%> (-68.40%) ⬇️
... and 50 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

@Kryptos-FR Kryptos-FR force-pushed the egui_widgets branch 2 times, most recently from 29cda5b to cc3b335 Compare July 15, 2022 16:18
sinkingsugar
sinkingsugar previously approved these changes Jul 19, 2022
Copy link
Member

@sinkingsugar sinkingsugar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, can be merged, just collapsable header needs a fix though (compose output type)

rust/src/shards/gui/layouts/collapsing_header.rs Outdated Show resolved Hide resolved
@sinkingsugar
Copy link
Member

No tests at all ?? :((

@Kryptos-FR
Copy link
Contributor Author

No tests at all ?? :((

I plan to update the egui_demo.edn. Should I also write tests in rust?

@sinkingsugar
Copy link
Member

No tests at all ?? :((

I plan to update the egui_demo.edn. Should I also write tests in rust?

no don't worry. I found the demo test eventually :)

Kryptos-FR and others added 20 commits July 28, 2022 15:42
Useful to apply a style to only a part of the UI
UI layout can be deep and having the output of inner shards bubble up is confusing and could lead to unexpected results.
It is also unlikely to be practical as widgets are already organized in a logical fashion.
Users can always introduce a variable if some inner output needs to be used elsewhere.
Copy link
Member

@guusw guusw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, had some questions though.

.github/workflows/build-windows.yml Outdated Show resolved Hide resolved
rust/src/shards/gui/layouts/group.rs Show resolved Hide resolved
rust/src/shards/gui/widgets/numeric_slider.rs Show resolved Hide resolved
Code was duplicated when exposing contents variables and when exposing the UI parents.
Copy link
Member

@sinkingsugar sinkingsugar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go

@Kryptos-FR Kryptos-FR merged commit 74be6c5 into devel Aug 2, 2022
@Kryptos-FR Kryptos-FR deleted the egui_widgets branch August 2, 2022 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Project: Shards Scripting/runtime related Type: New Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants