Krita Source Code Documentation
Loading...
Searching...
No Matches
KisColorSelectorBase Class Referenceabstract

Base class for all color selectors, that should support color management and zooming. More...

#include <kis_color_selector_base.h>

+ Inheritance diagram for KisColorSelectorBase:

Public Types

enum  Move { MoveToMousePosition , DontMove }
 

Public Slots

virtual void reset ()
 
virtual void showPopup (Move move=MoveToMousePosition)
 
virtual void updateSettings ()
 

Public Member Functions

const KoColorSpacecolorSpace () const
 
KisDisplayColorConverterconverter () const
 
void enterEvent (QEnterEvent *e) override
 
 KisColorSelectorBase (QWidget *parent=0)
 
void leaveEvent (QEvent *e) override
 
void mousePressEvent (QMouseEvent *) override
 
void mouseReleaseEvent (QMouseEvent *) override
 
virtual void setCanvas (KisCanvas2 *canvas)
 
virtual void setColor (const KoColor &color)
 
void setColorSpace (const KoColorSpace *colorSpace)
 
void setPopupBehaviour (bool onMouseOver, bool onMouseClick)
 
void showColorPreview ()
 
void slotUpdateColorAndPreview (QPair< KoColor, Acs::ColorRole > color)
 
void tryHideAllPopups ()
 
virtual void unsetCanvas ()
 
void updateBaseColorPreview (const KoColor &color)
 
void updateColor (const KoColor &color, Acs::ColorRole role, bool needsExplicitColorReset)
 
void updateColorPreview (const KoColor &color)
 
void updatePreviousColorPreview ()
 
 ~KisColorSelectorBase () override
 

Protected Slots

virtual void canvasResourceChanged (int key, const QVariant &v)
 if you overwrite this, keep in mind, that you should set the color only, if m_colorUpdateAllowed is true
 
void hidePopup ()
 
void updateLastUsedColorPreview (const KoColor &color)
 

Protected Member Functions

void changeEvent (QEvent *event) override
 
virtual KisColorSelectorBasecreatePopup () const =0
 
void dragEnterEvent (QDragEnterEvent *) override
 
void dropEvent (QDropEvent *) override
 
bool isPopup () const
 
void keyPressEvent (QKeyEvent *) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void requestUpdateColorAndPreview (const KoColor &color, Acs::ColorRole role)
 
void setHidingTime (int time)
 
void showEvent (QShowEvent *event) override
 

Protected Attributes

QPointer< KisCanvas2m_canvas
 
bool m_colorUpdateAllowed
 
bool m_colorUpdateSelf
 
QWidget * m_parent
 
KisColorSelectorBasem_popup
 

Private Types

typedef KisSignalCompressorWithParam< QPair< KoColor, Acs::ColorRole > > ColorCompressorType
 

Private Member Functions

void commitColor (const KoColor &koColor, Acs::ColorRole role)
 
void lazyCreatePopup ()
 

Private Attributes

KisColorPreviewPopupm_colorPreviewPopup
 
const KoColorSpacem_colorSpace
 
bool m_hideOnMouseClick
 
QTimer * m_hideTimer
 
bool m_isPopup
 
bool m_popupOnMouseClick
 
bool m_popupOnMouseOver
 
QScopedPointer< ColorCompressorTypem_updateColorCompressor
 

Detailed Description

Base class for all color selectors, that should support color management and zooming.

Definition at line 28 of file kis_color_selector_base.h.

Member Typedef Documentation

◆ ColorCompressorType

Member Enumeration Documentation

◆ Move

Enumerator
MoveToMousePosition 
DontMove 

Definition at line 32 of file kis_color_selector_base.h.

Constructor & Destructor Documentation

◆ KisColorSelectorBase()

KisColorSelectorBase::KisColorSelectorBase ( QWidget * parent = 0)
explicit

Definition at line 127 of file kis_color_selector_base.cpp.

127 :
128 QWidget(parent),
129 m_canvas(0),
130 m_popup(0),
131 m_parent(0),
133 m_colorUpdateSelf(false),
134 m_hideTimer(new QTimer(this)),
135 m_popupOnMouseOver(false),
137 m_colorSpace(0),
138 m_isPopup(false),
139 m_hideOnMouseClick(false),
141{
142 m_hideTimer->setInterval(0);
143 m_hideTimer->setSingleShot(true);
144 connect(m_hideTimer, SIGNAL(timeout()), this, SLOT(hidePopup()));
145
146 using namespace std::placeholders; // For _1 placeholder
147 auto function = std::bind(&KisColorSelectorBase::slotUpdateColorAndPreview, this, _1);
148 m_updateColorCompressor.reset(new ColorCompressorType(25 /* ms */, function));
149}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
KisColorSelectorBase * m_popup
const KoColorSpace * m_colorSpace
void slotUpdateColorAndPreview(QPair< KoColor, Acs::ColorRole > color)
KisColorPreviewPopup * m_colorPreviewPopup
QScopedPointer< ColorCompressorType > m_updateColorCompressor
QPointer< KisCanvas2 > m_canvas
KisSignalCompressorWithParam< QPair< KoColor, Acs::ColorRole > > ColorCompressorType

References connect(), hidePopup(), m_hideTimer, m_updateColorCompressor, and slotUpdateColorAndPreview().

◆ ~KisColorSelectorBase()

KisColorSelectorBase::~KisColorSelectorBase ( )
override

Definition at line 151 of file kis_color_selector_base.cpp.

152{
153 delete m_popup;
154 delete m_colorPreviewPopup;
155}

References m_colorPreviewPopup, and m_popup.

Member Function Documentation

◆ canvasResourceChanged

void KisColorSelectorBase::canvasResourceChanged ( int key,
const QVariant & v )
protectedvirtualslot

if you overwrite this, keep in mind, that you should set the color only, if m_colorUpdateAllowed is true

Definition at line 469 of file kis_color_selector_base.cpp.

470{
472 KoColor realColor(v.value<KoColor>());
473 updateColorPreview(realColor);
475 setColor(realColor);
476 }
477 }
478}
qreal v
void updateColorPreview(const KoColor &color)
virtual void setColor(const KoColor &color)
@ BackgroundColor
The active background color selected for this canvas.
@ ForegroundColor
The active foreground color selected for this canvas.

References KoCanvasResource::BackgroundColor, KoCanvasResource::ForegroundColor, m_colorUpdateAllowed, m_colorUpdateSelf, setColor(), updateColorPreview(), and v.

◆ changeEvent()

void KisColorSelectorBase::changeEvent ( QEvent * event)
overrideprotected

Definition at line 565 of file kis_color_selector_base.cpp.

566{
567 // hide the popup when another window becomes active, e.g. due to alt+tab
568 if(m_isPopup && event->type() == QEvent::ActivationChange && !isActiveWindow()) {
569 hidePopup();
570 }
571
572 QWidget::changeEvent(event);
573}

References hidePopup(), and m_isPopup.

◆ colorSpace()

const KoColorSpace * KisColorSelectorBase::colorSpace ( ) const

Definition at line 480 of file kis_color_selector_base.cpp.

481{
482 return converter()->paintingColorSpace();
483}
KisDisplayColorConverter * converter() const
const KoColorSpace * paintingColorSpace() const

References converter(), and KisDisplayColorConverter::paintingColorSpace().

◆ commitColor()

void KisColorSelectorBase::commitColor ( const KoColor & koColor,
Acs::ColorRole role )
private

Definition at line 442 of file kis_color_selector_base.cpp.

443{
444 if (!m_canvas)
445 return;
446
448
449 if (role == Acs::Foreground)
450 m_canvas->resourceManager()->setForegroundColor(color);
451 else
452 m_canvas->resourceManager()->setBackgroundColor(color);
453
455}
@ Foreground

References Acs::Foreground, m_canvas, and m_colorUpdateAllowed.

◆ converter()

KisDisplayColorConverter * KisColorSelectorBase::converter ( ) const

Definition at line 535 of file kis_color_selector_base.cpp.

536{
537 return m_canvas ?
538 m_canvas->displayColorConverter() :
540}
static KisDisplayColorConverter * dumbConverterInstance()

References KisDisplayColorConverter::dumbConverterInstance(), and m_canvas.

◆ createPopup()

virtual KisColorSelectorBase * KisColorSelectorBase::createPopup ( ) const
protectedpure virtual

◆ dragEnterEvent()

void KisColorSelectorBase::dragEnterEvent ( QDragEnterEvent * e)
overrideprotected

Definition at line 328 of file kis_color_selector_base.cpp.

329{
330 if(e->mimeData()->hasColor())
331 e->acceptProposedAction();
332 if(e->mimeData()->hasText() && QColor(e->mimeData()->text()).isValid())
333 e->acceptProposedAction();
334}

◆ dropEvent()

void KisColorSelectorBase::dropEvent ( QDropEvent * e)
overrideprotected

Definition at line 336 of file kis_color_selector_base.cpp.

337{
338 QColor color;
339 if(e->mimeData()->hasColor()) {
340 color = qvariant_cast<QColor>(e->mimeData()->colorData());
341 }
342 else if(e->mimeData()->hasText()) {
343 color.setNamedColor(e->mimeData()->text());
344 if(!color.isValid())
345 return;
346 }
347
348 KoColor kocolor(color , KoColorSpaceRegistry::instance()->rgb8());
349 updateColor(kocolor, Acs::Foreground, true);
350}
void updateColor(const KoColor &color, Acs::ColorRole role, bool needsExplicitColorReset)
static KoColorSpaceRegistry * instance()

References Acs::Foreground, KoColorSpaceRegistry::instance(), and updateColor().

◆ enterEvent()

void KisColorSelectorBase::enterEvent ( QEnterEvent * e)
override

Definition at line 273 of file kis_color_selector_base.cpp.

275{
276 if (m_popup && m_popup->isVisible()) {
277 m_popup->m_hideTimer->stop();
278 }
279
280 if (m_isPopup && m_hideTimer->isActive()) {
281 m_hideTimer->stop();
282 }
283
284 // do not show the popup when boxed in
285 // the configuration dialog (m_canvas == 0)
286
287 if (m_canvas &&
289 (!m_popup || m_popup->isHidden())) {
290
292
293 const QRect availRect = this->screen()->availableGeometry();
294
295 QPoint proposedTopLeft = rect().center() - m_popup->rect().center();
296 proposedTopLeft = mapToGlobal(proposedTopLeft);
297
298 QRect popupRect = QRect(proposedTopLeft, m_popup->size());
299 popupRect = kisEnsureInRect(popupRect, availRect);
300
301 m_popup->setGeometry(popupRect);
304 }
305
306#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
307 QWidget::enterEvent(e);
308#else
309 QEnterEvent *enterEvent = dynamic_cast<QEnterEvent*>(e);
310 QWidget::enterEvent(enterEvent);
311#endif
312
313}
void enterEvent(QEnterEvent *e) override
virtual void showPopup(Move move=MoveToMousePosition)
QRect kisEnsureInRect(QRect rc, const QRect &bounds)
Definition kis_global.h:267

References kisEnsureInRect().

◆ hidePopup

void KisColorSelectorBase::hidePopup ( )
protectedslot

Definition at line 434 of file kis_color_selector_base.cpp.

435{
437
438 m_colorPreviewPopup->hide();
439 hide();
440}
#define KIS_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:75

References KIS_ASSERT_RECOVER_RETURN, m_colorPreviewPopup, and m_isPopup.

◆ isPopup()

bool KisColorSelectorBase::isPopup ( ) const
inlineprotected

Definition at line 82 of file kis_color_selector_base.h.

82{ return m_isPopup; }

References m_isPopup.

◆ keyPressEvent()

void KisColorSelectorBase::keyPressEvent ( QKeyEvent * )
overrideprotected

Definition at line 321 of file kis_color_selector_base.cpp.

322{
323 if (m_isPopup) {
324 hidePopup();
325 }
326}

