1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 13:50:04 -04:00

Change text color of selected text (#7691)

Selected text now gets the color of `visuals.selection.stroke.color`.
This means you can have inverted colors for selected text, like in the
new test:
<img width="154" height="46" alt="image"
src="https://github.com/user-attachments/assets/2666361d-d7e2-4d50-8e4d-2fcc128f1a81"
/>


It also means the color of selected text in labels matches that of the
text color of selected buttons.
This commit is contained in:
Emil Ernerfeldt
2025-11-07 15:34:36 +01:00
committed by GitHub
parent d8dcb31673
commit fa4cfec777
13 changed files with 70 additions and 8 deletions

View File

@@ -449,7 +449,8 @@ impl Rect {
/// Linearly interpolate so that `[0, 0]` is [`Self::min`] and
/// `[1, 1]` is [`Self::max`].
#[inline]
pub fn lerp_inside(&self, t: Vec2) -> Pos2 {
pub fn lerp_inside(&self, t: impl Into<Vec2>) -> Pos2 {
let t = t.into();
Pos2 {
x: lerp(self.min.x..=self.max.x, t.x),
y: lerp(self.min.y..=self.max.y, t.y),