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 Label::halign #4975

Merged
merged 7 commits into from
Aug 26, 2024
Merged

Add Label::halign #4975

merged 7 commits into from
Aug 26, 2024

Conversation

rustbasic
Copy link
Contributor

@rustbasic rustbasic commented Aug 17, 2024

Function to specify Align to Label

There are cases where you want to display Label on the left or right regardless of other Layout specifications.

Before : Note the part showing the rust source code.
20240818-1

After : Note the part showing the rust source code.
20240818-2

@rustbasic rustbasic changed the title Function to specify Align to Lable Function to specify Align to Label Aug 18, 2024
@bircni
Copy link
Contributor

bircni commented Aug 18, 2024

maybe change the function name to text_align as this only aligns the text inside the label not the label itself

@rustbasic
Copy link
Contributor Author

maybe change the function name to text_align as this only aligns the text inside the label not the label itself

Yes, that would be great too. Let's wait for emilk's review.

crates/egui/src/widgets/label.rs Outdated Show resolved Hide resolved
crates/egui/src/widgets/label.rs Outdated Show resolved Hide resolved
@emilk emilk changed the title Function to specify Align to Label Add Label::halign Aug 26, 2024
@emilk emilk added egui feature New feature or request labels Aug 26, 2024
@emilk emilk merged commit 47c0aeb into emilk:master Aug 26, 2024
19 of 22 checks passed
486c pushed a commit to 486c/egui that referenced this pull request Oct 9, 2024
Function to specify `Align` to `Label`

There are cases where you want to display `Label` on the left or right
regardless of other `Layout` specifications.

Before : Note the part showing the rust source code.

![20240818-1](https://github.com/user-attachments/assets/a08f7594-1ec1-4c6a-b96d-1a5f735d02c1)

After : Note the part showing the rust source code.

![20240818-2](https://github.com/user-attachments/assets/807ff9cf-f8cd-4415-9c78-b62869d1696d)

---------

Co-authored-by: Emil Ernerfeldt <[email protected]>
hacknus pushed a commit to hacknus/egui that referenced this pull request Oct 30, 2024
Function to specify `Align` to `Label`

There are cases where you want to display `Label` on the left or right
regardless of other `Layout` specifications.

Before : Note the part showing the rust source code.

![20240818-1](https://github.com/user-attachments/assets/a08f7594-1ec1-4c6a-b96d-1a5f735d02c1)

After : Note the part showing the rust source code.

![20240818-2](https://github.com/user-attachments/assets/807ff9cf-f8cd-4415-9c78-b62869d1696d)

---------

Co-authored-by: Emil Ernerfeldt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants