diff --git a/crates/color/src/ui/swatches/library.rs b/crates/color/src/ui/swatches/library.rs index f29611815..3653c61b9 100644 --- a/crates/color/src/ui/swatches/library.rs +++ b/crates/color/src/ui/swatches/library.rs @@ -486,6 +486,11 @@ impl SwatchEdit { pub fn delete(swatch: String) -> Self { SwatchEdit::Delete { swatch } } + + /// Moves the group named `group` to position `to`. + pub fn move_group(group: String, to: usize) -> Self { + SwatchEdit::MoveGroup { group, to } + } } impl SwatchLibrary { diff --git a/crates/ui-patterns/src/patterns/panels/history.rs b/crates/ui-patterns/src/patterns/panels/history.rs index b3346fe9e..1028486df 100644 --- a/crates/ui-patterns/src/patterns/panels/history.rs +++ b/crates/ui-patterns/src/patterns/panels/history.rs @@ -144,6 +144,18 @@ pub enum HistoryEvent { NewDocument, } +impl HistoryEvent { + /// Renames snapshot `snapshot` to `text`. + pub fn rename(snapshot: u64, text: impl Into) -> Self { + HistoryEvent::Rename { snapshot, text: text.into() } + } + + /// Asks for a new snapshot with `mods` held. + pub const fn new_snapshot(mods: Mods) -> Self { + HistoryEvent::NewSnapshot { mods } + } +} + /// What [`HistoryPanel`] reports. #[non_exhaustive] pub struct HistoryPanelOutput {