1/*
2 * SPDX-FileCopyrightText: 2020 Arjen Hiemstra <ahiemstra@heimr.nl>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#pragma once
8
9#include "shadowedrectanglematerial.h"
10
11/**
12 * A material rendering a rectangle with a shadow and a border.
13 *
14 * This material uses a distance field shader to render a rectangle with a
15 * shadow below it, optionally with rounded corners and a border.
16 */
17class ShadowedBorderRectangleMaterial : public ShadowedRectangleMaterial
18{
19public:
20 ShadowedBorderRectangleMaterial();
21
22 QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const override;
23 QSGMaterialType *type() const override;
24 int compare(const QSGMaterial *other) const override;
25
26 float borderWidth = 0.0;
27 QColor borderColor = Qt::black;
28
29 static QSGMaterialType staticType;
30};
31
32class ShadowedBorderRectangleShader : public ShadowedRectangleShader
33{
34public:
35 ShadowedBorderRectangleShader(ShadowedRectangleMaterial::ShaderType shaderType);
36
37 bool updateUniformData(QSGMaterialShader::RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override;
38};
39

source code of kirigami/src/scenegraph/shadowedborderrectanglematerial.h