mirror of
https://github.com/swaywm/sway.git
synced 2026-04-23 06:46:27 -04:00
feat: add round titlebars (#26)
This commit is contained in:
parent
9ee7fa61af
commit
1930bd0d71
12 changed files with 291 additions and 67 deletions
14
sway/desktop/shaders/quad_round_tl.frag
Normal file
14
sway/desktop/shaders/quad_round_tl.frag
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
precision mediump float;
|
||||
varying vec4 v_color;
|
||||
varying vec2 v_texcoord;
|
||||
|
||||
uniform vec2 size;
|
||||
uniform vec2 position;
|
||||
uniform float radius;
|
||||
|
||||
void main() {
|
||||
vec2 q = abs(gl_FragCoord.xy - position - size) - size + radius;
|
||||
float distance = min(max(q.x,q.y),0.0) + length(max(q,0.0)) - radius;
|
||||
float smoothedAlpha = 1.0 - smoothstep(-1.0, 0.5, distance);
|
||||
gl_FragColor = mix(vec4(0), v_color, smoothedAlpha);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue