8#include "colordialog.h"
10#include "constpropagatingrawpointer.h"
11#include "genericcolor.h"
13#include "helperconversion.h"
14#include "helperqttypes.h"
15#include "languagechangeeventfilter.h"
16#include "perceptualsettings.h"
20#include <qbytearray.h>
26#include <qsharedpointer.h>
28#include <qstringliteral.h>
44#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
45#include <qtmetamacros.h>
47#include <qobjectdefs.h>
52class ChromaHueDiagram;
58class WheelColorPicker;
64class ColorDialogPrivate final :
public QObject
68 explicit ColorDialogPrivate(ColorDialog *backLink);
73 virtual ~ColorDialogPrivate() noexcept override = default;
76 static constexpr QListSizeType historyHSwatchCount = 10;
78 static constexpr QListSizeType historyVSwatchCount = 4;
80 static constexpr QListSizeType historySwatchCount =
81 historyHSwatchCount * historyVSwatchCount;
84 QPointer<GradientSlider> m_alphaGradientSlider;
106 QPointer<ChromaHueDiagram> m_chromaHueDiagram;
108 QPointer<MultiSpinBox> m_ciehlcD50SpinBox;
129 QHash<ColorModel, GenericColor> m_currentOpaqueColorAbs;
138 RgbColor m_currentOpaqueColorRgb;
140 bool everShown = false;
142 QPointer<MultiSpinBox> m_hslSpinBox;
146 QPointer<MultiSpinBox> m_hsvSpinBox;
150 QPointer<MultiSpinBox> m_hwbSpinBox;
163 bool m_isColorChangeInProgress = false;
168 bool m_isDirtyRgbLineEdit = false;
170 LanguageChangeEventFilter m_languageChangeEventFilter;
173 PerceptualColor::ColorDialog::DialogLayoutDimensions m_layoutDimensions =
175 ColorDialog::DialogLayoutDimensions::Collapsed
186 PerceptualColor::ColorDialog::DialogLayoutDimensions m_layoutDimensionsEffective = m_layoutDimensions;
193 QPointer<GradientSlider> m_lchLightnessSelector;
207 static inline const
QString m_multispinboxSectionSeparator = QStringLiteral(u" ");
214 QPointer<MultiSpinBox> m_oklchSpinBox;
247 ColorDialog::ColorDialogOptions m_options;
259 QPointer<MultiSpinBox> m_rgbSpinBox;
267 PerceptualSettings &m_settings = PerceptualSettings::instance();
276 const
QString tableRow = QStringLiteral(u"<
tr><td>%1</td><td>%2</td></
tr>");
296 QColor m_wcsBasicDefaultColor;
298 QPointer<WheelColorPicker> m_wheelColorPicker;
303 static constexpr quint8 decimals = 0;
308 static constexpr quint8 okdecimals = decimals + 2;
310 void applyLayoutDimensions();
311 [[nodiscard]]
QColor defaultColor() const;
313 [[nodiscard]]
QWidget *initializeNumericPage();
314 void initializeScreenColorPicker();
315 void loadHistoryFromSettingsToSwatchBook();
316 [[nodiscard]]
QString translateColorModel(cmsColorSpaceSignature model);
319 void readChromaHueDiagramValue();
320 void readColorPatchValue();
321 void readHlcNumericValues();
322 void readHslNumericValues();
323 void readHsvNumericValues();
324 void readHwbNumericValues();
325 void readLightnessValue();
326 void readOklchNumericValues();
327 void readRgbHexValues();
328 void readRgbNumericValues();
329 void readSwatchBookBasicColorsValue();
330 void readSwatchBookHistoryValue();
331 void readWheelColorPickerValues();
333 void retranslateUi();
334 void saveCurrentTab();
340 void updateColorPatch();
341 void updateHlcButBlockSignals();
342 void updateOklchButBlockSignals();
343 void updateRgbHexButBlockSignals();
346 Q_DISABLE_COPY(ColorDialogPrivate)
350 ConstPropagatingRawPointer<ColorDialog> q_pointer;
The namespace of this library.
Array2D< QColor > Swatches
Swatches organized in a grid.
ColorSchemeType
Represents the appearance of a theme.
QString tr(const char *sourceText, const char *disambiguation, int n)