widget gallery and compositor test bench
Enable forced alpha blending/opacity and configure 350px transparent surface layout to allow dropdown to expand down beyond visible borders
src/main.rs | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/main.rs b/src/main.rs
index 6608200..a59ff67 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -191,6 +191,9 @@ impl State {
let lh = ph as f32 / scale as f32;
let sw = lw;
let sh = lh;
+
+ let is_ramp_child = is_child && (child_type.as_deref() == Some("Ramp") || child_type.as_deref() == Some("ColorRamp"));
+ let opacity = opacity || is_ramp_child;
let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor {
backends: wgpu::Backends::VULKAN,
@@ -1460,9 +1463,9 @@ fn child_positions(
) -> Vec<(f32, f32, f32, f32)> {
if child_type == Some("Ramp") || child_type == Some("ColorRamp") {
let bg_y = 0.0;
- let bg_h = sh;
- let ramp_pos = (10.0, 39.0, sw - 20.0, 140.0);
- let close_pos = ((sw - 100.0) / 2.0, sh - 45.0, 100.0, 30.0);
+ let bg_h = 200.0;
+ let ramp_pos = (10.0, 10.0, sw - 20.0, 140.0);
+ let close_pos = ((sw - 100.0) / 2.0, 160.0, 100.0, 30.0);
vec![
(0.0, bg_y, sw, bg_h), // 0 bg
ramp_pos, // 1 Ramp
@@ -1907,7 +1910,7 @@ impl PointerHandler for AppState {
.arg("--width")
.arg("450")
.arg("--height")
- .arg("250")
+ .arg("350")
.arg("--backplate");
let _ = cmd.spawn();
}
@@ -1920,7 +1923,7 @@ impl PointerHandler for AppState {
.arg("--width")
.arg("450")
.arg("--height")
- .arg("250")
+ .arg("350")
.arg("--backplate");
let _ = cmd.spawn();
}
@@ -1980,7 +1983,7 @@ impl PointerHandler for AppState {
.arg("--width")
.arg("450")
.arg("--height")
- .arg("250")
+ .arg("350")
.arg("--backplate");
let _ = cmd.spawn();
}
@@ -2381,7 +2384,7 @@ fn main() {
Some("LayerTop") => (800.0, 40.0),
Some("LayerOverlay") => (300.0, 180.0),
Some("LayerBackground") => (800.0, 600.0),
- Some("Ramp") | Some("ColorRamp") => (450.0, 250.0),
+ Some("Ramp") | Some("ColorRamp") => (450.0, 350.0),
_ => (400.0, 250.0),
}
}