Krita Source Code Documentation
Loading...
Searching...
No Matches
OverviewDockerPage Class Reference

#include <overviewdocker_page.h>

+ Inheritance diagram for OverviewDockerPage:

Public Slots

void mirrorUpdateIcon ()
 
void rotateCanvasView (qreal rotation)
 
void setPinControls (bool pin)
 
void updateRotationSlider (qreal rotation)
 

Public Member Functions

 OverviewDockerPage (QWidget *parent=0, const char *name=0, Qt::WindowFlags f=Qt::WindowFlags())
 
void setCanvas (KoCanvasBase *canvas)
 
void unsetCanvas ()
 
 ~OverviewDockerPage () override
 

Protected Member Functions

void enterEvent (QEnterEvent *event) override
 
bool event (QEvent *e) override
 
bool eventFilter (QObject *o, QEvent *e) override
 
void leaveEvent (QEvent *) override
 
void resizeEvent (QResizeEvent *) override
 

Private Slots

void hideControls (int delay) const
 
void on_overviewWidget_signalDraggingFinished ()
 
void on_overviewWidget_signalDraggingStarted ()
 
void showControls (int delay) const
 

Private Member Functions

void layoutMainWidgets ()
 

Private Attributes

bool m_areControlsHidden {false}
 
QPointer< KisCanvas2m_canvas
 
QWidget * m_controlsContainer {nullptr}
 
QVBoxLayout * m_controlsLayout {nullptr}
 
QHBoxLayout * m_controlsSecondRowLayout {nullptr}
 
double m_cumulatedMouseDistanceSquared {0.0}
 
bool m_cursorIsHover {false}
 
bool m_isDraggingWithTouch {false}
 
bool m_isTouching {false}
 
QPointF m_lastOverviewMousePos
 
QPointF m_lastTouchPos
 
QToolButton * m_mirrorCanvas {nullptr}
 
OverviewWidgetm_overviewWidget {nullptr}
 
bool m_pinControls {true}
 
QToolButton * m_pinControlsButton {nullptr}
 
KisAngleSelectorm_rotateAngleSelector {nullptr}
 
QVariantAnimation m_showControlsAnimation
 
QTimer m_showControlsTimer
 
int m_touchPointId {0}
 
QWidget * m_zoomSlider {nullptr}
 

Static Private Attributes

static constexpr double showControlsAnimationDuration {150.0}
 
static constexpr double showControlsAreaRadius {4.0}
 
static constexpr int showControlsTimerDuration {500}
 
static constexpr double touchDragDistance {8.0}
 
static constexpr double touchDragDistanceSquared {touchDragDistance * touchDragDistance}
 

Detailed Description

Definition at line 23 of file overviewdocker_page.h.

Constructor & Destructor Documentation

◆ OverviewDockerPage()

OverviewDockerPage::OverviewDockerPage ( QWidget * parent = 0,
const char * name = 0,
Qt::WindowFlags f = Qt::WindowFlags() )

Definition at line 37 of file overviewdocker_page.cpp.

38 : QWidget(parent, f)
39 , m_lastOverviewMousePos(0.0, 0.0)
40{
41 setObjectName(name);
42
44 m_overviewWidget->setMinimumHeight(50);
45 m_overviewWidget->setBackgroundRole(QPalette::Base);
46 // paints background role before paint()
47 m_overviewWidget->setAutoFillBackground(true);
48 m_overviewWidget->setAttribute(Qt::WA_AcceptTouchEvents, true);
49 m_overviewWidget->installEventFilter(this);
50 connect(m_overviewWidget, SIGNAL(signalDraggingStarted()), SLOT(on_overviewWidget_signalDraggingStarted()));
51 connect(m_overviewWidget, SIGNAL(signalDraggingFinished()), SLOT(on_overviewWidget_signalDraggingFinished()));
52
53 m_controlsContainer = new QWidget(this);
54
55 m_controlsLayout = new QVBoxLayout;
56 m_controlsLayout->setContentsMargins(2, 2, 2, 2);
57 m_controlsLayout->setSpacing(2);
59
60 m_showControlsTimer.setSingleShot(true);
61
62 m_showControlsAnimation.setEasingCurve(QEasingCurve(QEasingCurve::InOutCubic));
63 connect(&m_showControlsAnimation, &QVariantAnimation::valueChanged, this, &OverviewDockerPage::layoutMainWidgets);
64
65 KConfigGroup config = KSharedConfig::openConfig()->group("OverviewDocker");
66 m_pinControls = config.readEntry("pinControls", true);
68
69 setEnabled(false);
70}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
QVariantAnimation m_showControlsAnimation
QVBoxLayout * m_controlsLayout
void on_overviewWidget_signalDraggingFinished()
OverviewWidget * m_overviewWidget

References connect(), layoutMainWidgets(), m_areControlsHidden, m_controlsContainer, m_controlsLayout, m_overviewWidget, m_pinControls, m_showControlsAnimation, m_showControlsTimer, on_overviewWidget_signalDraggingFinished(), and on_overviewWidget_signalDraggingStarted().

◆ ~OverviewDockerPage()

OverviewDockerPage::~OverviewDockerPage ( )
override

Definition at line 72 of file overviewdocker_page.cpp.

73{
74 KConfigGroup config = KSharedConfig::openConfig()->group("OverviewDocker");
75 config.writeEntry("pinControls", m_pinControls);
76}

References m_pinControls.

Member Function Documentation

◆ enterEvent()

void OverviewDockerPage::enterEvent ( QEnterEvent * event)
overrideprotected

Definition at line 243 of file overviewdocker_page.cpp.

245{
246 m_cursorIsHover = true;
247 if (isEnabled() && !m_pinControls) {
249 }
250}
void showControls(int delay) const
static constexpr int showControlsTimerDuration

◆ event()

bool OverviewDockerPage::event ( QEvent * e)
overrideprotected

Definition at line 252 of file overviewdocker_page.cpp.

253{
254 if (e->type() == QEvent::StyleChange || e->type() == QEvent::FontChange) {
255 resizeEvent(nullptr);
256 }
257 return QWidget::event(e);
258}
void resizeEvent(QResizeEvent *) override

References resizeEvent().

◆ eventFilter()

bool OverviewDockerPage::eventFilter ( QObject * o,
QEvent * e )
overrideprotected

Definition at line 260 of file overviewdocker_page.cpp.

