Krita Source Code Documentation
Loading...
Searching...
No Matches
KisColorSamplerPreviewPreview.h
Go to the documentation of this file.
1/*
2 * This file is part of Krita
3 *
4 * SPDX-FileCopyrightText: 2025 Agata Cacko <cacko.azh@gmail.com>
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#ifndef KIS_COLOR_SAMPLER_PREVIEW_PREVIEW_H
10#define KIS_COLOR_SAMPLER_PREVIEW_PREVIEW_H
11
12#include <QLabel>
13
14#include <kritaui_export.h>
15
16
20class KRITAUI_EXPORT KisColorSamplerPreviewPreview : public QLabel
21{
22 Q_OBJECT
23
24public:
25 KisColorSamplerPreviewPreview(QWidget *parent);
26
27
28 void setDiameter(int diameter);
29 void setOutlineEnabled(bool enabled);
30 void setThickness(qreal thickness);
31
32
33 void paintEvent(QPaintEvent *e) override;
34
35
36
37
38private:
39 int m_diameter {200};
40 qreal m_thickness {0.1};
41 bool m_outlineEnabled {true};
42
43
44 QColor m_sampledColorTop {QColor::fromRgb(67, 183, 120)};
45 QColor m_sampledColorBottom {QColor::fromRgb(67, 154, 120)};
46 QColor m_outlineColor {QColor::fromRgbF(0.5, 0.5, 0.5)};
47
48 static constexpr qreal m_outlineThickness {1.0};
49 static constexpr qreal m_roundingMargin {3};
50 static constexpr qreal m_verticalOutlineMargins {10.0};
51 static constexpr qreal m_crossLength {8.0};
52 static constexpr qreal m_crossSpace {2.0};
53 // how much margin of the widget background color is around
54 // to distinguish this widget from interactable ones
55 static constexpr int m_horizontalWidgetMargins {20};
56
57};
58
59#endif // KIS_COLOR_SAMPLER_PREVIEW_PREVIEW_H
A widget that allows to select a combination of auto levels parameters.