Skip to content

Commit

Permalink
[NemoIcon] Fixup nemo icon color overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
neochapay committed Jul 31, 2024
1 parent ed6a76e commit 491dbc8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/controls/qml/ApplicationWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ NemoWindow {
id: mainMenuArea
height: parent.height
clip: true
visible: width != 0
width: if(sourceComponent === null) {
return 0
} else if (applicationWindow.isUiPortrait) {
Expand Down
15 changes: 8 additions & 7 deletions src/controls/qml/shaders/NemoIcon.frag
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
layout(location = 0) in vec2 qt_TexCoord0;
layout(location = 0) out vec4 fragColor;

layout(binding = 1) uniform sampler2D source;

layout(std140, binding = 0) uniform buf {
// qt_Matrix and qt_Opacity must always be both present
// if the built-in vertex shader is used.
mat4 qt_Matrix;
float qt_Opacity;

vec4 color;
} ubuf;
};

layout(binding = 1) uniform sampler2D source;

void main()
{
vec4 c = texture(source, qt_TexCoord0);
fragColor = c * ubuf.color * ubuf.qt_Opacity;
}
vec4 pixelColor = texture(source, qt_TexCoord0);
fragColor = vec4(mix(pixelColor.rgb/max(pixelColor.a, 0.00390625), color.rgb/max(color.a, 0.00390625), color.a) * pixelColor.a, pixelColor.a) * qt_Opacity;
}

0 comments on commit 491dbc8

Please sign in to comment.