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 SAP appearing as a ghost on the canvas when hidden
Dmitry Kazakov61ac5f62b940
diff --git a/libs/ui/kis_selection_actions_panel.cpp b/libs/ui/kis_selection_actions_panel.cppindex 862a60e058..ec8ecace90 100644--- a/libs/ui/kis_selection_actions_panel.cpp+++ b/libs/ui/kis_selection_actions_panel.cpp@@ -317,6 +317,10 @@ void KisSelectionActionsPanel::setVisible(bool p_visible)d->configure_action->setVisible(p_visible && d->m_viewManager->selection());+ // movePanelWidgets() uses d->m_visible to decide whether to make the widgets+ // visible or not+ d->m_visible = p_visible;+if (d->m_viewManager->selection() && p_visible) { // Now visible!d->m_handleWidget->installEventFilter(this);d->m_dragHandle.position = currentTopLeftPosition();@@ -331,8 +335,6 @@ void KisSelectionActionsPanel::setVisible(bool p_visible)d->m_pressed = false;}-- d->m_visible = p_visible;}void KisSelectionActionsPanel::setEnabled(bool enabled)@@ -414,11 +416,15 @@ void KisSelectionActionsPanel::canvasWidgetChanged(KisCanvasWidgetBase* canvas)Q_FOREACH(QWidget* btn, d->m_buttons) {btn->setParent(canvas->widget());- btn->show();+ if (d->m_visible) {+ btn->show();+ }}d->m_handleWidget->setParent(canvas->widget());- d->m_handleWidget->show();+ if (d->m_visible) {+ d->m_handleWidget->show();+ }}QPoint KisSelectionActionsPanel::clipPositionToCanvasBoundaries(QPoint position, QWidget *canvasWidget) const@@ -743,6 +749,10 @@ void KisSelectionActionsPanel::movePanelWidgets()if (!d->m_handleWidget)return;+ // don't show the widgets if the panel is hidden+ if (!d->m_visible)+ return;+if (d->orientation == Orientation::Vertical) {d->m_handleWidget->move(d->m_dragHandle.position.x(),d->m_dragHandle.position.y() + d->m_buttons.size() * BUTTON_SIZE);