24#ifndef KLFCOLORCHOOSER_H
25#define KLFCOLORCHOOSER_H
29#include <QApplication>
61 inline int sqSize()
const {
return _size; }
62 inline bool removable()
const {
return _removable; }
76 void setSqSize(
int sqsize);
77 void setRemovable(
bool removable);
94 void internalWantRemove();
175 QColor colorFromValues(
QColor color_base,
int value_a,
int value_b = -1);
182 bool refreshColorFromInternalValues(
int value_a,
int value_b = -1);
186 static int valueFromNewColor(
const QColor& color,
const QString& component);
193 static int valueMax(
const QString& component);
249 void internalChanged(
int newvalue);
286 QSize sizeHint()
const;
287 QSize minimumSizeHint()
const;
311class QListWidgetItem;
342 static void ensureColorListsInstance();
344 static void addRecentColor(
const QColor& col);
369 Ui::KLFColorChooseWidget *u;
376 void fillPalette(KLFColorList *colorlist, QWidget *w);
378 static KLFColorList *_recentcolors;
379 static KLFColorList *_standardcolors;
380 static KLFColorList *_customcolors;
419 static QColor getColor(
QColor startwith = Qt::black,
bool alphaenabled =
true, QWidget *parent = 0);
426 Ui::KLFColorDialog *u;
472 virtual QSize sizeHint()
const;
476 static void setUserMaxColors(
int maxcolors);
512 bool _allowdefaultstate;
516 float _xalignfactor, _yalignfactor;
527 static KLFColorList *_colorlist;
528 static QStyle *mReplaceButtonStyle;
530 static int staticUserMaxColors;
532 static void ensureColorListInstance();
QString defaultStateString() const
void setAlphaEnabled(bool alpha_enabled)
KLFColorChooser(QWidget *parent)
float pixYAlignFactor() const
void setAutoAddToList(bool autoadd)
bool alphaEnabled() const
TRUE if the user can also select opacity (alpha) with this widget.
void paintEvent(QPaintEvent *event)
void setPixXAlignFactor(float xalignfactor)
void setAllowDefaultState(bool allow)
void colorChanged(const QColor &newcolor)
QString defaultStateString
void setShowSize(const QSize &size)
void setSenderPropertyColor()
bool autoAddToList() const
bool allowDefaultState() const
Allow the "default color" state.
void setPixYAlignFactor(float yalignfactor)
float pixXAlignFactor() const
void setColor(const QColor &color)
void setDefaultStateString(const QString &str)
virtual QSize sizeHint() const
void setSqSize(int sqsize)
void setColor(const QColor &col)
void wantRemoveColor(const QColor &color)
void colorActivated(const QColor &color)
void setRemovable(bool removable)
KLFColorClickSquare(QColor color=Qt::white, int size=16, bool removable=true, QWidget *parent=0)
void setColorComponent(const QString &component)
KLFColorComponentSpinBox(QWidget *parent)
void colorChanged(const QColor &color)
QString colorComponent() const
void setColor(const QColor &color)
Base utility class that stores and calculates specific components of a color that is being edited.
QString _colorcomponent_b
static int valueMax(const QString &component)
int valueAFromNewColor(const QColor &color) const
int valueBFromNewColor(const QColor &color) const
A dialog to let the user select a color.
KLFColorChooseWidget * colorChooseWidget()
static QColor getColor(QColor startwith=Qt::black, bool alphaenabled=true, QWidget *parent=0)
void setColor(const QColor &color)
KLFColorDialog(QWidget *parent=0)
Base declarations for klatexformula and some utilities.