Closing the picker gives open text the keys back; colour edits wait for text editing (12.14d2)

This commit is contained in:
雷电芽衣 committed 2026-09-30 06:16:28 -04:00
1 parent 27a4fe8428
commit aa5a44e517
10 files changed
+217 -10

No files matched your search

+3
View File
@@ -257,6 +257,9 @@ void EditorSession::closeColorPicker(bool commit)
const PaletteColor chosen = commit ? color : picker.original;
changeEffects([&](LayerEffects &effects) { effects.setColor(chosen, picker.target.effect); });
}
// Sampling took the keys from open text: they go back.
if (m_textDraft)
++m_canvasFocusRequest;
notify();
}
+2 -1
View File
@@ -32,7 +32,8 @@ bool EditorSession::canAdjust(bool allowingEmpty) const
{
const std::optional<ImageLayer> layer = activeLayer();
const std::optional<DocumentSelection> current = selection();
return !m_levels && !m_filterEdit && m_document && layer && !m_isProjectBusy && !m_isImporting && !m_brushStroke && !m_pixelMove && !m_renamingLayerID && !m_showsNewDocument
// Open text is drawn by its editor: previews would lie.
return !m_levels && !m_filterEdit && !m_textDraft && m_document && layer && !m_isProjectBusy && !m_isImporting && !m_brushStroke && !m_pixelMove && !m_renamingLayerID && !m_showsNewDocument
&& !m_showsImporter && m_selectedLayerIDs.size() == 1 && !layer->isGroup && !m_isMaskSelected && (layer->asset || allowingEmpty)
&& m_document->effectiveVisibleIDs().contains(layer->id) && !(current && current->isEmpty());
}
+1 -1
View File
@@ -122,7 +122,7 @@ void EditorSession::deleteLayerOrMask()
bool EditorSession::canInvert() const
{
const std::optional<ImageLayer> layer = activeLayer();
if (!m_document || !layer || m_isProjectBusy || m_isImporting || m_brushStroke || m_pixelMove || m_renamingLayerID || m_showsNewDocument || m_showsImporter
if (!m_document || m_textDraft || !layer || m_isProjectBusy || m_isImporting || m_brushStroke || m_pixelMove || m_renamingLayerID || m_showsNewDocument || m_showsImporter
|| m_selectedLayerIDs.size() != 1 || (layer->isGroup && !m_isMaskSelected) || !m_document->effectiveVisibleIDs().contains(layer->id))
return false;
const std::optional<DocumentSelection> current = selection();
+2 -2
View File
@@ -89,9 +89,9 @@ void CanvasView::consumeFocusRequest(int request)
if (request == m_lastFocusRequest)
return;
m_lastFocusRequest = request;
// An open draft leaves the keys where they are.
// Open text takes the keys back too, after the picker.
QMetaObject::invokeMethod(this, [this] {
if (!QApplication::activeModalWidget() && !m_session.textDraft())
if (!QApplication::activeModalWidget())
setFocus(Qt::OtherFocusReason);
}, Qt::QueuedConnection);
}