egui/crates
Guillaume Schmid 1777bb7789
Implemented window header color change when focused (on top). (#3515)
This PR replaces an old one with many problems (no collapse icon, the
header background was not funny colored, ugly...). It fixes those
problems.

It implements the highlight of the header to the focused window. And
allows the rest of the application to know the selected window. It
allows, for instance, to display multiple windows with images and some
additional meta information about those images on the side panel of the
main window. The side panel updates itself according to the selected
image window.

* Added a theme color for the selected window header.
* Added a function to retrieve the LayerId of the focused window.
* Implemented a simple demo of this function in the demo app where a
message states if the Option window is focused (at the bottom of the
Options window).

![Capture d’écran du 2023-10-30
10-30-39](https://github.com/emilk/egui/assets/18464073/fcea4dbf-2b07-485c-8c41-274ad5c738e4)

A technical point: 
The header color is applied with a transparency of 125 so the
collapsible button becomes visible.
The reason is that the collapsible button is rendered before the rest of
the header and before the header size is known.
We cannot draw the background before knowing this value, so rendering
with transparency is a solution to see the collapsible button through
the header background.

This PR has been sponsored by my company, which left me to do it during
my work time.
This is part of an evil plan to convince them to switch to rust for new
projects :)

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-07 16:57:32 +01:00
..
ecolor Add `DragValue`s for RGB(A) in the color picker (#2734) 2024-01-07 16:12:59 +01:00
eframe `eframe`: Fix building the `wasm32` docs for `docs.rs` (#3757) 2023-12-31 10:26:02 +01:00
egui Implemented window header color change when focused (on top). (#3515) 2024-01-07 16:57:32 +01:00
egui-wgpu Bump `winit` to `0.29.7` (#3753) 2024-01-02 07:27:52 +01:00
egui-winit Ignore extra SHIFT and ALT when matching modifiers (#3769) 2024-01-05 10:53:14 +01:00
egui_demo_app Fix some clippy 1.75 lints (#3754) 2023-12-30 11:23:21 +01:00
egui_demo_lib Implemented window header color change when focused (on top). (#3515) 2024-01-07 16:57:32 +01:00
egui_extras Fix: apply edited `DragValue` when it looses focus (#3776) 2024-01-06 23:51:51 +01:00
egui_glow Fix typo in `crates/egui_glow/README.md` (#2956) 2024-01-07 16:31:34 +01:00
egui_plot Add a public API for overriding plot legend traces' visibilities (#3534) 2024-01-06 22:35:54 +01:00
egui_web Fix typos (#2866) 2023-04-18 15:52:45 +02:00
emath Add a bunch of `#[inline]` 2023-12-18 17:28:47 +01:00
epaint Fix: allow using the full Private Use Area for custom fonts (#3509) 2024-01-06 22:33:08 +01:00