261{
262 if (!isEnabled()) {
263 return false;
264 }
265
266 if (o == m_overviewWidget) {
267 // Filter out the mouse events if we are touching the overview widget
268 // and the event was not synthesized in this function from the touch events
269 if (e->type() == QEvent::MouseButtonPress) {
270 if (m_isTouching) {
271 return static_cast<QMouseEvent*>(e)->source() != Qt::MouseEventSynthesizedByApplication;
272 }
273
274 } else if (e->type() == QEvent::MouseButtonRelease) {
275 if (m_isTouching) {
276 return static_cast<QMouseEvent*>(e)->source() != Qt::MouseEventSynthesizedByApplication;
277 }
278
279 } else if (e->type() == QEvent::MouseMove) {
280 if (m_isTouching) {
281 return static_cast<QMouseEvent*>(e)->source() != Qt::MouseEventSynthesizedByApplication;
282 }
284 QMouseEvent *me = static_cast<QMouseEvent*>(e);
285 constexpr double showControlsAreaRadiusSquared = showControlsAreaRadius * showControlsAreaRadius;
286 const QPointF d = me->localPos() - m_lastOverviewMousePos;
287 const double distanceSquared = d.x() * d.x() + d.y() * d.y();
288 if (distanceSquared > m_cumulatedMouseDistanceSquared) {
289 if (distanceSquared >= showControlsAreaRadiusSquared) {
291 m_lastOverviewMousePos = me->localPos();
293 } else {
294 m_cumulatedMouseDistanceSquared = distanceSquared;
295 }
296 }
297 }
298
299 } else if (e->type() == QEvent::TouchBegin) {
300 if (!m_isTouching) {
301 QTouchEvent *te = static_cast<QTouchEvent*>(e);
302 m_isTouching = true;
303 // Store the first touch point. We will only track this one
304 m_touchPointId = te->touchPoints().first().id();
305 m_lastTouchPos = te->touchPoints().first().pos();
306 }
307 // Accept the event so that other touch events keep coming
308 e->accept();
309 return true;
310
311 } else if (e->type() == QEvent::TouchUpdate) {
312 if (!m_isTouching) {
313 return true;
314 }
315 QTouchEvent *te = static_cast<QTouchEvent*>(e);
316 // Get the touch point position
317 QPointF currentPosition;
318 for (const QTouchEvent::TouchPoint &touchPoint : te->touchPoints()) {
319 if (touchPoint.id() == m_touchPointId) {
320 // If the touch point wasn't moved, this event wasn't
321 // generated from our touch point
322 if (touchPoint.state() == Qt::TouchPointStationary) {
323 return true;
324 }
325 currentPosition = touchPoint.pos();
326 break;
327 }
328 }
330 // Compute distance
331 const QPointF delta = currentPosition - m_lastTouchPos;
332 const qreal distanceSquared = delta.x() * delta.x() + delta.y() * delta.y();
333 if (distanceSquared >= touchDragDistanceSquared) {
335 // synthesize mouse press event
336 QMouseEvent *se = new QMouseEvent(QEvent::MouseButtonPress,
337 m_lastTouchPos, QPointF(), QPointF(),
338 Qt::LeftButton, Qt::LeftButton, Qt::NoModifier,
339 Qt::MouseEventSynthesizedByApplication);
340 qApp->sendEvent(m_overviewWidget, se);
341 }
342 }
344 // Synthesize mouse move event
345 QMouseEvent *se = new QMouseEvent(QEvent::MouseMove,
346 currentPosition, QPointF(), QPointF(),
347 Qt::LeftButton, Qt::LeftButton, Qt::NoModifier,
348 Qt::MouseEventSynthesizedByApplication);
349 qApp->sendEvent(m_overviewWidget, se);
350 // Update
351 m_lastTouchPos = currentPosition;
352 }
353 return true;
354
355 } else if (e->type() == QEvent::TouchEnd || e->type() == QEvent::TouchCancel) {
356 if (!m_isTouching) {
357 return true;
358 }
359 QTouchEvent *te = static_cast<QTouchEvent*>(e);
360 if (e->type() == QEvent::TouchEnd) {
361 // If the touch point is not in the released state
362 // then this event wasn't generated from our touch point
363 for (const QTouchEvent::TouchPoint &touchPoint : te->touchPoints()) {
364 if (touchPoint.id() == m_touchPointId) {
365 if (touchPoint.state() != Qt::TouchPointReleased) {
366 return true;
367 }
368 break;
369 }
370 }
371 }
372 // If we are dragging then synthesize mouse release event.
373 // Show/hide the controls otherwise
375 QMouseEvent *se = new QMouseEvent(QEvent::MouseButtonRelease,
376 m_lastTouchPos, QPointF(), QPointF(),
377 Qt::LeftButton, Qt::LeftButton, Qt::NoModifier,
378 Qt::MouseEventSynthesizedByApplication);
379 qApp->sendEvent(m_overviewWidget, se);
380 } else if (e->type() == QEvent::TouchEnd) {
385 showControls(0);
386 } else {
387 hideControls(0);
388 }
389 }
390 // Reset
391 m_isTouching = false;
392 m_isDraggingWithTouch = false;
393 return true;
394 }
395 }
396 return false;
397}
KisMagneticGraph::vertex_descriptor source(typename KisMagneticGraph::edge_descriptor e, KisMagneticGraph g)
QToolButton * m_pinControlsButton
static constexpr double touchDragDistanceSquared
static constexpr double showControlsAreaRadius
void hideControls(int delay) const
bool isDragging() const

