10#include "constpropagatingrawpointer.h"
12#include "helperqttypes.h"
15#include <qnamespace.h>
18#include <qsharedpointer.h>
21#include <qstyleoption.h>
23#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
24#include <qtmetamacros.h>
26#include <qobjectdefs.h>
38class SwatchBookPrivate final :
public QObject
58 ~SwatchBookPrivate() noexcept override = default;
60 [[nodiscard]] QSize colorPatchesSizeWithMargin() const;
61 [[nodiscard]]
int cornerRadius() const;
62 void drawMark(const QPoint offset,
63 QPainter *widgetPainter,
65 const SwatchBookPrivate::Mark markSymbol,
66 const QListSizeType row,
67 const QListSizeType column) const;
68 [[nodiscard]]
int horizontalPatchSpacing() const;
69 void initStyleOption(QStyleOptionFrame *option) const;
70 [[nodiscard]] std::pair<QListSizeType, QListSizeType> logicalColumnRowFromPosition(const QPoint position) const;
71 [[nodiscard]]
int normalPatchSpacing() const;
72 [[nodiscard]] QPoint offset(const QStyleOptionFrame &styleOptionFrame) const;
73 [[nodiscard]] QSize patchSizeInner() const;
74 [[nodiscard]] QSize patchSizeOuter() const;
76 void selectSwatch(QListSizeType newCurrentColomn, QListSizeType newCurrentRow);
77 void selectSwatchFromCurrentColor();
78 void updateColorSchemeCache();
79 [[nodiscard]]
int verticalPatchSpacing() const;
80 [[nodiscard]]
int widePatchSpacing() const;
98 QColor m_currentColor;
106 bool m_editable = false;
108 QSharedPointer<PerceptualColor::RgbColorSpace> m_rgbColorSpace;
114 QListSizeType m_selectedColumn = -1;
120 QListSizeType m_selectedRow = -1;
131 QString m_selectionMark;
135 const Qt::Orientations m_wideSpacing;
138 Q_DISABLE_COPY(SwatchBookPrivate)
142 ConstPropagatingRawPointer<SwatchBook> q_pointer;
The namespace of this library.
Array2D< QColor > Swatches
Swatches organized in a grid.
ColorSchemeType
Represents the appearance of a theme.