Chatterino
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
chatterino::ColorPickerDialog Class Reference

A custom color picker dialog. More...

#include <ColorPickerDialog.hpp>

Inheritance diagram for chatterino::ColorPickerDialog:
[legend]
Collaboration diagram for chatterino::ColorPickerDialog:
[legend]

Public Member Functions

 ColorPickerDialog (const QColor &initial, QWidget *parent)
 Create a new color picker dialog that selects the initial color. More...
 
 ~ColorPickerDialog ()
 
QColor selectedColor () const
 Return the final color selected by the user. More...
 
- Public Member Functions inherited from chatterino::BasePopup
 BasePopup (FlagsEnum< BaseWindow::Flags > flags_=None, QWidget *parent=nullptr)
 
- Public Member Functions inherited from chatterino::BaseWindow
 BaseWindow (FlagsEnum< Flags > flags_=None, QWidget *parent=nullptr)
 
 ~BaseWindow () override
 
void setInitialBounds (const QRect &bounds)
 
QRect getBounds ()
 
QWidget * getLayoutContainer ()
 
bool hasCustomWindowFrame ()
 
TitleBarButtonaddTitleBarButton (const TitleBarButtonStyle &style, std::function< void()> onClicked)
 
EffectLabeladdTitleBarLabel (std::function< void()> onClicked)
 
void setStayInScreenRect (bool value)
 
bool getStayInScreenRect () const
 
void setActionOnFocusLoss (ActionOnFocusLoss value)
 
ActionOnFocusLoss getActionOnFocusLoss () const
 
void moveTo (QWidget *widget, QPoint point, bool offset=true)
 
virtual float scale () const override
 
float qtFontScale () const
 
