1
0
Fork 0

Codechange: Add DropDownUnselectable component.

This component makes a drop down item unselectable, as it says on the tin.
pull/14305/head
Peter Nelson 2025-05-25 09:51:47 +01:00 committed by Peter Nelson
parent 82f5af7ecd
commit 308ce39747
1 changed files with 13 additions and 0 deletions

View File

@ -260,6 +260,19 @@ public:
}
};
/**
* Drop down component that makes the item unselectable.
* @tparam TBase Base component.
*/
template <class TBase, FontSize TFs = FS_NORMAL>
class DropDownUnselectable : public TBase {
public:
template <typename... Args>
explicit DropDownUnselectable(Args&&... args) : TBase(std::forward<Args>(args)...) {}
bool Selectable() const override { return false; }
};
/* Commonly used drop down list items. */
using DropDownListDividerItem = DropDownDivider<DropDownListItem>;
using DropDownListStringItem = DropDownString<DropDownListItem>;