mirror of
https://github.com/cyanfish/naps2.git
synced 2024-09-11 15:26:55 +03:00
The previous implementation involved lazy item setting. This was causing layout issues in Gtk where empty dropdowns have a different size.
14 lines
331 B
C#
14 lines
331 B
C#
using NAPS2.Scan;
|
|
|
|
namespace NAPS2.EtoForms.Widgets;
|
|
|
|
public class EnumDropDownWidget<T> : DropDownWidget<T> where T : struct, Enum
|
|
{
|
|
public static IEnumerable<T> DefaultItems => (T[]) Enum.GetValues(typeof(T));
|
|
|
|
public EnumDropDownWidget()
|
|
{
|
|
Format = x => x.Description();
|
|
Items = DefaultItems;
|
|
}
|
|
} |