From f3732c7087eafb0ce94f6167c3330217c3d5f189 Mon Sep 17 00:00:00 2001 From: Aleksander Date: Wed, 22 Apr 2026 20:22:45 +0200 Subject: [PATCH] wayvr: improve grid shader, dash-frontend: make pop-up title non-scrollable --- dash-frontend/assets/gui/dashboard.xml | 3 +- .../assets/gui/view/popup_window.xml | 15 ++++--- dash-frontend/src/tab/settings/mod.rs | 1 - wayvr/src/shaders/grid.frag | 43 +++++++++++++------ wgui/src/windowing/context_menu.rs | 2 +- 5 files changed, 44 insertions(+), 20 deletions(-) diff --git a/dash-frontend/assets/gui/dashboard.xml b/dash-frontend/assets/gui/dashboard.xml index 7d5a9a4c..8f2b05f4 100644 --- a/dash-frontend/assets/gui/dashboard.xml +++ b/dash-frontend/assets/gui/dashboard.xml @@ -86,7 +86,8 @@ round="8" flex_grow="1" width="100%" - overflow_y="scroll" + overflow="scroll" + position="relative" > - - + position="relative" + > +
+ +
- \ No newline at end of file + diff --git a/dash-frontend/src/tab/settings/mod.rs b/dash-frontend/src/tab/settings/mod.rs index f6e09be8..5477078e 100644 --- a/dash-frontend/src/tab/settings/mod.rs +++ b/dash-frontend/src/tab/settings/mod.rs @@ -475,7 +475,6 @@ impl SettingType { | Self::UiGradientIntensity | Self::UprightScreenFix | Self::DoubleCursorFix - | Self::ScreenRenderDown | Self::Language | Self::CaptureMethod ) diff --git a/wayvr/src/shaders/grid.frag b/wayvr/src/shaders/grid.frag index 467aec41..d9016ae1 100644 --- a/wayvr/src/shaders/grid.frag +++ b/wayvr/src/shaders/grid.frag @@ -1,18 +1,37 @@ #version 310 es precision highp float; -layout (location = 0) in vec2 in_uv; -layout (location = 0) out vec4 out_color; +layout(location = 0) in vec2 in_uv; +layout(location = 0) out vec4 out_color; -void main() -{ - float fade = max(1.0 - 2.0 * length(in_uv.xy + vec2(-0.5, -0.5)), 0.0); - float grid; +const float circle_smoothness = 0.0025; +const float circle_thickness = 0.01; +const float circle_opacity = 0.3; +const float circle_size = 0.1; - if (fract(in_uv.x / 0.0005) < 0.01 || fract(in_uv.y / 0.0005) < 0.01) { - grid = 1.0; - } else { - grid = 0.0; - } - out_color = vec4(1.0, 1.0, 1.0, grid * fade); +float calc_grid(vec2 coord, float m) { + vec2 grid = fract(coord * m); + return (step(m, grid.x) * step(m, grid.y)); +} + +float calc_circle(float dist, float size) { + float c1 = size; + float c2 = size - circle_thickness; + + return smoothstep(c1, c1 - circle_smoothness, dist) * + smoothstep(c2 - circle_smoothness, c2, dist); +} + +void main() { + float dist = length(in_uv.xy + vec2(-0.5, -0.5)); + float fade = max(1.0 - 2.0 * dist, 0.0); + + float mask = 1.0 - calc_grid(in_uv.xy * 1000.0, 0.02); + + mask = max(mask, (calc_circle(dist, circle_size) + + calc_circle(dist, circle_size * 2.0) + + calc_circle(dist, circle_size * 3.0)) * + circle_opacity); + + out_color = vec4(1.0, 1.0, 1.0, mask * fade); } diff --git a/wgui/src/windowing/context_menu.rs b/wgui/src/windowing/context_menu.rs index ef0c0bf9..16e62d01 100644 --- a/wgui/src/windowing/context_menu.rs +++ b/wgui/src/windowing/context_menu.rs @@ -8,7 +8,7 @@ use crate::{ globals::WguiGlobals, i18n::Translation, layout::Layout, - parser::{self, Fetchable, ParserData, ParserState}, + parser::{self, Fetchable, ParserState}, task::Tasks, windowing::window::{WguiWindow, WguiWindowParams, WguiWindowParamsExtra}, };