From f5dafff290cc360d7ab9b819b6d9546fcf3cc882 Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 13 Nov 2026 01:17:36 +0000 Subject: [PATCH] BrushSectionEvent: constructors for hosts and their tests --- crates/draw/src/ui/brush_settings/sections.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/crates/draw/src/ui/brush_settings/sections.rs b/crates/draw/src/ui/brush_settings/sections.rs index 45735f311..edc3462af 100644 --- a/crates/draw/src/ui/brush_settings/sections.rs +++ b/crates/draw/src/ui/brush_settings/sections.rs @@ -119,6 +119,23 @@ pub enum BrushSectionEvent { OpenLink, } +impl BrushSectionEvent { + /// An enable box change of `key` to `on`. + pub fn enable(key: K, on: bool) -> Self { + Self::Enable { key, on } + } + + /// A lock change of `key` to `on`. + pub fn lock(key: K, on: bool) -> Self { + Self::Lock { key, on } + } + + /// A switch row change of `key` to `on`. + pub fn switch(key: K, on: bool) -> Self { + Self::Switch { key, on } + } +} + /// What [`BrushSectionList::show`] reports. #[derive(Debug)] #[non_exhaustive]