References hideControls(), OverviewWidget::isDragging(), m_areControlsHidden, m_cumulatedMouseDistanceSquared, m_isDraggingWithTouch, m_isTouching, m_lastOverviewMousePos, m_lastTouchPos, m_overviewWidget, m_pinControls, m_pinControlsButton, m_touchPointId, showControls(), showControlsAreaRadius, showControlsTimerDuration, source(), and touchDragDistanceSquared.

◆ hideControls

void OverviewDockerPage::hideControls ( int delay) const
privateslot

Definition at line 461 of file overviewdocker_page.cpp.

462{
463 auto animFunction =
464 [this]() -> void
465 {
466 int animationDuration;
467 qreal animationStartValue;
468
469 if (!m_areControlsHidden) {
470 if (m_showControlsAnimation.state() == QVariantAnimation::Running) {
472 animationDuration =
473 static_cast<int>(std::round(m_showControlsAnimation.currentValue().toReal() * showControlsAnimationDuration));
474 animationStartValue = m_showControlsAnimation.currentValue().toReal();
475 } else {
476 animationDuration = showControlsAnimationDuration;
477 animationStartValue = 1.0;
478 }
479 } else {
480 animationDuration = 1;
481 animationStartValue = 0.0;
482 }
483
484 m_areControlsHidden = true;
485 m_showControlsAnimation.setStartValue(animationStartValue);
486 m_showControlsAnimation.setEndValue(0.0);
487 m_showControlsAnimation.setDuration(animationDuration);
489 };
490
491 delay = qMax(delay, 0);
492
493 m_showControlsTimer.disconnect();
494 connect(&m_showControlsTimer, &QTimer::timeout, animFunction);
495 m_showControlsTimer.start(delay);
496}
static constexpr double showControlsAnimationDuration

References connect(), m_areControlsHidden, m_showControlsAnimation, m_showControlsTimer, and showControlsAnimationDuration.

◆ layoutMainWidgets()

void OverviewDockerPage::layoutMainWidgets ( )
private

Definition at line 399 of file overviewdocker_page.cpp.

400{
401 this->setMinimumHeight(m_overviewWidget->minimumHeight() +
402 m_controlsContainer->minimumSizeHint().height());
403
404 if (m_showControlsAnimation.state() == QVariantAnimation::Running) {
405 const qreal pageHeight = static_cast<qreal>(this->height());
406 const qreal controlsContainerHeight = static_cast<qreal>(m_controlsContainer->sizeHint().height());
407 const qreal animationProgress = m_showControlsAnimation.currentValue().toReal();
408 const int widgetLimitPosition = static_cast<int>(std::round(pageHeight - animationProgress * controlsContainerHeight));
409 m_overviewWidget->setGeometry(0, 0, this->width(), widgetLimitPosition);
410 m_controlsContainer->setGeometry(0, widgetLimitPosition, this->width(), static_cast<int>(controlsContainerHeight));
411 } else {
412 const int controlsContainerHeight = m_controlsContainer->sizeHint().height();
414 const int widgetLimitPosition = this->height() - controlsContainerHeight;
415 m_overviewWidget->setGeometry(0, 0, this->width(), widgetLimitPosition);
416 m_controlsContainer->setGeometry(0, widgetLimitPosition, this->width(), controlsContainerHeight);
417 } else {
418 m_overviewWidget->setGeometry(0, 0, this->width(), this->height());
419 m_controlsContainer->setGeometry(0, this->height(), this->width(), controlsContainerHeight);
420 }
421 }
422}

References m_areControlsHidden, m_controlsContainer, m_overviewWidget, m_pinControls, and m_showControlsAnimation.

◆ leaveEvent()

void OverviewDockerPage::leaveEvent ( QEvent * )
overrideprotected

Definition at line 231 of file overviewdocker_page.cpp.

232{
233 m_cursorIsHover = false;
234 if (isEnabled() && !m_pinControls) {
235 hideControls(0);
237 }
238}

References hideControls(), m_cumulatedMouseDistanceSquared, m_cursorIsHover, and m_pinControls.

◆ mirrorUpdateIcon

void OverviewDockerPage::mirrorUpdateIcon ( )
slot

Definition at line 197 of file overviewdocker_page.cpp.

198{
199 if(!m_mirrorCanvas) return;
200 m_mirrorCanvas->setIcon(KisIconUtils::loadIcon("mirror-view-16"));
201}
QToolButton * m_mirrorCanvas
QIcon loadIcon(const QString &name)

References KisIconUtils::loadIcon(), and m_mirrorCanvas.

◆ on_overviewWidget_signalDraggingFinished

void OverviewDockerPage::on_overviewWidget_signalDraggingFinished ( )
privateslot

◆ on_overviewWidget_signalDraggingStarted

void OverviewDockerPage::on_overviewWidget_signalDraggingStarted ( )
privateslot

Definition at line 498 of file overviewdocker_page.cpp.

499{
501 m_showControlsTimer.stop();
502 }
503}

References m_areControlsHidden, m_pinControls, and m_showControlsTimer.

◆ resizeEvent()

void OverviewDockerPage::resizeEvent ( QResizeEvent * )
overrideprotected

Definition at line 226 of file overviewdocker_page.cpp.

227{
229}

References layoutMainWidgets().

◆ rotateCanvasView

void OverviewDockerPage::rotateCanvasView ( qreal rotation)
slot

Definition at line 203 of file overviewdocker_page.cpp.

204{
205 if (!m_canvas) return;
206 KisCanvasController *canvasController =
207 dynamic_cast<KisCanvasController*>(m_canvas->viewManager()->canvasBase()->canvasController());
208 if (canvasController) {
209 canvasController->rotateCanvas(rotation-m_canvas->rotationAngle());
210 }
211}
void rotateCanvas(qreal angle, const std::optional< KoViewTransformStillPoint > &stillPoint, bool isNativeGesture=false)
QPointer< KisCanvas2 > m_canvas

References m_canvas, and KisCanvasController::rotateCanvas().

◆ setCanvas()

void OverviewDockerPage::setCanvas ( KoCanvasBase * canvas)

Definition at line 78 of file overviewdocker_page.cpp.

79{
80 if(m_canvas == canvas)
81 return;
82
83 setEnabled(canvas != nullptr);
84
85 if (m_canvas) {
86 m_canvas->disconnectCanvasObserver(this);
87 m_canvas->image()->disconnect(this);
88 m_canvas = nullptr;
89 }
90
91 if (m_zoomSlider) {
93 delete m_zoomSlider;
94 m_zoomSlider = nullptr;
95 }
96
100 m_rotateAngleSelector = nullptr;
101 }
102
103 if (m_mirrorCanvas) {
105 delete m_mirrorCanvas;
106 m_mirrorCanvas = nullptr;
107 }
108
111 delete m_pinControlsButton;
112 m_pinControlsButton = nullptr;
113 }
114
115 // Delete the stretch
116 while (m_controlsSecondRowLayout && m_controlsSecondRowLayout->count() && m_controlsSecondRowLayout->itemAt(0)->spacerItem()) {
117 delete m_controlsSecondRowLayout->takeAt(0);
118 }
119
121
124
125 m_canvas = dynamic_cast<KisCanvas2*>(canvas);
126
128 if (m_canvas && m_canvas->viewManager()) {
129 bool usePrintResolutionMode = m_canvas->imageView()->canvasController()->usePrintResolutionMode();
130 m_zoomSlider = m_canvas->imageView()->zoomManager()->zoomAction()->createWidget(m_canvas->imageView()->KisView::statusBar());
131 KoZoomWidget* zoomWidget = static_cast<KoZoomWidget*>(m_zoomSlider);
132 zoomWidget->setZoomInputFlat(false);
133 zoomWidget->setUsePrintResolutionMode(usePrintResolutionMode);
134 m_controlsLayout->addWidget(m_zoomSlider);
135
137 m_rotateAngleSelector->setRange(-360.00, 360.0);
138 m_rotateAngleSelector->setAngle(m_canvas->rotationAngle());
141 connect(m_rotateAngleSelector, SIGNAL(angleChanged(qreal)), this, SLOT(rotateCanvasView(qreal)), Qt::UniqueConnection);
142 connect(m_canvas->canvasController()->proxyObject, SIGNAL(documentRotationChanged(qreal)), this, SLOT(updateRotationSlider(qreal)));
143
144 m_mirrorCanvas = new QToolButton();
145 QList<QAction *> actions = m_canvas->viewManager()->actionCollection()->actions();
146 Q_FOREACH(QAction* action, actions) {
147 if (action->objectName()=="mirror_canvas") {
148 m_mirrorCanvas->setDefaultAction(action);
149 }
150 }
151 m_mirrorCanvas->setIcon(KisIconUtils::loadIcon("mirror-view-16"));
152 m_mirrorCanvas->setAutoRaise(true);
153 connect(m_mirrorCanvas, SIGNAL(toggled(bool)), this, SLOT(mirrorUpdateIcon()));
154
155 m_pinControlsButton = new QToolButton;
156 m_pinControlsButton->setCheckable(true);
158 m_pinControlsButton->setToolTip(
159 i18nc("Make the controls in the overview docker auto-hide or always visible", "Pin navigation controls")
160 );
161 m_pinControlsButton->setIcon(KisIconUtils::loadIcon("krita_tool_reference_images"));
162 m_pinControlsButton->setAutoRaise(true);
163 connect(m_pinControlsButton, SIGNAL(toggled(bool)), SLOT(setPinControls(bool)));
164
165 m_controlsSecondRowLayout = new QHBoxLayout();
166
168 m_controlsSecondRowLayout->addStretch();
170 m_controlsSecondRowLayout->addStretch();
173
174 //m_zoomSlider->setVisible(true);
175 m_rotateAngleSelector->setVisible(true);
176
177 // Show/hide the controls
178 if (m_pinControls) {
179 showControls(0);
180 } else {
181 if (m_cursorIsHover) {
182 showControls(0);
183 } else {
184 hideControls(0);
185 }
186 }
187 }
188}
@ IncreasingDirection_Clockwise
A widget with several options to select an angle.
@ FlipOptionsMode_ContextMenu
The flip options are shown only as a context menu when right-clicking the gauge widget.
void setFlipOptionsMode(FlipOptionsMode newMode)
Sets the mode in which the flip options should be shown.
void setIncreasingDirection(KisAngleGauge::IncreasingDirection newIncreasingDirection)
Sets the increasing direction in the angle gauge.
void setAngle(qreal newAngle)
Sets the current angle.
void setRange(qreal newMinimum, qreal newMaximum)
Sets the minimum and maximum values for the angle.
void setZoomInputFlat(bool flat)
void setUsePrintResolutionMode(bool value)
QHBoxLayout * m_controlsSecondRowLayout
KisAngleSelector * m_rotateAngleSelector
void rotateCanvasView(qreal rotation)
void updateRotationSlider(qreal rotation)
void setCanvas(KisCanvas2 *canvas) override

References connect(), KisAngleSelector::FlipOptionsMode_ContextMenu, hideControls(), KisAngleGauge::IncreasingDirection_Clockwise, KisIconUtils::loadIcon(), m_canvas, m_controlsLayout, m_controlsSecondRowLayout, m_cursorIsHover, m_mirrorCanvas, m_overviewWidget, m_pinControls, m_pinControlsButton, m_rotateAngleSelector, m_zoomSlider, mirrorUpdateIcon(), rotateCanvasView(), KisAngleSelector::setAngle(), OverviewWidget::setCanvas(), KisAngleSelector::setFlipOptionsMode(), KisAngleSelector::setIncreasingDirection(), setPinControls(), KisAngleSelector::setRange(), KoZoomWidget::setUsePrintResolutionMode(), KoZoomWidget::setZoomInputFlat(), showControls(), and updateRotationSlider().

◆ setPinControls

void OverviewDockerPage::setPinControls ( bool pin)
slot

Definition at line 221 of file overviewdocker_page.cpp.

222{
223 m_pinControls = pin;
224}

References m_pinControls.

◆ showControls

void OverviewDockerPage::showControls ( int delay) const
privateslot

Definition at line 424 of file overviewdocker_page.cpp.

425{
426 auto animFunction =
427 [this]() -> void
428 {
429 int animationDuration;
430 qreal animationStartValue;
431
433 if (m_showControlsAnimation.state() == QVariantAnimation::Running) {
435 animationDuration =
436 static_cast<int>(std::round((1.0 - m_showControlsAnimation.currentValue().toReal()) * showControlsAnimationDuration));
437 animationStartValue = m_showControlsAnimation.currentValue().toReal();
438 } else {
439 animationDuration = showControlsAnimationDuration;
440 animationStartValue = 0.0;
441 }
442 } else {
443 animationDuration = 1;
444 animationStartValue = 1.0;
445 }
446
447 m_areControlsHidden = false;
448 m_showControlsAnimation.setStartValue(animationStartValue);
449 m_showControlsAnimation.setEndValue(1.0);
450 m_showControlsAnimation.setDuration(animationDuration);
452 };
453
454 delay = qMax(delay, 0);
455
456 m_showControlsTimer.disconnect();
457 connect(&m_showControlsTimer, &QTimer::timeout, animFunction);
458 m_showControlsTimer.start(delay);
459}

References connect(), m_areControlsHidden, m_showControlsAnimation, m_showControlsTimer, and showControlsAnimationDuration.

◆ unsetCanvas()

void OverviewDockerPage::unsetCanvas ( )

Definition at line 190 of file overviewdocker_page.cpp.

191{
192 setEnabled(false);
193 m_canvas = nullptr;
195}

References m_canvas, m_overviewWidget, and OverviewWidget::setCanvas().

◆ updateRotationSlider

void OverviewDockerPage::updateRotationSlider ( qreal rotation)
slot

Definition at line 213 of file overviewdocker_page.cpp.

214{
215 if (qAbs(m_rotateAngleSelector->angle() - angle) > 0.01) {
217 m_rotateAngleSelector->setAngle(m_canvas->rotationAngle());
218 }
219}
qreal angle() const
Gets the current angle.

References KisAngleSelector::angle(), m_canvas, m_rotateAngleSelector, and KisAngleSelector::setAngle().

Member Data Documentation

◆ m_areControlsHidden

bool OverviewDockerPage::m_areControlsHidden {false}
mutableprivate

Definition at line 74 of file overviewdocker_page.h.

74{false};

◆ m_canvas

QPointer<KisCanvas2> OverviewDockerPage::m_canvas
private

Definition at line 65 of file overviewdocker_page.h.

◆ m_controlsContainer

QWidget* OverviewDockerPage::m_controlsContainer {nullptr}
private

Definition at line 60 of file overviewdocker_page.h.

60{nullptr};

◆ m_controlsLayout

QVBoxLayout* OverviewDockerPage::m_controlsLayout {nullptr}
private

Definition at line 57 of file overviewdocker_page.h.

57{nullptr};

◆ m_controlsSecondRowLayout

QHBoxLayout* OverviewDockerPage::m_controlsSecondRowLayout {nullptr}
private

Definition at line 58 of file overviewdocker_page.h.

58{nullptr};

◆ m_cumulatedMouseDistanceSquared

double OverviewDockerPage::m_cumulatedMouseDistanceSquared {0.0}
private

Definition at line 76 of file overviewdocker_page.h.

76{0.0};

◆ m_cursorIsHover

bool OverviewDockerPage::m_cursorIsHover {false}
private

Definition at line 67 of file overviewdocker_page.h.

67{false};

◆ m_isDraggingWithTouch

bool OverviewDockerPage::m_isDraggingWithTouch {false}
private

Definition at line 69 of file overviewdocker_page.h.

69{false};

◆ m_isTouching

bool OverviewDockerPage::m_isTouching {false}
private

Definition at line 68 of file overviewdocker_page.h.

68{false};

◆ m_lastOverviewMousePos

QPointF OverviewDockerPage::m_lastOverviewMousePos
private

Definition at line 75 of file overviewdocker_page.h.

◆ m_lastTouchPos

QPointF OverviewDockerPage::m_lastTouchPos
private

Definition at line 71 of file overviewdocker_page.h.

◆ m_mirrorCanvas

QToolButton* OverviewDockerPage::m_mirrorCanvas {nullptr}
private

Definition at line 63 of file overviewdocker_page.h.

63{nullptr};

◆ m_overviewWidget

OverviewWidget* OverviewDockerPage::m_overviewWidget {nullptr}
private

Definition at line 59 of file overviewdocker_page.h.

59{nullptr};

◆ m_pinControls

bool OverviewDockerPage::m_pinControls {true}
private

Definition at line 66 of file overviewdocker_page.h.

66{true};

◆ m_pinControlsButton

QToolButton* OverviewDockerPage::m_pinControlsButton {nullptr}
private

Definition at line 64 of file overviewdocker_page.h.

64{nullptr};

◆ m_rotateAngleSelector

KisAngleSelector* OverviewDockerPage::m_rotateAngleSelector {nullptr}
private

Definition at line 62 of file overviewdocker_page.h.

62{nullptr};

◆ m_showControlsAnimation

QVariantAnimation OverviewDockerPage::m_showControlsAnimation
mutableprivate

Definition at line 72 of file overviewdocker_page.h.

◆ m_showControlsTimer

QTimer OverviewDockerPage::m_showControlsTimer
mutableprivate

Definition at line 73 of file overviewdocker_page.h.

◆ m_touchPointId

int OverviewDockerPage::m_touchPointId {0}
private

Definition at line 70 of file overviewdocker_page.h.

70{0};

◆ m_zoomSlider

QWidget* OverviewDockerPage::m_zoomSlider {nullptr}
private

Definition at line 61 of file overviewdocker_page.h.

61{nullptr};

◆ showControlsAnimationDuration

constexpr double OverviewDockerPage::showControlsAnimationDuration {150.0}
staticconstexprprivate

Definition at line 53 of file overviewdocker_page.h.

53{150.0};

◆ showControlsAreaRadius

constexpr double OverviewDockerPage::showControlsAreaRadius {4.0}
staticconstexprprivate

Definition at line 52 of file overviewdocker_page.h.

52{4.0};

◆ showControlsTimerDuration

constexpr int OverviewDockerPage::showControlsTimerDuration {500}
staticconstexprprivate

Definition at line 50 of file overviewdocker_page.h.

50{500};

◆ touchDragDistance

constexpr double OverviewDockerPage::touchDragDistance {8.0}
staticconstexprprivate

Definition at line 54 of file overviewdocker_page.h.

54{8.0};

◆ touchDragDistanceSquared

constexpr double OverviewDockerPage::touchDragDistanceSquared {touchDragDistance * touchDragDistance}
staticconstexprprivate

Definition at line 55 of file overviewdocker_page.h.


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