References hidePopup(), and m_isPopup.

◆ lazyCreatePopup()

void KisColorSelectorBase::lazyCreatePopup ( )
private

Definition at line 384 of file kis_color_selector_base.cpp.

385{
386 if (!m_popup) {
388 Q_ASSERT(m_popup);
389 m_popup->setParent(this);
390
391 // Setting Qt::BypassWindowManagerHint will prevent
392 // the WM from showing another taskbar entry,
393 // but will require that we handle window activation manually
394 m_popup->setWindowFlags(Qt::FramelessWindowHint |
395#if defined(Q_OS_MACOS) || defined(Q_OS_ANDROID)
396 Qt::Popup |
397#else
398 Qt::Window |
399#endif
400 Qt::NoDropShadowWindowHint |
401 Qt::BypassWindowManagerHint);
402 m_popup->m_parent = this;
403 m_popup->m_isPopup = true;
404 }
407}
virtual void setCanvas(KisCanvas2 *canvas)
virtual KisColorSelectorBase * createPopup() const =0

References createPopup(), m_canvas, m_isPopup, m_parent, m_popup, setCanvas(), and updateSettings().

◆ leaveEvent()

void KisColorSelectorBase::leaveEvent ( QEvent * e)
override

Definition at line 315 of file kis_color_selector_base.cpp.

316{
318 QWidget::leaveEvent(e);
319}

References tryHideAllPopups().

◆ mouseMoveEvent()

void KisColorSelectorBase::mouseMoveEvent ( QMouseEvent * event)
overrideprotected

Definition at line 559 of file kis_color_selector_base.cpp.

560{
561 event->accept();
562}

◆ mousePressEvent()

void KisColorSelectorBase::mousePressEvent ( QMouseEvent * event)
override

Definition at line 212 of file kis_color_selector_base.cpp.

213{
214 event->accept();
215
217 event->button() == Qt::MiddleButton) {
218
220
221 int x = event->globalX();
222 int y = event->globalY();
223 int popupsize = m_popup->width();
224 x-=popupsize/2;
225 y-=popupsize/2;
226
227 const QRect availRect = this->screen()->availableGeometry();
228
229 if(x<availRect.x())
230 x = availRect.x();
231 if(y<availRect.y())
232 y = availRect.y();
233 if(x+m_popup->width()>availRect.x()+availRect.width())
234 x = availRect.x()+availRect.width()-m_popup->width();
235 if(y+m_popup->height()>availRect.y()+availRect.height())
236 y = availRect.y()+availRect.height()-m_popup->height();
237
238 m_colorUpdateSelf=false;
239 m_popup->move(x, y);
242
243 } else if (m_isPopup && event->button() == Qt::MiddleButton) {
245 m_colorPreviewPopup->hide();
246 }
247 hide();
248 } else {
251 event->ignore();
252 }
253}

References DontMove, lazyCreatePopup(), m_colorPreviewPopup, m_colorUpdateSelf, m_isPopup, m_popup, m_popupOnMouseClick, setHidingTime(), showColorPreview(), and showPopup().

◆ mouseReleaseEvent()

void KisColorSelectorBase::mouseReleaseEvent ( QMouseEvent * e)
override

Definition at line 255 of file kis_color_selector_base.cpp.

255 {
256
257 Q_UNUSED(e);
258
259 if (e->button() == Qt::MiddleButton) {
260 e->accept();
261 } else if (m_isPopup &&
263 !m_hideTimer->isActive()) {
265 m_colorPreviewPopup->hide();
266 }
267 hide();
268 }
269}

References m_colorPreviewPopup, m_hideOnMouseClick, m_hideTimer, m_isPopup, and m_popupOnMouseOver.

◆ requestUpdateColorAndPreview()

void KisColorSelectorBase::requestUpdateColorAndPreview ( const KoColor & color,
Acs::ColorRole role )
protected

Definition at line 361 of file kis_color_selector_base.cpp.

362{
363 m_updateColorCompressor->start(qMakePair(color, role));
364}

