mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-10 21:18:36 +00:00
fixed docking
This commit is contained in:
parent
1de51b6230
commit
a51a5624f0
@ -675,6 +675,17 @@ impl StyleColor {
|
||||
colors[Self::NavWindowingDimBg as usize] = [0.80, 0.80, 0.80, 0.20];
|
||||
colors[Self::ModalWindowDimBg as usize] = [0.80, 0.80, 0.80, 0.35];
|
||||
|
||||
#[cfg(feature = "docking")]
|
||||
{
|
||||
colors[Self::DockingPreview as usize] = std::array::from_fn(|idx| {
|
||||
let multiplier = if idx == 3 { 0.7 } else { 1.0 };
|
||||
|
||||
colors[Self::HeaderActive as usize][idx] * multiplier
|
||||
});
|
||||
|
||||
colors[Self::DockingEmptyBg as usize] = [0.2, 0.2, 0.2, 1.0];
|
||||
}
|
||||
|
||||
colors
|
||||
}
|
||||
|
||||
@ -757,6 +768,17 @@ impl StyleColor {
|
||||
colors[Self::NavWindowingDimBg as usize] = [0.20, 0.20, 0.20, 0.20];
|
||||
colors[Self::ModalWindowDimBg as usize] = [0.20, 0.20, 0.20, 0.35];
|
||||
|
||||
#[cfg(feature = "docking")]
|
||||
{
|
||||
colors[Self::DockingPreview as usize] = std::array::from_fn(|idx| {
|
||||
let multiplier = if idx == 3 { 0.7 } else { 1.0 };
|
||||
|
||||
colors[Self::Header as usize][idx] * multiplier
|
||||
});
|
||||
|
||||
colors[Self::DockingEmptyBg as usize] = [0.2, 0.2, 0.2, 1.0];
|
||||
}
|
||||
|
||||
colors
|
||||
}
|
||||
|
||||
@ -840,6 +862,17 @@ impl StyleColor {
|
||||
colors[Self::NavWindowingDimBg as usize] = [0.80, 0.80, 0.80, 0.20];
|
||||
colors[Self::ModalWindowDimBg as usize] = [0.20, 0.20, 0.20, 0.35];
|
||||
|
||||
#[cfg(feature = "docking")]
|
||||
{
|
||||
colors[Self::DockingPreview as usize] = std::array::from_fn(|idx| {
|
||||
let multiplier = if idx == 3 { 0.7 } else { 1.0 };
|
||||
|
||||
colors[Self::Header as usize][idx] * multiplier
|
||||
});
|
||||
|
||||
colors[Self::DockingEmptyBg as usize] = [0.2, 0.2, 0.2, 1.0];
|
||||
}
|
||||
|
||||
colors
|
||||
}
|
||||
}
|
||||
@ -1120,6 +1153,7 @@ mod tests {
|
||||
let our_color = dark_colors[i];
|
||||
|
||||
println!("Checking {}..", StyleColor::try_from(i).unwrap());
|
||||
println!("{:?} vs {:?}", imgui_color, our_color);
|
||||
|
||||
for (imgui_color, our_color) in imgui_color.into_iter().zip(our_color.into_iter()) {
|
||||
approx::assert_abs_diff_eq!(imgui_color, our_color, epsilon = 0.01);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user