- Public Member Functions inherited from chatterino::BaseWidget
 BaseWidget (QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
 
boost::optional< float > overrideScale () const
 
void setOverrideScale (boost::optional< float >)
 
QSize scaleIndependantSize () const
 
int scaleIndependantWidth () const
 
int scaleIndependantHeight () const
 
void setScaleIndependantSize (int width, int height)
 
void setScaleIndependantSize (QSize)
 
void setScaleIndependantWidth (int value)
 
void setScaleIndependantHeight (int value)
 
float qtFontScale () const
 

Public Attributes

pajlada::Signals::Signal< QColor > closed
 
QLabel * label
 
std::vector< ColorButton * > colors
 
struct {
   QLabel *   label
 
   std::vector< ColorButton * >   colors
 
recent
 
struct {
   QLabel *   label
 
   std::vector< ColorButton * >   colors
 
def
 
ColorButtoncolor
 
struct {
   QLabel *   label
 
   ColorButton *   color
 
selected
 
QColorPickercolorPicker
 
QColorLuminancePickerluminancePicker
 
std::array< QLabel *, 4 > spinBoxLabels
 
std::array< QColSpinBox *, 4 > spinBoxes
 
QLabel * htmlLabel
 
QLineEdit * htmlEdit
 
struct {
   QColorPicker *   colorPicker
 
   QColorLuminancePicker *   luminancePicker
 
   std::array< QLabel *, 4 >   spinBoxLabels
 
   std::array< QColSpinBox *, 4 >   spinBoxes
 
   QLabel *   htmlLabel
 
   QLineEdit *   htmlEdit
 
picker
 
- Public Attributes inherited from chatterino::BaseWindow
pajlada::Signals::NoArgSignal closing
 
QLayout * windowLayout = nullptr
 
QHBoxLayout * titlebarBox = nullptr
 
QWidget * titleLabel = nullptr
 
TitleBarButtonminButton = nullptr
 
TitleBarButtonmaxButton = nullptr
 
TitleBarButtonexitButton = nullptr
 
QWidget * layoutBase = nullptr
 
std::vector< Button * > buttons
 
- Public Attributes inherited from chatterino::BaseWidget
pajlada::Signals::Signal< float > scaleChanged
 

Protected Member Functions

void closeEvent (QCloseEvent *)
 
void themeChangedEvent ()
 
- Protected Member Functions inherited from chatterino::BasePopup
void keyPressEvent (QKeyEvent *e) override
 
bool handleEscape (QKeyEvent *e, QDialogButtonBox *buttonBox)
 
bool handleEnter (QKeyEvent *e, QDialogButtonBox *buttonBox)
 
- Protected Member Functions inherited from chatterino::BaseWindow
virtual bool nativeEvent (const QByteArray &eventType, void *message, long *result) override
 
virtual void scaleChangedEvent (float) override
 
virtual void paintEvent (QPaintEvent *) override
 
virtual void changeEvent (QEvent *) override
 
virtual void leaveEvent (QEvent *) override
 
virtual void resizeEvent (QResizeEvent *) override
 
virtual void moveEvent (QMoveEvent *) override
 
virtual void showEvent (QShowEvent *) override
 
virtual bool event (QEvent *event) override
 
virtual void wheelEvent (QWheelEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void updateScale ()
 
- Protected Member Functions inherited from chatterino::BaseWidget
virtual void childEvent (QChildEvent *) override
 
void setScale (float value)
 
void clearShortcuts ()
 

Additional Inherited Members

- Public Types inherited from chatterino::BaseWindow
enum  Flags {
  None = 0, EnableCustomFrame = 1, Frameless = 2, TopMost = 4,
  DisableCustomScaling = 8, FramelessDraggable = 16, DontFocus = 32, Dialog = 64
}
 
enum  ActionOnFocusLoss { Nothing, Delete, Close, Hide }
 
- Static Public Member Functions inherited from chatterino::BaseWindow
static bool supportsCustomWindowFrame ()
 
- Protected Attributes inherited from chatterino::BaseWindow
QPointF movingRelativePos
 
bool moving {}
 
boost::optional< QColor > overrideBackgroundColor_
 
- Protected Attributes inherited from chatterino::BaseWidget
Themetheme
 
std::vector< QShortcut * > shortcuts_
 
pajlada::Signals::SignalHolder signalHolder_
 

Detailed Description

A custom color picker dialog.

This class exists because QColorPickerDialog did not suit our use case. This dialog provides buttons for recently used and default colors, as well as a color picker widget identical to the one used in QColorPickerDialog.

Constructor & Destructor Documentation

◆ ColorPickerDialog()

chatterino::ColorPickerDialog::ColorPickerDialog ( const QColor &  initial,
QWidget *  parent 
)

Create a new color picker dialog that selects the initial color.

You can connect to the ::closed signal of this instance to get notified when the dialog is closed.

Here is the call graph for this function:

◆ ~ColorPickerDialog()

chatterino::ColorPickerDialog::~ColorPickerDialog ( )

Member Function Documentation

◆ closeEvent()

void chatterino::ColorPickerDialog::closeEvent ( QCloseEvent *  )
protectedvirtual

Reimplemented from chatterino::BaseWindow.

Here is the call graph for this function:

◆ selectedColor()

QColor chatterino::ColorPickerDialog::selectedColor ( ) const

Return the final color selected by the user.

Note that this method will always return the invalid color if the dialog is still open, or if the dialog has not been confirmed.

Returns
The color selected by the user, if the dialog was confirmed. The invalid color, if the dialog has not been confirmed.
Here is the caller graph for this function:

◆ themeChangedEvent()

void chatterino::ColorPickerDialog::themeChangedEvent ( )
protectedvirtual

Reimplemented from chatterino::BaseWindow.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ closed

pajlada::Signals::Signal<QColor> chatterino::ColorPickerDialog::closed

◆ color

ColorButton* chatterino::ColorPickerDialog::color

◆ colorPicker

QColorPicker* chatterino::ColorPickerDialog::colorPicker

◆ colors

std::vector<ColorButton *> chatterino::ColorPickerDialog::colors

◆ def

struct { ... } chatterino::ColorPickerDialog::def

◆ htmlEdit

QLineEdit* chatterino::ColorPickerDialog::htmlEdit

◆ htmlLabel

QLabel* chatterino::ColorPickerDialog::htmlLabel

◆ label

QLabel* chatterino::ColorPickerDialog::label

◆ luminancePicker

QColorLuminancePicker* chatterino::ColorPickerDialog::luminancePicker

◆ picker

struct { ... } chatterino::ColorPickerDialog::picker

◆ recent

struct { ... } chatterino::ColorPickerDialog::recent

◆ selected

struct { ... } chatterino::ColorPickerDialog::selected

◆ spinBoxes

std::array<QColSpinBox *, 4> chatterino::ColorPickerDialog::spinBoxes

◆ spinBoxLabels

std::array<QLabel *, 4> chatterino::ColorPickerDialog::spinBoxLabels

The documentation for this class was generated from the following files: