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
150 // Color selectors don't have context menus. Setting this prevents any
151 // long-presses from delaying inputs, see KisLongPressEventFilter.cpp.
152 setContextMenuPolicy(Qt::PreventContextMenu);
153}
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 hidePopup(), m_hideTimer, m_updateColorCompressor, and slotUpdateColorAndPreview().

◆ ~KisColorSelectorBase()

KisColorSelectorBase::~KisColorSelectorBase ( )
override

Definition at line 155 of file kis_color_selector_base.cpp.

156{
157 delete m_popup;
158 delete m_colorPreviewPopup;
159}

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 473 of file kis_color_selector_base.cpp.

474{
476 KoColor realColor(v.value<KoColor>());
477 updateColorPreview(realColor);
479 setColor(realColor);
480 }
481 }
482}
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 569 of file kis_color_selector_base.cpp.

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

References hidePopup(), and m_isPopup.

◆ colorSpace()

const KoColorSpace * KisColorSelectorBase::colorSpace ( ) const

Definition at line 484 of file kis_color_selector_base.cpp.

485{
486 return converter()->paintingColorSpace();
487}
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 446 of file kis_color_selector_base.cpp.

447{
448 if (!m_canvas)
449 return;
450
452
453 if (role == Acs::Foreground)
454 m_canvas->resourceManager()->setForegroundColor(color);
455 else
456 m_canvas->resourceManager()->setBackgroundColor(color);
457
459}
@ Foreground

References Acs::Foreground, m_canvas, and m_colorUpdateAllowed.

◆ converter()

KisDisplayColorConverter * KisColorSelectorBase::converter ( ) const

Definition at line 539 of file kis_color_selector_base.cpp.

540{
541 return m_canvas ?
542 m_canvas->displayColorConverter() :
544}
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 332 of file kis_color_selector_base.cpp.

333{
334 if(e->mimeData()->hasColor())
335 e->acceptProposedAction();
336 if(e->mimeData()->hasText() && QColor(e->mimeData()->text()).isValid())
337 e->acceptProposedAction();
338}

◆ dropEvent()

void KisColorSelectorBase::dropEvent ( QDropEvent * e)
overrideprotected

Definition at line 340 of file kis_color_selector_base.cpp.

341{
342 QColor color;
343 if(e->mimeData()->hasColor()) {
344 color = qvariant_cast<QColor>(e->mimeData()->colorData());
345 }
346 else if(e->mimeData()->hasText()) {
347 color.setNamedColor(e->mimeData()->text());
348 if(!color.isValid())
349 return;
350 }
351
352 KoColor kocolor(color , KoColorSpaceRegistry::instance()->rgb8());
353 updateColor(kocolor, Acs::Foreground, true);
354}
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 277 of file kis_color_selector_base.cpp.

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

References kisEnsureInRect().

◆ hidePopup

void KisColorSelectorBase::hidePopup ( )
protectedslot

Definition at line 438 of file kis_color_selector_base.cpp.

439{
441
442 m_colorPreviewPopup->hide();
443 hide();
444}
#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 325 of file kis_color_selector_base.cpp.

326{
327 if (m_isPopup) {
328 hidePopup();
329 }
330}

References hidePopup(), and m_isPopup.

◆ lazyCreatePopup()

void KisColorSelectorBase::lazyCreatePopup ( )
private

Definition at line 388 of file kis_color_selector_base.cpp.

389{
390 if (!m_popup) {
392 Q_ASSERT(m_popup);
393 m_popup->setParent(this);
394
395 // Setting Qt::BypassWindowManagerHint will prevent
396 // the WM from showing another taskbar entry,
397 // but will require that we handle window activation manually
398 m_popup->setWindowFlags(Qt::FramelessWindowHint |
399#if defined(Q_OS_MACOS) || defined(Q_OS_ANDROID)
400 Qt::Popup |
401#else
402 Qt::Window |
403#endif
404 Qt::NoDropShadowWindowHint |
405 Qt::BypassWindowManagerHint);
406 m_popup->m_parent = this;
407 m_popup->m_isPopup = true;
408 }
411}
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 319 of file kis_color_selector_base.cpp.

320{
322 QWidget::leaveEvent(e);
323}

References tryHideAllPopups().

◆ mouseMoveEvent()

void KisColorSelectorBase::mouseMoveEvent ( QMouseEvent * event)
overrideprotected

Definition at line 563 of file kis_color_selector_base.cpp.

564{
565 event->accept();
566}

◆ mousePressEvent()

void KisColorSelectorBase::mousePressEvent ( QMouseEvent * event)
override

Definition at line 216 of file kis_color_selector_base.cpp.

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

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 259 of file kis_color_selector_base.cpp.

259 {
260
261 Q_UNUSED(e);
262
263 if (e->button() == Qt::MiddleButton) {
264 e->accept();
265 } else if (m_isPopup &&
267 !m_hideTimer->isActive()) {
269 m_colorPreviewPopup->hide();
270 }
271 hide();
272 }
273}

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 365 of file kis_color_selector_base.cpp.

366{
367 m_updateColorCompressor->start(qMakePair(color, role));
368}

References m_updateColorCompressor.

◆ reset

void KisColorSelectorBase::reset ( )
virtualslot

Flushes caches and redraws the selectors

