summaryrefslogtreecommitdiffstats
path: root/pkg/gui/types
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-09-22 16:09:02 +0200
committerStefan Haller <stefan@haller-berlin.de>2023-10-08 18:45:36 +0200
commit7075b66bc6dde80be5e0bc626db1988a9f47e2ca (patch)
tree24dbb9819070b4ce9351f79b8a5a0db6ada876f9 /pkg/gui/types
parent9d55d71fdd310886cc178a4416a9d743d8f34a03 (diff)
Add WithInlineStatus helper function
Very similar to WithWaitingStatus, except that the status is shown in a view next to the affected item, rather than in the status bar. Not used by anything yet; again, committing separately to get smaller commits.
Diffstat (limited to 'pkg/gui/types')
-rw-r--r--pkg/gui/types/common.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/gui/types/common.go b/pkg/gui/types/common.go
index f4fde41c7..e9f9fc266 100644
--- a/pkg/gui/types/common.go
+++ b/pkg/gui/types/common.go
@@ -87,6 +87,12 @@ type IGuiCommon interface {
// resized, if in accordion mode.
AfterLayout(f func() error)
+ // Wraps a function, attaching the given operation to the given item while
+ // the function is executing, and also causes the given context to be
+ // redrawn periodically. This allows the operation to be visualized with a
+ // spinning loader animation (e.g. when a branch is being pushed).
+ WithInlineStatus(item HasUrn, operation ItemOperation, contextKey ContextKey, f func(gocui.Task) error) error
+
// returns the gocui Gui struct. There is a good chance you don't actually want to use
// this struct and instead want to use another method above
GocuiGui() *gocui.Gui