mirror of
https://github.com/storytold/craft-libs.git
synced 2026-12-01 10:48:15 +01:00
BrushSectionEvent: constructors for hosts and their tests
This commit is contained in:
1 parent
1a128b726a
commit
f5dafff290
1 file changed
+17
@@ -119,6 +119,23 @@ pub enum BrushSectionEvent<K> {
|
||||
OpenLink,
|
||||
}
|
||||
|
||||
impl<K> BrushSectionEvent<K> {
|
||||
/// 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]
|
||||
|
||||
Reference in new issue
Block a user