Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix Display Selection action check state

Freya Lupend3984d5123c3
diff --git a/libs/ui/kis_selection_decoration.cc b/libs/ui/kis_selection_decoration.cc
index 744e782585..960bf23e50 100644
--- a/libs/ui/kis_selection_decoration.cc
+++ b/libs/ui/kis_selection_decoration.cc
@@ -199,10 +199,14 @@ void KisSelectionDecoration::antsAttackEvent()
}
}
-void KisSelectionDecoration::toggleSlectionVisibility() {
+void KisSelectionDecoration::toggleSelectionVisibility() {
m_selectionVisibility = !m_selectionVisibility;
}
+bool KisSelectionDecoration::selectionVisible() {
+ return m_selectionVisibility;
+}
+
void KisSelectionDecoration::drawDecoration(QPainter& gc, const QRectF& updateRect, const KisCoordinatesConverter *converter, KisCanvas2 *canvas)
{
Q_UNUSED(updateRect);
diff --git a/libs/ui/kis_selection_decoration.h b/libs/ui/kis_selection_decoration.h
index d8db1690b2..eb40c86d3f 100644
--- a/libs/ui/kis_selection_decoration.h
+++ b/libs/ui/kis_selection_decoration.h
@@ -39,7 +39,8 @@ public:
void notifyWindowMinimized(bool minimized) override;
void setCanvasWidget(KisCanvasWidgetBase* canvas) override;
- void toggleSlectionVisibility();
+ void toggleSelectionVisibility();
+ bool selectionVisible();
protected:
void drawDecoration(QPainter& gc, const QRectF& updateRect, const KisCoordinatesConverter *converter,KisCanvas2* canvas) override;
diff --git a/libs/ui/kis_selection_manager.cc b/libs/ui/kis_selection_manager.cc
index 230d315b04..9da322daa2 100644
--- a/libs/ui/kis_selection_manager.cc
+++ b/libs/ui/kis_selection_manager.cc
@@ -587,9 +587,9 @@ void KisSelectionManager::toggleDisplaySelection()
{
KIS_ASSERT_RECOVER_RETURN(m_selectionDecoration);
- m_selectionDecoration->toggleSlectionVisibility();
+ m_selectionDecoration->toggleSelectionVisibility();
m_toggleDisplaySelection->blockSignals(true);
- m_toggleDisplaySelection->setChecked(m_selectionDecoration->visible());
+ m_toggleDisplaySelection->setChecked(m_selectionDecoration->selectionVisible());
m_toggleDisplaySelection->blockSignals(false);
Q_EMIT displaySelectionChanged();