Commit 80a19c1d authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/modules/Common/Image/RoundedImage): supports color mask

parent 92389c1c
......@@ -4,9 +4,11 @@
<file>assets/images/attachment_normal.svg</file>
<file>assets/images/attachment_pressed.svg</file>
<file>assets/images/auto_answer.svg</file>
<file>assets/images/a-v-a-t-a-r-120120@3x.png</file>
<file>assets/images/call_hovered.svg</file>
<file>assets/images/call_normal.svg</file>
<file>assets/images/call_pressed.svg</file>
<file>assets/images/cat.jpg</file>
<file>assets/images/chat_error.svg</file>
<file>assets/images/chat_hovered.svg</file>
<file>assets/images/chat_normal.svg</file>
......
......@@ -99,6 +99,10 @@ void App::registerTypes () {
);
// Register models.
qmlRegisterUncreatableType<ContactModel>(
"Linphone", 1, 0, "ContactModel", "ContactModel is uncreatable"
);
ContactsListProxyModel::initContactsListModel(new ContactsListModel());
qmlRegisterType<ContactsListProxyModel>("Linphone", 1, 0, "ContactsListProxyModel");
......
......@@ -4,6 +4,8 @@ import QtQuick 2.7
Item {
property alias source: image.source
property color colorMask: '#00000000'
// vec4(0.812, 0.843, 0.866, 1.0) 0.9
Item {
id: imageContainer
......@@ -26,17 +28,21 @@ Item {
layer {
effect: ShaderEffect {
property var image: imageContainer
property var color: colorMask
fragmentShader: '
uniform lowp sampler2D image;
uniform lowp sampler2D mask;
uniform lowp float qt_Opacity;
uniform lowp vec4 color;
uniform lowp float qt_Opacity;
varying highp vec2 qt_TexCoord0;
void main () {
gl_FragColor = texture2D(image, qt_TexCoord0) *
texture2D(mask, qt_TexCoord0).a *
vec4 tex = texture2D(image, qt_TexCoord0);
gl_FragColor = mix(tex, vec4(color.rgb, 1.0), color.a) *
texture2D(mask, qt_TexCoord0) *
qt_Opacity;
}
'
......
......@@ -15,7 +15,7 @@ QtObject {
}
property QtObject sphere: QtObject {
property color color: Colors.r
property color color: Colors.x
property int size: 10
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment