Close #128: ArchiveUI defines cursorPosition() which is used to place entries

This commit is contained in:
2022-09-28 23:05:12 +00:00
parent 36e888723f
commit 9ab0c3d671
7 changed files with 28 additions and 7 deletions

View File

@@ -5,6 +5,7 @@ import kiss.List;
import nat.System;
import nat.components.*;
import haxe.DynamicAccess;
import haxe.ds.Option;
typedef PlaygroundEntryProcessor = (Archive, Entry, Position, ?ArchiveUI) -> Dynamic; // Whatever value is returned will be dropped, but this is easier than requiring ->:Void
typedef PlaygroundConnectionProcessor = (Archive, Entry, Position, Entry, Position, ?ArchiveUI) -> Dynamic; // Whatever value is returned will be dropped, but this is easier than requiring ->:Void

View File

@@ -42,6 +42,14 @@
(method switchPlaygroundKey [key]
(set _playgroundKey key)
(clear (or (dictGet playgroundBGColors _playgroundKey) (object r 0.0 g 0.0 b 0.0 a 1.0)))
(set ui.controller.archive.defaultInitializer ->e
{
(when (currentDefaultTags)
(addTags ui.controller.archive e (currentDefaultTags)))
(whenLet [(Some position) (ui.cursorPosition)]
(addComponent ui.controller.archive e Positions [=>_playgroundKey position]))
})
(process ui.controller.archive ui))
(method :Void clear [:Color color]