From 741138c5850d5c32a0558d96a1e6f6f92c70e4b1 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Thu, 8 Dec 2022 14:10:55 +0100 Subject: [PATCH] LibGUI: Add a prefix to `IncrementalSearchBanner`'s widgets name Widget's name are the current way to retrieve them when using GML. Presently, there is no way to differentiate two items that share the same name. `IncrementalSearchBanner` uses common names as "close_button" or "next_button", prepend them with `incremental_search_banner_` avoid collisions. This fixes a bug where the close button of `CrashReporter` was confused with the one of the search banner. However, This solution isn't perfect, down the road, we should probably find a way to warn about equal names and introduce something like namespace to avoid huge prefixes. --- .../Libraries/LibGUI/IncrementalSearchBanner.cpp | 14 +++++++------- .../Libraries/LibGUI/IncrementalSearchBanner.gml | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Userland/Libraries/LibGUI/IncrementalSearchBanner.cpp b/Userland/Libraries/LibGUI/IncrementalSearchBanner.cpp index c91350232eb..fe244a36d27 100644 --- a/Userland/Libraries/LibGUI/IncrementalSearchBanner.cpp +++ b/Userland/Libraries/LibGUI/IncrementalSearchBanner.cpp @@ -20,39 +20,39 @@ IncrementalSearchBanner::IncrementalSearchBanner(TextEditor& editor) : m_editor(editor) { load_from_gml(incremental_search_banner_gml); - m_index_label = find_descendant_of_type_named