Definition at line 519 of file kis_color_selector_base.cpp.

520{
521 update();
522}
bool update(QSpinBox *spinBox)

◆ setCanvas()

void KisColorSelectorBase::setCanvas ( KisCanvas2 * canvas)
virtual

Reimplemented in KisColorHistory, KisColorPatches, KisCommonColors, and KisMinimalShadeSelector.

Definition at line 179 of file kis_color_selector_base.cpp.

180{
181 if (m_canvas) {
182 m_canvas->disconnectCanvasObserver(this);
183 }
184 m_canvas = canvas;
185 if (m_canvas) {
186 connect(m_canvas->resourceManager(), SIGNAL(canvasResourceChanged(int,QVariant)),
187 SLOT(canvasResourceChanged(int,QVariant)), Qt::UniqueConnection);
188
189 connect(m_canvas->displayColorConverter(), SIGNAL(displayConfigurationChanged()),
190 SLOT(reset()), Qt::UniqueConnection);
191
192 connect(canvas->imageView()->resourceProvider(), SIGNAL(sigFGColorUsed(KoColor)),
193 this, SLOT(updateLastUsedColorPreview(KoColor)), Qt::UniqueConnection);
194
195 if (m_canvas->viewManager() && m_canvas->viewManager()->canvasResourceProvider()) {
196 setColor(Acs::currentColor(m_canvas->viewManager()->canvasResourceProvider(), Acs::Foreground));
197 }
198 }
199 if (m_popup) {
200 m_popup->setCanvas(canvas);
201 }
202
203 reset();
204}
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(), 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 376 of file kis_color_selector_base.cpp.

377{
378 Q_UNUSED(color);
379}

◆ setColorSpace()

void KisColorSelectorBase::setColorSpace ( const KoColorSpace * colorSpace)

Definition at line 174 of file kis_color_selector_base.cpp.

175{
177}
const KoColorSpace * colorSpace() const

References colorSpace(), and m_colorSpace.

◆ setHidingTime()

void KisColorSelectorBase::setHidingTime ( int time)
protected

Definition at line 381 of file kis_color_selector_base.cpp.

382{
384
385 m_hideTimer->setInterval(time);
386}
#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 161 of file kis_color_selector_base.cpp.

162{
163 m_popupOnMouseClick = onMouseClick;
164 m_popupOnMouseOver = onMouseOver;
165 if(onMouseClick) {
166 m_popupOnMouseOver = false;
167 }
168
170 setMouseTracking(true);
171 }
172}

References m_popupOnMouseClick, and m_popupOnMouseOver.

◆ showColorPreview()

void KisColorSelectorBase::showColorPreview ( )

Definition at line 461 of file kis_color_selector_base.cpp.

462{
463 if(m_colorPreviewPopup->isHidden()) {
465 }
466}

References m_colorPreviewPopup, and KisColorPreviewPopup::show().

◆ showEvent()

void KisColorSelectorBase::showEvent ( QShowEvent * event)
overrideprotected

Definition at line 579 of file kis_color_selector_base.cpp.

580{
581 QWidget::showEvent(event);
582
583 // manual activation required due to Qt::BypassWindowManagerHint
584 if(m_isPopup) {
585 activateWindow();
586 }
587}

References m_isPopup.

◆ showPopup

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

Definition at line 413 of file kis_color_selector_base.cpp.

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

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

◆ slotUpdateColorAndPreview()

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

Definition at line 370 of file kis_color_selector_base.cpp.

371{
372 updateColorPreview(color.first);
373 updateColor(color.first, color.second, false);
374}

References updateColor(), and updateColorPreview().

◆ tryHideAllPopups()

void KisColorSelectorBase::tryHideAllPopups ( )

Definition at line 546 of file kis_color_selector_base.cpp.

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

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 206 of file kis_color_selector_base.cpp.

207{
208 if (m_popup) {
210 }
211 m_canvas = 0;
212}

References m_canvas, m_popup, and unsetCanvas().

◆ updateBaseColorPreview()

void KisColorSelectorBase::updateBaseColorPreview ( const KoColor & color)

Definition at line 524 of file kis_color_selector_base.cpp.

525{
526 m_colorPreviewPopup->setBaseColor(converter()->toQColor(color));
527}
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 356 of file kis_color_selector_base.cpp.

357{
358 commitColor(color, role);
359
360 if (needsExplicitColorReset) {
361 setColor(color);
362 }
363}
void commitColor(const KoColor &koColor, Acs::ColorRole role)

References commitColor(), and setColor().

◆ updateColorPreview()

void KisColorSelectorBase::updateColorPreview ( const KoColor & color)

Definition at line 468 of file kis_color_selector_base.cpp.

469{
470 m_colorPreviewPopup->setQColor(converter()->toQColor(color));
471}
void setQColor(const QColor &color)

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

◆ updateLastUsedColorPreview

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

Definition at line 534 of file kis_color_selector_base.cpp.

535{
537}
void setLastUsedColor(const QColor &color)

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

◆ updatePreviousColorPreview()

void KisColorSelectorBase::updatePreviousColorPreview ( )

◆ updateSettings

void KisColorSelectorBase::updateSettings ( )
virtualslot

Definition at line 489 of file kis_color_selector_base.cpp.

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