References m_updateColorCompressor.

◆ reset

void KisColorSelectorBase::reset ( )
virtualslot

Flushes caches and redraws the selectors

Definition at line 515 of file kis_color_selector_base.cpp.

516{
517 update();
518}
bool update(QSpinBox *spinBox)

◆ setCanvas()

void KisColorSelectorBase::setCanvas ( KisCanvas2 * canvas)
virtual

Reimplemented in KisColorHistory, KisColorPatches, KisCommonColors, and KisMinimalShadeSelector.

Definition at line 175 of file kis_color_selector_base.cpp.

176{
177 if (m_canvas) {
178 m_canvas->disconnectCanvasObserver(this);
179 }
180 m_canvas = canvas;
181 if (m_canvas) {
182 connect(m_canvas->resourceManager(), SIGNAL(canvasResourceChanged(int,QVariant)),
183 SLOT(canvasResourceChanged(int,QVariant)), Qt::UniqueConnection);
184
185 connect(m_canvas->displayColorConverter(), SIGNAL(displayConfigurationChanged()),
186 SLOT(reset()), Qt::UniqueConnection);
187
188 connect(canvas->imageView()->resourceProvider(), SIGNAL(sigFGColorUsed(KoColor)),
189 this, SLOT(updateLastUsedColorPreview(KoColor)), Qt::UniqueConnection);
190
191 if (m_canvas->viewManager() && m_canvas->viewManager()->canvasResourceProvider()) {
192 setColor(Acs::currentColor(m_canvas->viewManager()->canvasResourceProvider(), Acs::Foreground));
193 }
194 }
195 if (m_popup) {
196 m_popup->setCanvas(canvas);
197 }
198
199 reset();
200}
QPointer< KisView > imageView() const
virtual void canvasResourceChanged(int key, const QVariant &v)
if you overwrite this, keep in mind, that you should set the color only, if m_colorUpdateAllowed is t...
void updateLastUsedColorPreview(const KoColor &color)
KoColor currentColor(ResourceProvider *provider, ColorRole role)

References canvasResourceChanged(), connect(), Acs::currentColor(), Acs::Foreground, KisCanvas2::imageView(), m_canvas, m_popup, reset(), setCanvas(), setColor(), and updateLastUsedColorPreview().

◆ setColor()

void KisColorSelectorBase::setColor ( const KoColor & color)
virtual

Reimplemented in KisColorSelector, KisMinimalShadeSelector, and KisMyPaintShadeSelector.

Definition at line 372 of file kis_color_selector_base.cpp.

373{
374 Q_UNUSED(color);
375}

◆ setColorSpace()

void KisColorSelectorBase::setColorSpace ( const KoColorSpace * colorSpace)

Definition at line 170 of file kis_color_selector_base.cpp.

171{
173}
const KoColorSpace * colorSpace() const

References colorSpace(), and m_colorSpace.

◆ setHidingTime()

void KisColorSelectorBase::setHidingTime ( int time)
protected

Definition at line 377 of file kis_color_selector_base.cpp.

378{
380
381 m_hideTimer->setInterval(time);
382}
#define KIS_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:97

References KIS_ASSERT_RECOVER_NOOP, m_hideTimer, and m_isPopup.

◆ setPopupBehaviour()

void KisColorSelectorBase::setPopupBehaviour ( bool onMouseOver,
bool onMouseClick )

Definition at line 157 of file kis_color_selector_base.cpp.

158{
159 m_popupOnMouseClick = onMouseClick;
160 m_popupOnMouseOver = onMouseOver;
161 if(onMouseClick) {
162 m_popupOnMouseOver = false;
163 }
164
166 setMouseTracking(true);
167 }
168}

References m_popupOnMouseClick, and m_popupOnMouseOver.

◆ showColorPreview()

void KisColorSelectorBase::showColorPreview ( )

Definition at line 457 of file kis_color_selector_base.cpp.

458{
459 if(m_colorPreviewPopup->isHidden()) {
461 }
462}

References m_colorPreviewPopup, and KisColorPreviewPopup::show().

◆ showEvent()

void KisColorSelectorBase::showEvent ( QShowEvent * event)
overrideprotected

Definition at line 575 of file kis_color_selector_base.cpp.

576{
577 QWidget::showEvent(event);
578
579 // manual activation required due to Qt::BypassWindowManagerHint
580 if(m_isPopup) {
581 activateWindow();
582 }
583}

References m_isPopup.

◆ showPopup

void KisColorSelectorBase::showPopup ( Move move = MoveToMousePosition)
virtualslot

Definition at line 409 of file kis_color_selector_base.cpp.

410{
411 // This slot may be called by some action,
412 // so we need to be able to handle it
414
415 QPoint cursorPos = QCursor::pos();
416 const QRect availRect = this->screen()->availableGeometry();
417
418 if (move == MoveToMousePosition) {
419 m_popup->move(QPoint(cursorPos.x()-m_popup->width()/2, cursorPos.y()-m_popup->height()/2));
420 QRect rc = m_popup->geometry();
421 if (rc.x() < availRect.x()) rc.setX(availRect.x());
422 if (rc.y() < availRect.y()) rc.setY(availRect.y());
423 m_popup->setGeometry(rc);
424 }
425
427 m_colorPreviewPopup->hide();
428 }
429
430 m_popup->show();
432}

References lazyCreatePopup(), m_colorPreviewPopup, m_popup, MoveToMousePosition, and KisColorPreviewPopup::show().

◆ slotUpdateColorAndPreview()

void KisColorSelectorBase::slotUpdateColorAndPreview ( QPair< KoColor, Acs::ColorRole > color)

Definition at line 366 of file kis_color_selector_base.cpp.

367{
368 updateColorPreview(color.first);
369 updateColor(color.first, color.second, false);
370}

References updateColor(), and updateColorPreview().

◆ tryHideAllPopups()

void KisColorSelectorBase::tryHideAllPopups ( )

Definition at line 542 of file kis_color_selector_base.cpp.

543{
544 if (m_colorPreviewPopup->isVisible()) {
545 m_colorUpdateSelf=false; //this is for allowing advanced selector to listen to outside color-change events.
546 m_colorPreviewPopup->hide();
547 }
548
549 if (m_popup && m_popup->isVisible()) {
550 m_popup->m_hideTimer->start();
551 }
552
553 if (m_isPopup && !m_hideTimer->isActive()) {
554 m_hideTimer->start();
555 }
556}

References m_colorPreviewPopup, m_colorUpdateSelf, m_hideTimer, m_isPopup, and m_popup.

◆ unsetCanvas()

void KisColorSelectorBase::unsetCanvas ( )
virtual

Reimplemented in KisColorHistory, KisColorPatches, KisCommonColors, and KisMinimalShadeSelector.

Definition at line 202 of file kis_color_selector_base.cpp.

203{
204 if (m_popup) {
206 }
207 m_canvas = 0;
208}

References m_canvas, m_popup, and unsetCanvas().

◆ updateBaseColorPreview()

void KisColorSelectorBase::updateBaseColorPreview ( const KoColor & color)

Definition at line 520 of file kis_color_selector_base.cpp.

521{
522 m_colorPreviewPopup->setBaseColor(converter()->toQColor(color));
523}
void setBaseColor(const QColor &color)

References converter(), m_colorPreviewPopup, and KisColorPreviewPopup::setBaseColor().

◆ updateColor()

void KisColorSelectorBase::updateColor ( const KoColor & color,
Acs::ColorRole role,
bool needsExplicitColorReset )

Definition at line 352 of file kis_color_selector_base.cpp.

353{
354 commitColor(color, role);
355
356 if (needsExplicitColorReset) {
357 setColor(color);
358 }
359}
void commitColor(const KoColor &koColor, Acs::ColorRole role)

References commitColor(), and setColor().

◆ updateColorPreview()

void KisColorSelectorBase::updateColorPreview ( const KoColor & color)

Definition at line 464 of file kis_color_selector_base.cpp.

