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

TextEdit: Change margin property to egui::Margin type #3993

Conversation

bu5hm4nn
Copy link
Contributor

@bu5hm4nn bu5hm4nn commented Feb 7, 2024

Despite their being an actual egui::Margin struct, Textedit has a margin() builder function that supports only Vec2 types and thereby only symmetric margins. This PR changes the function to accept egui::Margin type instead making it more congruent with overall egui logic as well as supporting asymmetric margins.

P.S: I tried to run all checks but I had to modify ./rust-toolchain to 1.67.0 to get the checks to run on macOS.

…al `Margin` struct for consistency and to support asymmetric margins.
Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

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

Thanks!

crates/egui/src/widgets/text_edit/builder.rs Outdated Show resolved Hide resolved
crates/egui/src/widgets/text_edit/builder.rs Outdated Show resolved Hide resolved
crates/egui/src/widgets/text_edit/builder.rs Outdated Show resolved Hide resolved
crates/egui/src/widgets/text_edit/builder.rs Outdated Show resolved Hide resolved
crates/egui/src/widgets/text_edit/builder.rs Outdated Show resolved Hide resolved
bu5hm4nn and others added 2 commits February 7, 2024 11:12
…xtedit-margin-property-to-margin-struct

# Conflicts:
#	crates/egui/src/widgets/text_edit/builder.rs
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
@bu5hm4nn bu5hm4nn requested a review from emilk February 7, 2024 17:28
@emilk emilk changed the title Textedit Widget: Change margin property to egui::Margin type TextEdit: Change margin property to egui::Margin type Feb 10, 2024
@emilk emilk added layout Related to widget layout egui labels Feb 10, 2024
@emilk
Copy link
Owner

emilk commented Feb 10, 2024

The code doesn't compile yet :)

crates/egui/src/widgets/drag_value.rs Outdated Show resolved Hide resolved
@emilk emilk merged commit 4875b01 into emilk:master Feb 13, 2024
19 checks passed
@bu5hm4nn bu5hm4nn deleted the feature/change-textedit-margin-property-to-margin-struct branch February 14, 2024 12:38
bu5hm4nn added a commit to bu5hm4nn/egui that referenced this pull request Feb 15, 2024
Despite their being an actual `egui::Margin` struct, Textedit has a
`margin()` builder function that supports only `Vec2` types and thereby
only symmetric margins. This PR changes the function to accept
`egui::Margin` type instead making it more congruent with overall egui
logic as well as supporting asymmetric margins.

P.S: I tried to run all checks but I had to modify `./rust-toolchain` to
1.67.0 to get the checks to run on macOS.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
bu5hm4nn added a commit to bu5hm4nn/egui that referenced this pull request Feb 15, 2024
Despite their being an actual `egui::Margin` struct, Textedit has a
`margin()` builder function that supports only `Vec2` types and thereby
only symmetric margins. This PR changes the function to accept
`egui::Margin` type instead making it more congruent with overall egui
logic as well as supporting asymmetric margins.

P.S: I tried to run all checks but I had to modify `./rust-toolchain` to
1.67.0 to get the checks to run on macOS.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
bu5hm4nn added a commit to bu5hm4nn/egui that referenced this pull request Mar 8, 2024
Despite their being an actual `egui::Margin` struct, Textedit has a
`margin()` builder function that supports only `Vec2` types and thereby
only symmetric margins. This PR changes the function to accept
`egui::Margin` type instead making it more congruent with overall egui
logic as well as supporting asymmetric margins.

P.S: I tried to run all checks but I had to modify `./rust-toolchain` to
1.67.0 to get the checks to run on macOS.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui layout Related to widget layout
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants