Skip to content

Nicer looking text selection, especially in light mode #5017

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

Merged
merged 4 commits into from
Aug 27, 2024

Conversation

emilk
Copy link
Owner

@emilk emilk commented Aug 27, 2024

This changes the text selection painting from being painted on top of the text, to being painted behind the text, but in front of any text background. The result is much nicer looking text selection, especially in light mode:

The new selections

Screenshot 2024-08-27 at 18 58 35 Screenshot 2024-08-27 at 18 59 26

What selections used to look like

Screenshot 2024-08-27 at 19 03 08 Screenshot 2024-08-27 at 19 03 23

New selection of some text with a background

Screenshot 2024-08-27 at 18 59 12

@emilk emilk added egui style visuals and theming labels Aug 27, 2024
@emilk emilk merged commit a59f9ed into master Aug 27, 2024
37 checks passed
@emilk emilk deleted the emilk/better-text-selection branch August 27, 2024 17:09
486c pushed a commit to 486c/egui that referenced this pull request Oct 9, 2024
* Closes emilk#4727

This changes the text selection painting from being painted on top of
the text, to being painted behind the text, but in front of any text
background. The result is much nicer looking text selection, especially
in light mode:

### The new selections
<img width="198" alt="Screenshot 2024-08-27 at 18 58 35"
src="https://github.com/user-attachments/assets/bd342946-299c-44ab-bc2d-2aa8ddbca8eb">
<img width="187" alt="Screenshot 2024-08-27 at 18 59 26"
src="https://github.com/user-attachments/assets/352bed32-5150-49b9-a9f9-c7679a0d30b2">


### What selections used to look like
<img width="143" alt="Screenshot 2024-08-27 at 19 03 08"
src="https://github.com/user-attachments/assets/f3cbd798-cfed-4ad4-aa3a-d7480efcfa3c">
<img width="143" alt="Screenshot 2024-08-27 at 19 03 23"
src="https://github.com/user-attachments/assets/9925d18d-da82-4a44-8a98-ea6857ecc14f">


### New selection of some text with a background
<img width="134" alt="Screenshot 2024-08-27 at 18 59 12"
src="https://github.com/user-attachments/assets/1d291d7f-efbd-4efd-b6d2-cd63c9fc4fa4">
hacknus pushed a commit to hacknus/egui that referenced this pull request Oct 30, 2024
* Closes emilk#4727

This changes the text selection painting from being painted on top of
the text, to being painted behind the text, but in front of any text
background. The result is much nicer looking text selection, especially
in light mode:

### The new selections
<img width="198" alt="Screenshot 2024-08-27 at 18 58 35"
src="https://github.com/user-attachments/assets/bd342946-299c-44ab-bc2d-2aa8ddbca8eb">
<img width="187" alt="Screenshot 2024-08-27 at 18 59 26"
src="https://github.com/user-attachments/assets/352bed32-5150-49b9-a9f9-c7679a0d30b2">


### What selections used to look like
<img width="143" alt="Screenshot 2024-08-27 at 19 03 08"
src="https://github.com/user-attachments/assets/f3cbd798-cfed-4ad4-aa3a-d7480efcfa3c">
<img width="143" alt="Screenshot 2024-08-27 at 19 03 23"
src="https://github.com/user-attachments/assets/9925d18d-da82-4a44-8a98-ea6857ecc14f">


### New selection of some text with a background
<img width="134" alt="Screenshot 2024-08-27 at 18 59 12"
src="https://github.com/user-attachments/assets/1d291d7f-efbd-4efd-b6d2-cd63c9fc4fa4">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui style visuals and theming
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nicer looking text selection in light mode
1 participant