From c59c97036393e512b5d7484115645ca74a1bdf94 Mon Sep 17 00:00:00 2001 From: Marcus Nilsson Date: Thu, 8 Jul 2021 22:47:05 +0200 Subject: [PATCH] PixelPaint: Don't deselect layers in LayerListWidget There is really no reason to be able to deselect layers, so just ignore when the user clicks outside of a layer gadget. --- Userland/Applications/PixelPaint/LayerListWidget.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Userland/Applications/PixelPaint/LayerListWidget.cpp b/Userland/Applications/PixelPaint/LayerListWidget.cpp index fbf6ac39de..6df4b3b570 100644 --- a/Userland/Applications/PixelPaint/LayerListWidget.cpp +++ b/Userland/Applications/PixelPaint/LayerListWidget.cpp @@ -134,11 +134,9 @@ void LayerListWidget::mousedown_event(GUI::MouseEvent& event) Gfx::IntPoint translated_event_point = { 0, vertical_scrollbar().value() + event.y() }; auto gadget_index = gadget_at(translated_event_point); - if (!gadget_index.has_value()) { - if (on_layer_select) - on_layer_select(nullptr); + if (!gadget_index.has_value()) return; - } + m_moving_gadget_index = gadget_index; m_selected_layer_index = gadget_index.value(); m_moving_event_origin = translated_event_point;