Commit d39cecc3 authored by Wolthera van Hövell's avatar Wolthera van Hövell 🐛

Rename the internal color selector dialog to reflect it being a dialog

parent afc8658b
...@@ -66,7 +66,7 @@ set(kritaui_LIB_SRCS ...@@ -66,7 +66,7 @@ set(kritaui_LIB_SRCS
dialogs/kis_dlg_png_import.cpp dialogs/kis_dlg_png_import.cpp
dialogs/kis_dlg_import_image_sequence.cpp dialogs/kis_dlg_import_image_sequence.cpp
dialogs/kis_delayed_save_dialog.cpp dialogs/kis_delayed_save_dialog.cpp
dialogs/kis_internal_color_selector.cpp dialogs/kis_dlg_internal_color_selector.cpp
flake/kis_node_dummies_graph.cpp flake/kis_node_dummies_graph.cpp
flake/kis_dummies_facade_base.cpp flake/kis_dummies_facade_base.cpp
flake/kis_dummies_facade.cpp flake/kis_dummies_facade.cpp
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include "kis_config_notifier.h" #include "kis_config_notifier.h"
#include "kis_color_input.h" #include "kis_color_input.h"
struct KisInternalColorSelector::Private struct KisDlgInternalColorSelector::Private
{ {
bool allowUpdates = true; bool allowUpdates = true;
KoColor currentColor; KoColor currentColor;
...@@ -53,7 +53,7 @@ struct KisInternalColorSelector::Private ...@@ -53,7 +53,7 @@ struct KisInternalColorSelector::Private
KisHexColorInput *hexColorInput; KisHexColorInput *hexColorInput;
}; };
KisInternalColorSelector::KisInternalColorSelector(QWidget *parent, KoColor color, Config config, const QString &caption, const KoColorDisplayRendererInterface *displayRenderer) KisDlgInternalColorSelector::KisDlgInternalColorSelector(QWidget *parent, KoColor color, Config config, const QString &caption, const KoColorDisplayRendererInterface *displayRenderer)
: QDialog(parent) : QDialog(parent)
,m_d(new Private) ,m_d(new Private)
{ {
...@@ -134,13 +134,13 @@ KisInternalColorSelector::KisInternalColorSelector(QWidget *parent, KoColor colo ...@@ -134,13 +134,13 @@ KisInternalColorSelector::KisInternalColorSelector(QWidget *parent, KoColor colo
connect(m_ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(m_ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
} }
KisInternalColorSelector::~KisInternalColorSelector() KisDlgInternalColorSelector::~KisDlgInternalColorSelector()
{ {
delete m_ui; delete m_ui;
//TODO: Does the scoped pointer also need to be deleted??? //TODO: Does the scoped pointer also need to be deleted???
} }
void KisInternalColorSelector::slotColorUpdated(KoColor newColor) void KisDlgInternalColorSelector::slotColorUpdated(KoColor newColor)
{ {
//if the update did not come from this selector... //if the update did not come from this selector...
if (m_d->allowUpdates || QObject::sender() == this->parent()) { if (m_d->allowUpdates || QObject::sender() == this->parent()) {
...@@ -154,7 +154,7 @@ void KisInternalColorSelector::slotColorUpdated(KoColor newColor) ...@@ -154,7 +154,7 @@ void KisInternalColorSelector::slotColorUpdated(KoColor newColor)
} }
} }
void KisInternalColorSelector::colorSpaceChanged(const KoColorSpace *cs) void KisDlgInternalColorSelector::colorSpaceChanged(const KoColorSpace *cs)
{ {
if (cs == m_d->currentColorSpace) { if (cs == m_d->currentColorSpace) {
return; return;
...@@ -166,13 +166,13 @@ void KisInternalColorSelector::colorSpaceChanged(const KoColorSpace *cs) ...@@ -166,13 +166,13 @@ void KisInternalColorSelector::colorSpaceChanged(const KoColorSpace *cs)
} }
void KisInternalColorSelector::lockUsedColorSpace(const KoColorSpace *cs) void KisDlgInternalColorSelector::lockUsedColorSpace(const KoColorSpace *cs)
{ {
colorSpaceChanged(cs); colorSpaceChanged(cs);
m_d->lockUsedCS = true; m_d->lockUsedCS = true;
} }
void KisInternalColorSelector::setDisplayRenderer(const KoColorDisplayRendererInterface *displayRenderer) void KisDlgInternalColorSelector::setDisplayRenderer(const KoColorDisplayRendererInterface *displayRenderer)
{ {
if (displayRenderer) { if (displayRenderer) {
m_d->displayRenderer = displayRenderer; m_d->displayRenderer = displayRenderer;
...@@ -185,36 +185,36 @@ void KisInternalColorSelector::setDisplayRenderer(const KoColorDisplayRendererIn ...@@ -185,36 +185,36 @@ void KisInternalColorSelector::setDisplayRenderer(const KoColorDisplayRendererIn
} }
} }
KoColor KisInternalColorSelector::getModalColorDialog(const KoColor color, QWidget* parent, QString caption) KoColor KisDlgInternalColorSelector::getModalColorDialog(const KoColor color, QWidget* parent, QString caption)
{ {
Config config = Config(); Config config = Config();
KisInternalColorSelector dialog(parent, color, config, caption); KisDlgInternalColorSelector dialog(parent, color, config, caption);
dialog.exec(); dialog.exec();
return dialog.getCurrentColor(); return dialog.getCurrentColor();
} }
KoColor KisInternalColorSelector::getCurrentColor() KoColor KisDlgInternalColorSelector::getCurrentColor()
{ {
return m_d->currentColor; return m_d->currentColor;
} }
void KisInternalColorSelector::chooseAlpha(bool chooseAlpha) void KisDlgInternalColorSelector::chooseAlpha(bool chooseAlpha)
{ {
m_d->chooseAlpha = chooseAlpha; m_d->chooseAlpha = chooseAlpha;
} }
void KisInternalColorSelector::slotConfigurationChanged() void KisDlgInternalColorSelector::slotConfigurationChanged()
{ {
//m_d->canvas->displayColorConverter()-> //m_d->canvas->displayColorConverter()->
//slotColorSpaceChanged(m_d->canvas->image()->colorSpace()); //slotColorSpaceChanged(m_d->canvas->image()->colorSpace());
} }
void KisInternalColorSelector::slotLockSelector() void KisDlgInternalColorSelector::slotLockSelector()
{ {
m_d->allowUpdates = false; m_d->allowUpdates = false;
} }
void KisInternalColorSelector::setPreviousColor() void KisDlgInternalColorSelector::setPreviousColor()
{ {
m_d->previousColor = m_d->currentColor; m_d->previousColor = m_d->currentColor;
KisConfig cfg; KisConfig cfg;
...@@ -223,7 +223,7 @@ void KisInternalColorSelector::setPreviousColor() ...@@ -223,7 +223,7 @@ void KisInternalColorSelector::setPreviousColor()
} }
} }
void KisInternalColorSelector::updateAllElements(QObject *source) void KisDlgInternalColorSelector::updateAllElements(QObject *source)
{ {
//update everything!!! //update everything!!!
if (source != m_ui->spinboxselector) { if (source != m_ui->spinboxselector) {
...@@ -249,22 +249,22 @@ void KisInternalColorSelector::updateAllElements(QObject *source) ...@@ -249,22 +249,22 @@ void KisInternalColorSelector::updateAllElements(QObject *source)
} }
void KisInternalColorSelector::endUpdateWithNewColor() void KisDlgInternalColorSelector::endUpdateWithNewColor()
{ {
m_d->allowUpdates = true; m_d->allowUpdates = true;
} }
void KisInternalColorSelector::focusInEvent(QFocusEvent *) void KisDlgInternalColorSelector::focusInEvent(QFocusEvent *)
{ {
//setPreviousColor(); //setPreviousColor();
} }
void KisInternalColorSelector::slotSetColorFromPatch(KoColorPatch* patch) void KisDlgInternalColorSelector::slotSetColorFromPatch(KoColorPatch* patch)
{ {
slotColorUpdated(patch->color()); slotColorUpdated(patch->color());
} }
void KisInternalColorSelector::slotSetColorFromHex() void KisDlgInternalColorSelector::slotSetColorFromHex()
{ {
slotColorUpdated(m_d->sRGB); slotColorUpdated(m_d->sRGB);
} }
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* *
* A non-modal color selector dialog that is not a plugin and can thus be used for filters. * A non-modal color selector dialog that is not a plugin and can thus be used for filters.
*/ */
class KRITAUI_EXPORT KisInternalColorSelector : public QDialog class KRITAUI_EXPORT KisDlgInternalColorSelector : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
...@@ -56,8 +56,8 @@ public: ...@@ -56,8 +56,8 @@ public:
bool useAlpha; bool useAlpha;
}; };
KisInternalColorSelector(QWidget* parent, KoColor color, Config config, const QString &caption, const KoColorDisplayRendererInterface *displayRenderer = KoDumbColorDisplayRenderer::instance()); KisDlgInternalColorSelector(QWidget* parent, KoColor color, Config config, const QString &caption, const KoColorDisplayRendererInterface *displayRenderer = KoDumbColorDisplayRenderer::instance());
~KisInternalColorSelector(); ~KisDlgInternalColorSelector();
/** /**
* @brief slotColorSpaceChanged * @brief slotColorSpaceChanged
......
...@@ -81,7 +81,7 @@ class Q_DECL_HIDDEN KoDualColorButton::Private ...@@ -81,7 +81,7 @@ class Q_DECL_HIDDEN KoDualColorButton::Private
bool dragFlag, miniCtlFlag; bool dragFlag, miniCtlFlag;
KoColor foregroundColor; KoColor foregroundColor;
KoColor backgroundColor; KoColor backgroundColor;
KisInternalColorSelector *colorSelectorDialog; KisDlgInternalColorSelector *colorSelectorDialog;
QPoint dragPosition; QPoint dragPosition;
Selection tmpSelection; Selection tmpSelection;
bool popDialog; bool popDialog;
...@@ -97,9 +97,9 @@ void KoDualColorButton::Private::init(KoDualColorButton *q) ...@@ -97,9 +97,9 @@ void KoDualColorButton::Private::init(KoDualColorButton *q)
q->setAcceptDrops( true ); q->setAcceptDrops( true );
QString caption = i18n("Select a color"); QString caption = i18n("Select a color");
KisInternalColorSelector::Config config = KisInternalColorSelector::Config(); KisDlgInternalColorSelector::Config config = KisDlgInternalColorSelector::Config();
config.modal = false; config.modal = false;
colorSelectorDialog = new KisInternalColorSelector(q, foregroundColor, config, caption, displayRenderer); colorSelectorDialog = new KisDlgInternalColorSelector(q, foregroundColor, config, caption, displayRenderer);
connect(colorSelectorDialog, SIGNAL(signalForegroundColorChosen(KoColor)), q, SLOT(slotSetForeGroundColorFromDialog(KoColor))); connect(colorSelectorDialog, SIGNAL(signalForegroundColorChosen(KoColor)), q, SLOT(slotSetForeGroundColorFromDialog(KoColor)));
connect(q, SIGNAL(foregroundColorChanged(KoColor)), colorSelectorDialog, SLOT(slotColorUpdated(KoColor))); connect(q, SIGNAL(foregroundColorChanged(KoColor)), colorSelectorDialog, SLOT(slotColorUpdated(KoColor)));
} }
...@@ -352,7 +352,7 @@ void KoDualColorButton::mouseReleaseEvent( QMouseEvent *event ) ...@@ -352,7 +352,7 @@ void KoDualColorButton::mouseReleaseEvent( QMouseEvent *event )
if(d->tmpSelection == Background ) { if(d->tmpSelection == Background ) {
if( d->popDialog) { if( d->popDialog) {
KoColor c = d->backgroundColor; KoColor c = d->backgroundColor;
c = KisInternalColorSelector::getModalColorDialog(c, this); c = KisDlgInternalColorSelector::getModalColorDialog(c, this);
d->backgroundColor = c; d->backgroundColor = c;
emit backgroundColorChanged(d->backgroundColor); emit backgroundColorChanged(d->backgroundColor);
/*QColor c = d->displayRenderer->toQColor(d->backgroundColor); /*QColor c = d->displayRenderer->toQColor(d->backgroundColor);
......
...@@ -51,7 +51,7 @@ public: ...@@ -51,7 +51,7 @@ public:
KoColor col; KoColor col;
QPoint mPos; QPoint mPos;
QPointer<KisInternalColorSelector> dialogPtr; QPointer<KisDlgInternalColorSelector> dialogPtr;
void initStyleOption(QStyleOptionButton *opt) const; void initStyleOption(QStyleOptionButton *opt) const;
}; };
...@@ -306,7 +306,7 @@ void KisColorButton::mouseMoveEvent(QMouseEvent *e) ...@@ -306,7 +306,7 @@ void KisColorButton::mouseMoveEvent(QMouseEvent *e)
void KisColorButton::KisColorButtonPrivate::_k_chooseColor() void KisColorButton::KisColorButtonPrivate::_k_chooseColor()
{ {
KisInternalColorSelector *dialog = dialogPtr.data(); KisDlgInternalColorSelector *dialog = dialogPtr.data();
if (dialog) { if (dialog) {
dialog->show(); dialog->show();
dialog->raise(); dialog->raise();
...@@ -314,12 +314,12 @@ void KisColorButton::KisColorButtonPrivate::_k_chooseColor() ...@@ -314,12 +314,12 @@ void KisColorButton::KisColorButtonPrivate::_k_chooseColor()
return; return;
} }
KisInternalColorSelector::Config cfg; KisDlgInternalColorSelector::Config cfg;
dialog = new KisInternalColorSelector(q, dialog = new KisDlgInternalColorSelector(q,
q->color(), q->color(),
cfg, cfg,
"Blabla"); i18n("Choose a color"));
//dialog->setOption(QColorDialog::ShowAlphaChannel, m_alphaChannel); //dialog->setOption(QColorDialog::ShowAlphaChannel, m_alphaChannel);
dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->setAttribute(Qt::WA_DeleteOnClose);
connect(dialog, SIGNAL(accepted()), q, SLOT(_k_colorChosen())); connect(dialog, SIGNAL(accepted()), q, SLOT(_k_colorChosen()));
...@@ -329,7 +329,7 @@ void KisColorButton::KisColorButtonPrivate::_k_chooseColor() ...@@ -329,7 +329,7 @@ void KisColorButton::KisColorButtonPrivate::_k_chooseColor()
void KisColorButton::KisColorButtonPrivate::_k_colorChosen() void KisColorButton::KisColorButtonPrivate::_k_colorChosen()
{ {
KisInternalColorSelector *dialog = dialogPtr.data(); KisDlgInternalColorSelector *dialog = dialogPtr.data();
if (!dialog) { if (!dialog) {
return; return;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment