• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • krita API Reference
  • KDE Home
  • Contact Us
 

KritaWidgets

  • sources
  • kfour-appscomplete
  • krita
  • libs
  • widgets
KisDlgInternalColorSelector.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Wolthera van Hovell tot Westerflier <[email protected]>, (C) 2016
3  *
4  * SPDX-License-Identifier: GPL-2.0-or-later
5  */
6 
7 #ifndef KISDLGINTERNALCOLORSELECTOR_H
8 #define KISDLGINTERNALCOLORSELECTOR_H
9 
10 #include "kritawidgets_export.h"
11 #include "KoColor.h"
12 #include "KoColorSpace.h"
13 #include "KoColorDisplayRendererInterface.h"
14 #include "KoColorSet.h"
15 
16 #include <QScopedPointer>
17 #include <QDialog>
18 
19 #include "KisScreenColorSamplerBase.h"
20 
21 class Ui_WdgDlgInternalColorSelector;
22 class KoColorPatch;
23 
29 class KRITAWIDGETS_EXPORT KisDlgInternalColorSelector : public QDialog
30 {
31  Q_OBJECT
32 
33  static std::function<KisScreenColorSamplerBase *(QWidget *)> s_screenColorSamplerFactory;
34 
35 public:
36 
37  static void setScreenColorSamplerFactory(std::function<KisScreenColorSamplerBase *(QWidget *)> f) {
38  s_screenColorSamplerFactory = f;
39  }
40 
41  struct Config
42  {
43  Config() :
44 #ifdef Q_OS_ANDROID
45  modal(false),
46 #else
47  modal(true),
48 #endif
49  visualColorSelector(true),
50  paletteBox(true),
51  screenColorSampler(true),
52  prevNextButtons(true),
53  hexInput(true),
54  useAlpha(false){}
55  bool modal;
56  bool visualColorSelector;
57  bool paletteBox;
58  bool screenColorSampler;
59  bool prevNextButtons;
60  bool hexInput;
61  bool useAlpha;
62  };
63 
64  KisDlgInternalColorSelector(QWidget* parent, KoColor color, Config config, const QString &caption, const KoColorDisplayRendererInterface *displayRenderer = KoDumbColorDisplayRenderer::instance());
65  ~KisDlgInternalColorSelector() override;
66 
71  void colorSpaceChanged(const KoColorSpace *cs);
72 
78  void lockUsedColorSpace(const KoColorSpace *cs);
79 
85  void setDisplayRenderer(const KoColorDisplayRendererInterface *displayRenderer);
86 
96  static KoColor getModalColorDialog(const KoColor color, QWidget* parent = 0, QString caption = QString());
97 
102  KoColor getCurrentColor();
103 
104  void chooseAlpha(bool chooseAlpha);
105 
106 Q_SIGNALS:
116  void signalForegroundColorChosen(KoColor color);
117 
118 public Q_SLOTS:
126  void slotColorUpdated(KoColor newColor);
127 
133  void slotSetColorFromPatch(KoColorPatch* patch);
134 
139  void setPreviousColor(KoColor c);
140 
141  void reject() override;
142 
143 private Q_SLOTS:
144 
145  void slotSelectorModelChanged();
146  void endUpdateWithNewColor();
147 
152  void slotFinishUp();
153 
158  void slotSetColorFromHex();
159 
160  void slotChangePalette(KoColorSetSP set);
161 
162 protected:
163  void showEvent(QShowEvent *event) override;
164 
165 private:
166  void focusInEvent(QFocusEvent *) override;
172  void updateAllElements(QObject *source);
173 
174 private:
175  Ui_WdgDlgInternalColorSelector *m_ui;
176  struct Private; //The private struct
177  const QScopedPointer<Private> m_d; //the private pointer
178 };
179 
180 #endif // KISDLGINTERNALCOLORSELECTOR_H
KisDlgInternalColorSelector::Config::paletteBox
bool paletteBox
Definition: KisDlgInternalColorSelector.h:57
QDialog::reject
virtual void reject()
KisDlgInternalColorSelector::Config::Config
Config()
Definition: KisDlgInternalColorSelector.h:43
QWidget
KisScreenColorSamplerBase.h
KisDlgInternalColorSelector::Config::modal
bool modal
Definition: KisDlgInternalColorSelector.h:55
QObject
KisDlgInternalColorSelector::Config::screenColorSampler
bool screenColorSampler
Definition: KisDlgInternalColorSelector.h:58
QString
QFocusEvent
KisScreenColorSamplerBase
Definition: KisScreenColorSamplerBase.h:15
KisDlgInternalColorSelector
The KisInternalColorSelector class.
Definition: KisDlgInternalColorSelector.h:29
QDialog::showEvent
virtual void showEvent(QShowEvent *event)
QShowEvent
QWidget::focusInEvent
virtual void focusInEvent(QFocusEvent *event)
QScopedPointer< Private >
KisDlgInternalColorSelector::Config::visualColorSelector
bool visualColorSelector
Definition: KisDlgInternalColorSelector.h:56
KisDlgInternalColorSelector::Config::useAlpha
bool useAlpha
Definition: KisDlgInternalColorSelector.h:61
KisDlgInternalColorSelector::Config::hexInput
bool hexInput
Definition: KisDlgInternalColorSelector.h:60
KisDlgInternalColorSelector::Config::prevNextButtons
bool prevNextButtons
Definition: KisDlgInternalColorSelector.h:59
QDialog
KisDlgInternalColorSelector::Config
Definition: KisDlgInternalColorSelector.h:41
KoColorPatch
SPDX-FileCopyrightText: 2006 C.
Definition: KoColorPatch.h:18
KisDlgInternalColorSelector::setScreenColorSamplerFactory
static void setScreenColorSamplerFactory(std::function< KisScreenColorSamplerBase *(QWidget *)> f)
Definition: KisDlgInternalColorSelector.h:37
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Jan 23 2021 11:48:22 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KritaWidgets

Skip menu "KritaWidgets"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

krita API Reference

Skip menu "krita API Reference"
  • libs
  •   KritaBasicFlakes
  •   brush
  •   KritaUndo2
  •   KritaFlake
  •   image
  •   KritaPlugin
  •   Krita
  •   KritaPigment
  •   KritaResources
  •   KritaStore
  •   ui
  •   KritaWidgets
  •   KritaWidgetUtils
  • plugins
  •   Assitants
  •   Extensions
  •   Filters
  •   Generators
  •   Formats
  •           src
  •   PaintOps
  •     libpaintop

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal