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 text input #312

Merged
merged 6 commits into from
Jul 15, 2022
Merged

Egui text input #312

merged 6 commits into from
Jul 15, 2022

Conversation

Kryptos-FR
Copy link
Contributor

Implement UI.TextInput (single line for now).

It supports having a mutable or immutable initial value. In case a non-existing variable is given, it will expose it.

;; const string
(UI.TextInput "You can't edit this!")

;; immutable variable
"Hello World!" = .imm
(UI.TextInput .imm)

;; mutable variable
"Lorem ipsum" >= .mut
(UI.TextInput .mut)

;; exposing a new string variable
(UI.TextInput .new)

Manipulating the dyn TextBuffer is optimized to only clone when the string capacity is not sufficient. Otherwise it does pointer arithmetic to move slices of memory around.

@codecov
Copy link

codecov bot commented Jul 12, 2022

Codecov Report

Merging #312 (722dcdb) into devel (7e94ecf) will decrease coverage by 31.14%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##            devel     #312       +/-   ##
===========================================
- Coverage   76.37%   45.22%   -31.15%     
===========================================
  Files         155      154        -1     
  Lines       25846    24805     -1041     
===========================================
- Hits        19739    11218     -8521     
- Misses       6107    13587     +7480     
Impacted Files Coverage Δ
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%) ⬇️
include/ops.hpp 22.67% <0.00%> (-66.76%) ⬇️
... and 49 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e94ecf...722dcdb. Read the comment docs.

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.

Minor notes/questions. otherwise looks good.

rust/src/shards/gui/widgets/text_input.rs Outdated Show resolved Hide resolved
rust/src/shards/gui/widgets/text_input.rs Outdated Show resolved Hide resolved
rust/src/shards/gui/widgets/text_input.rs Show resolved Hide resolved
@Kryptos-FR Kryptos-FR requested a review from guusw July 15, 2022 08:48
@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 mentioned this pull request Jul 15, 2022
Must implement hasCompose()
Avoid allocating new memory when the backend string has enough capacity.
It works but they are some duplicated code parts
rust/src/shards/gui/widgets/text_input.rs Outdated Show resolved Hide resolved
@Kryptos-FR Kryptos-FR merged commit 9441bce into devel Jul 15, 2022
@Kryptos-FR Kryptos-FR deleted the egui_text_input branch July 15, 2022 13:53
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