Commit Graph
44 Commits
Author SHA1 Message Date
9a262e9b0f fix: use atomic for ids (#634)
closes #622

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Ville Valkonen <weezel@users.noreply.github.com>
2024-10-07 15:26:12 -03:00
Christian Rocha e9dfea975f feat(spinner): periods of ellipsis
Handy for animating the three periods after a string, i.e. "Loading..."
2023-05-05 14:15:12 -04:00
Christian Rocha 30c01cabdc chore: apply appropriate GoDoc syntax to deprecated items 2022-11-17 10:41:13 -05:00
Tom PayneandGitHub 72d87e4513 chore: Miscellaneous minor fixes (#243)
* chore: remove internal use of deprecated NewModel

* chore: miscellaneous comment fixes
2022-09-15 10:51:42 -04:00
7cc5786984 feat(spinners): Construct new spinners with WithSpinner + WithStyle options (#148)
* Add spinner.New test

Signed-off-by: Leandro López (inkel) <inkel.ar@gmail.com>

* Add spinner.Option type and spinner.WithSpinner option

Signed-off-by: Leandro López (inkel) <inkel.ar@gmail.com>

* Allow passing options in spinner.New

This doesn't break existing code as it uses variadic arguments, so
any existing code as the following should continue to work:

    s := spinner.New()
    s.spinner = spinner.Dot

This change allows for instead of those two lines, having a call:

   s := spinner.New(spinner.WithSpinner(spinner.Dot))

Signed-off-by: Leandro López (inkel) <inkel.ar@gmail.com>

* Add spinner.WithX option for each spinner.Spinner

Signed-off-by: Leandro López (inkel) <inkel.ar@gmail.com>

* Refactor spinner tests

Signed-off-by: Leandro López (inkel) <inkel.ar@gmail.com>

* Add spinner.WithStyle option function

Signed-off-by: Leandro López (inkel) <inkel.ar@gmail.com>

* refactor: remove With... Spinner aliases

Co-authored-by: Maas Lalani <maas@lalani.dev>
2022-07-01 11:31:26 -04:00
vzvu3k6kandGitHub 4d0a0ea9d8 docs(spinner): correct comment about internal ID (#171) 2022-06-21 09:17:48 -04:00
658a4febc7 feat: new Hamburger + Meter spinners (#172)
Co-authored-by: Maas Lalani <maas@lalani.dev>
2022-06-21 08:59:23 -04:00
Hironao OTSUBOandGitHub 54869f7a1d docs(spinner): remove obsolete comment (#168)
The doc for spinner.Model.Update is obsolete as per 35c3cd626d,
which made Update aware of Msg's type.
2022-06-10 10:03:55 -04:00
Christian Rocha 292a1dd7ba fix(spinner): remove unused member in model 2022-04-12 10:12:14 -04:00
Christian Rocha 430b7b5d36 Remove provisional spinner lifetime stuff
The design was overly complicated, especially for such subtle benefits.
2022-03-31 10:59:39 -04:00
Christian Rocha b35f96cd2d Deprecate NewModel() constructors; use New() instead 2022-01-11 11:26:13 -05:00
Christian Rocha e01ee1d17e Expose IDs on spinners and spinner tick messages 2022-01-10 14:52:35 -05:00
Christian Rocha e83c113d06 Add spinner.Model.Tick method, deprecate spinner.Tick method. 2022-01-10 14:52:35 -05:00
Christian Rocha 94b84b6120 Make spinners ignore tick messsages send by other spinners 2022-01-10 14:52:35 -05:00
Christian Rocha 4365990396 Fix typo in a spinner comment 2021-06-02 10:49:43 -04:00
Christian Rocha 0d5d7e5acd Remove deadcode + small comment on Lip Gloss 2021-04-13 17:09:23 -04:00
Christian Rocha 7242bbe8dc Spinner now uses Lip Gloss for styling 2021-04-13 17:09:23 -04:00
Christian Muehlhaeuser da9a4049de Mark innocuous numbers as nolint 2021-03-12 01:47:40 +01:00
Christian RochaandChristian Rocha 11f56f9b6b If using advanced settings, draw empty spinner when appropriate
When model.HideFor or model.MinimumLifetime is present, we won't draw
the spinner in cases where model.Visibe() returns false.
2020-12-11 19:37:37 -05:00
Christian RochaandChristian Rocha 3be2d0585b Prevent spinner from responding to extra, unintentional tick messages 2020-12-11 19:37:37 -05:00
Christian Rocha 37a85afcd1 Fix a typo in a comment 2020-12-10 11:36:22 -05:00
Christian RochaandChristian Rocha 9cb8e8d90a Remove spaces after emoji spinners 2020-11-11 15:39:42 -05:00
Christian RochaandChristian Rocha e6219572e5 Add points spinner 2020-11-11 15:39:42 -05:00
Christian RochaandChristian Rocha 81feaacf5b Remove bit8 spinner 2020-11-11 15:39:42 -05:00
Christian RochaandChristian Rocha 9a25d8b8b9 Add pulse spinner 2020-11-11 15:39:42 -05:00
Christian RochaandChristian Rocha e8e052c64b Add mini dot spinner 2020-11-11 15:39:42 -05:00
Christian RochaandChristian Rocha 3d7cd43046 Rework Spinner so that default spinners have FPS built-in 2020-11-11 15:39:42 -05:00
Christian RochaandChristian Rocha 9c38e101d2 Remove internal msg in spinner so all tick msgs can be caught externally 2020-11-10 15:44:42 -05:00
Christian RochaandChristian Rocha 9e1e435bba Make Spinner more idomatic Bubble Tea (per v0.12.x) 2020-11-08 21:20:15 -05:00
ololosha228andChristian Muehlhaeuser a07ab1d6af Added more spinners 2020-11-04 14:48:03 +01:00
Christian Rocha 959598c9aa Fix outdated comment 2020-10-02 13:03:04 -04:00
Christian Rocha 5f7c8b5375 Simplify the API around fine-grained spinner display rules 2020-08-25 09:36:43 -04:00
Christian Rocha 75df6b96a1 Don't return the current frame in TickMsg 2020-08-24 21:09:28 -04:00
Christian Rocha 084d0acefd Fix comments + minimum lifetime should work in conjunction with HideFor 2020-08-24 21:07:45 -04:00
Christian Rocha e8526ec4ef Optional fine-grained rules for the spinner about when and how long to show it 2020-08-24 20:03:54 -04:00
Christian Rocha ccf4c90b6b Rework spinner to allow for user-defined custom spinners 2020-07-14 18:21:48 -04:00
Christian Rocha 35c3cd626d Fix spinner frame skipping and remove custom message functionality 2020-06-22 14:49:21 -04:00
Christian Rocha 87c7cd778f Rename to Bubbles + copy over components from Bubble Tea + remove examples 2020-05-25 20:08:37 -04:00
Christian Rocha a72bf9128d Update spinner to use proper tea.Tick subscription 2020-05-11 17:33:28 -04:00
Christian Rocha da64445a0e Update subs for Tea v0.2.1. That is to say, remove the their arguments. 2020-05-04 18:54:26 -04:00
Christian Rocha 5d987f7933 Remove redundant type declaration 2020-04-22 14:29:58 -04:00
Christian Rocha eea5c2a32a Add color settings to spinner 2020-03-27 14:14:02 -04:00
Christian Rocha b4d35fd529 Add a dot spinner type 2020-02-12 17:45:15 -05:00
Christian Rocha 5c5cc7bb87 Prototype a simple spinner 2020-02-10 11:40:52 -05:00