465{
466 m_colorPreviewPopup->setQColor(converter()->toQColor(color));
467}
void setQColor(const QColor &color)

References converter(), m_colorPreviewPopup, and KisColorPreviewPopup::setQColor().

◆ updateLastUsedColorPreview

void KisColorSelectorBase::updateLastUsedColorPreview ( const KoColor & color)
protectedslot

Definition at line 530 of file kis_color_selector_base.cpp.

531{
533}
void setLastUsedColor(const QColor &color)

References converter(), m_colorPreviewPopup, and KisColorPreviewPopup::setLastUsedColor().

◆ updatePreviousColorPreview()

void KisColorSelectorBase::updatePreviousColorPreview ( )

◆ updateSettings

void KisColorSelectorBase::updateSettings ( )
virtualslot

Definition at line 485 of file kis_color_selector_base.cpp.

486{
487 if(m_popup) {
489 }
490
491 KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
492
493
494 int zoomSelectorOptions = (int) cfg.readEntry("zoomSelectorOptions", 0) ;
495 if (zoomSelectorOptions == 0) {
496 setPopupBehaviour(false, true); // middle mouse button click will open zoom selector
497 } else if (zoomSelectorOptions == 1) {
498 setPopupBehaviour(true, false); // move over will open the zoom selector
499 }
500 else
501 {
502 setPopupBehaviour(false, false); // do not show zoom selector
503 }
504
505
506 if(m_isPopup) {
507 m_hideOnMouseClick = cfg.readEntry("hidePopupOnClickCheck", false);
508 const int zoomSize = cfg.readEntry("zoomSize", 280);
509 resize(zoomSize, zoomSize);
510 }
511
512 reset();
513}
void setPopupBehaviour(bool onMouseOver, bool onMouseClick)

References m_hideOnMouseClick, m_isPopup, m_popup, reset(), setPopupBehaviour(), and updateSettings().

Member Data Documentation

◆ m_canvas

QPointer<KisCanvas2> KisColorSelectorBase::m_canvas
protected

Definition at line 109 of file kis_color_selector_base.h.

◆ m_colorPreviewPopup

KisColorPreviewPopup* KisColorSelectorBase::m_colorPreviewPopup
private

Definition at line 124 of file kis_color_selector_base.h.

◆ m_colorSpace

const KoColorSpace* KisColorSelectorBase::m_colorSpace
mutableprivate

Definition at line 121 of file kis_color_selector_base.h.

◆ m_colorUpdateAllowed

bool KisColorSelectorBase::m_colorUpdateAllowed
protected

Definition at line 112 of file kis_color_selector_base.h.

◆ m_colorUpdateSelf

bool KisColorSelectorBase::m_colorUpdateSelf
protected

Definition at line 115 of file kis_color_selector_base.h.

◆ m_hideOnMouseClick

bool KisColorSelectorBase::m_hideOnMouseClick
private

Definition at line 123 of file kis_color_selector_base.h.

◆ m_hideTimer

QTimer* KisColorSelectorBase::m_hideTimer
private

Definition at line 118 of file kis_color_selector_base.h.

◆ m_isPopup

bool KisColorSelectorBase::m_isPopup
private

Definition at line 122 of file kis_color_selector_base.h.

◆ m_parent

QWidget* KisColorSelectorBase::m_parent
protected

Definition at line 111 of file kis_color_selector_base.h.

◆ m_popup

KisColorSelectorBase* KisColorSelectorBase::m_popup
protected

Definition at line 110 of file kis_color_selector_base.h.

◆ m_popupOnMouseClick

bool KisColorSelectorBase::m_popupOnMouseClick
private

Definition at line 120 of file kis_color_selector_base.h.

◆ m_popupOnMouseOver

bool KisColorSelectorBase::m_popupOnMouseOver
private

Definition at line 119 of file kis_color_selector_base.h.

◆ m_updateColorCompressor

QScopedPointer<ColorCompressorType> KisColorSelectorBase::m_updateColorCompressor
private

Definition at line 127 of file kis_color_selector_base.h.


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