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

Custom frames for windows not applied correctly #4002

Closed
Tearth opened this issue Feb 7, 2024 · 4 comments · Fixed by #4009
Closed

Custom frames for windows not applied correctly #4002

Tearth opened this issue Feb 7, 2024 · 4 comments · Fixed by #4009
Labels
bug Something is broken

Comments

@Tearth
Copy link

Tearth commented Feb 7, 2024

Describe the bug
Since version 0.25 there is a visual bug when we set a custom window frame. In 0.24 the code below was making the window all green (as expected) with little margin.

let frame = egui::containers::Frame::none()
    .fill(egui::Color32::from_rgb(180, 220, 160))
    .inner_margin(egui::Margin::symmetric(20.0, 20.0));

In 0.25 and 0.26 the same code makes it only partially green with title bar area still with its original color, which is also not properly adjusted to the title.

image

To Reproduce
Steps to reproduce the behavior:

  1. Go to egui_demo_lib -> window_options.rs
  2. Find creation of "demo_window_options" window
  3. Make it as below:
use super::View as _;
let frame = egui::containers::Frame::none() // <-- new
	.fill(egui::Color32::from_rgb(180, 220, 160)) // <-- new
	.inner_margin(egui::Margin::symmetric(20.0, 20.0)); // <-- new
let mut window = egui::Window::new(title)
	.id(egui::Id::new("demo_window_options"))
	.frame(frame) // <-- new
	.resizable(resizable)
	.constrain(constrain)
	.collapsible(collapsible)
	.title_bar(title_bar)
	.scroll2(scroll2)
	.enabled(enabled);

Expected behavior
Just as in 0.24 and earlier, the whole window area should be colored green with no exception for title bar.

@Tearth Tearth added the bug Something is broken label Feb 7, 2024
@emilk
Copy link
Owner

emilk commented Feb 8, 2024

Was this solved by #3995 ?

@Tearth
Copy link
Author

Tearth commented Feb 8, 2024

Sadly no, I was testing it on the most recent master which already includes fix from #3995.

@rustbasic
Copy link
Contributor

rustbasic commented Feb 8, 2024

@Tearth
Is the color-related thing similar to
#3806 ?

@Tearth
Copy link
Author

Tearth commented Feb 10, 2024

@Tearth Is the color-related thing similar to #3806 ?

Seems like yes, and turns out adding context.style_mut(|p| p.visuals.window_highlight_topmost = false); similarly as you did in your issue fixed the thing - the window is now displayed as I was used to before 0.25. Thanks for the link!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants