From 308ce397474395aa6ea01fb002810ec19b357871 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 25 May 2025 09:51:47 +0100 Subject: [PATCH] Codechange: Add DropDownUnselectable component. This component makes a drop down item unselectable, as it says on the tin. --- src/dropdown_common_type.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/dropdown_common_type.h b/src/dropdown_common_type.h index 733e81b75b..21f0a01865 100644 --- a/src/dropdown_common_type.h +++ b/src/dropdown_common_type.h @@ -260,6 +260,19 @@ public: } }; +/** + * Drop down component that makes the item unselectable. + * @tparam TBase Base component. + */ +template +class DropDownUnselectable : public TBase { +public: + template + explicit DropDownUnselectable(Args&&... args) : TBase(std::forward(args)...) {} + + bool Selectable() const override { return false; } +}; + /* Commonly used drop down list items. */ using DropDownListDividerItem = DropDownDivider; using DropDownListStringItem = DropDownString;