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
dialogs/kis_dlg_png_import.cpp
dialogs/kis_dlg_import_image_sequence.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_dummies_facade_base.cpp
flake/kis_dummies_facade.cpp
......
......@@ -39,7 +39,7 @@
#include "kis_config_notifier.h"
#include "kis_color_input.h"
struct KisInternalColorSelector::Private
struct KisDlgInternalColorSelector::Private
{
bool allowUpdates = true;
KoColor currentColor;
......@@ -53,7 +53,7 @@ struct KisInternalColorSelector::Private
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)
,m_d(new Private)
{
......@@ -134,13 +134,13 @@ KisInternalColorSelector::KisInternalColorSelector(QWidget *parent, KoColor colo
connect(m_ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}
KisInternalColorSelector::~KisInternalColorSelector()
KisDlgInternalColorSelector::~KisDlgInternalColorSelector()
{
delete m_ui;
//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 (m_d->allowUpdates || QObject::sender() == this->parent()) {
......@@ -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) {
return;
......@@ -166,13 +166,13 @@ void KisInternalColorSelector::colorSpaceChanged(const KoColorSpace *cs)
}
void KisInternalColorSelector::lockUsedColorSpace(const KoColorSpace *cs)
void KisDlgInternalColorSelector::lockUsedColorSpace(const KoColorSpace *cs)
{
colorSpaceChanged(cs);
m_d->lockUsedCS = true;
}
void KisInternalColorSelector::setDisplayRenderer(const KoColorDisplayRendererInterface *displayRenderer)
void KisDlgInternalColorSelector::setDisplayRenderer(const KoColorDisplayRendererInterface *displayRenderer)
{
if (displayRenderer) {
m_d->displayRenderer = displayRenderer;
......@@ -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();
KisInternalColorSelector dialog(parent, color, config, caption);
KisDlgInternalColorSelector dialog(parent, color, config, caption);
dialog.exec();
return dialog.getCurrentColor();
}
KoColor KisInternalColorSelector::getCurrentColor()
KoColor KisDlgInternalColorSelector::getCurrentColor()
{
return m_d->currentColor;
}
void KisInternalColorSelector::chooseAlpha(bool chooseAlpha)
void KisDlgInternalColorSelector::chooseAlpha(bool chooseAlpha)
{
m_d->chooseAlpha = chooseAlpha;
}
void KisInternalColorSelector::slotConfigurationChanged()
void KisDlgInternalColorSelector::slotConfigurationChanged()
{
//m_d->canvas->displayColorConverter()->
//slotColorSpaceChanged(m_d->canvas->image()->colorSpace());
}
void KisInternalColorSelector::slotLockSelector()
void KisDlgInternalColorSelector::slotLockSelector()
{
m_d->allowUpdates = false;
}
void KisInternalColorSelector::setPreviousColor()
void KisDlgInternalColorSelector::setPreviousColor()
{
m_d->previousColor = m_d->currentColor;
KisConfig cfg;
......@@ -223,7 +223,7 @@ void KisInternalColorSelector::setPreviousColor()
}
}
void KisInternalColorSelector::updateAllElements(QObject *source)
void KisDlgInternalColorSelector::updateAllElements(QObject *source)
{
//update everything!!!
if (source != m_ui->spinboxselector) {
......@@ -249,22 +249,22 @@ void KisInternalColorSelector::updateAllElements(QObject *source)
}
void KisInternalColorSelector::endUpdateWithNewColor()
void KisDlgInternalColorSelector::endUpdateWithNewColor()
{
m_d->allowUpdates = true;
}
void KisInternalColorSelector::focusInEvent(QFocusEvent *)
void KisDlgInternalColorSelector::focusInEvent(QFocusEvent *)
{
//setPreviousColor();
}
void KisInternalColorSelector::slotSetColorFromPatch(KoColorPatch* patch)
void KisDlgInternalColorSelector::slotSetColorFromPatch(KoColorPatch* patch)
{
slotColorUpdated(patch->color());
}
void KisInternalColorSelector::slotSetColorFromHex()
void KisDlgInternalColorSelector::slotSetColorFromHex()
{
slotColorUpdated(m_d->sRGB);
}
......
......@@ -33,7 +33,7 @@
*
* 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
public:
......@@ -56,8 +56,8 @@ public:
bool useAlpha;
};
KisInternalColorSelector(QWidget* parent, KoColor color, Config config, const QString &caption, const KoColorDisplayRendererInterface *displayRenderer = KoDumbColorDisplayRenderer::instance());
~KisInternalColorSelector();
KisDlgInternalColorSelector(QWidget* parent, KoColor color, Config config, const QString &caption, const KoColorDisplayRendererInterface *displayRenderer = KoDumbColorDisplayRenderer::instance());
~KisDlgInternalColorSelector();
/**
* @brief slotColorSpaceChanged
......
......@@ -81,7 +81,7 @@ class Q_DECL_HIDDEN KoDualColorButton::Private
bool dragFlag, miniCtlFlag;
KoColor foregroundColor;
KoColor backgroundColor;
KisInternalColorSelector *colorSelectorDialog;
KisDlgInternalColorSelector *colorSelectorDialog;
QPoint dragPosition;
Selection tmpSelection;
bool popDialog;
......@@ -97,9 +97,9 @@ void KoDualColorButton::Private::init(KoDualColorButton *q)
q->setAcceptDrops( true );
QString caption = i18n("Select a color");
KisInternalColorSelector::Config config = KisInternalColorSelector::Config();
KisDlgInternalColorSelector::Config config = KisDlgInternalColorSelector::Config();
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(q, SIGNAL(foregroundColorChanged(KoColor)), colorSelectorDialog, SLOT(slotColorUpdated(KoColor)));
}
......@@ -352,7 +352,7 @@ void KoDualColorButton::mouseReleaseEvent( QMouseEvent *event )
if(d->tmpSelection == Background ) {
if( d->popDialog) {
KoColor c = d->backgroundColor;
c = KisInternalColorSelector::getModalColorDialog(c, this);
c = KisDlgInternalColorSelector::getModalColorDialog(c, this);
d->backgroundColor = c;
emit backgroundColorChanged(d->backgroundColor);
/*QColor c = d->displayRenderer->toQColor(d->backgroundColor);
......
......@@ -51,7 +51,7 @@ public:
KoColor col;
QPoint mPos;
QPointer<KisInternalColorSelector> dialogPtr;
QPointer<KisDlgInternalColorSelector> dialogPtr;
void initStyleOption(QStyleOptionButton *opt) const;
};
......@@ -306,7 +306,7 @@ void KisColorButton::mouseMoveEvent(QMouseEvent *e)
void KisColorButton::KisColorButtonPrivate::_k_chooseColor()
{
KisInternalColorSelector *dialog = dialogPtr.data();
KisDlgInternalColorSelector *dialog = dialogPtr.data();
if (dialog) {
dialog->show();
dialog->raise();
......@@ -314,12 +314,12 @@ void KisColorButton::KisColorButtonPrivate::_k_chooseColor()
return;
}
KisInternalColorSelector::Config cfg;
KisDlgInternalColorSelector::Config cfg;
dialog = new KisInternalColorSelector(q,
dialog = new KisDlgInternalColorSelector(q,
q->color(),
cfg,
"Blabla");
i18n("Choose a color"));
//dialog->setOption(QColorDialog::ShowAlphaChannel, m_alphaChannel);
dialog->setAttribute(Qt::WA_DeleteOnClose);
connect(dialog, SIGNAL(accepted()), q, SLOT(_k_colorChosen()));
......@@ -329,7 +329,7 @@ void KisColorButton::KisColorButtonPrivate::_k_chooseColor()
void KisColorButton::KisColorButtonPrivate::_k_colorChosen()
{
KisInternalColorSelector *dialog = dialogPtr.data();
KisDlgInternalColorSelector *dialog = dialogPtr.data();
if (!dialog) {
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