Commit Graph
100 Commits
Author SHA1 Message Date
Christian Rocha b35f96cd2d Deprecate NewModel() constructors; use New() instead 2022-01-11 11:26:13 -05:00
Christian Rocha 9401ebbb83 Viewport New() is now optional to ease the upgrade process 2022-01-10 21:21:04 -05:00
Christian Rocha add13c8028 Add a lipgloss style to the viewport for borders, margins, and padding 2022-01-10 21:21:04 -05:00
Christian Rocha 4aed4e0a88 Viewport now has customizable keybindings 2022-01-10 21:21:04 -05:00
Christian Rocha 9c70b6a216 Bump bubbletea dep 2022-01-10 15:01:52 -05:00
Christian RochaandGitHub 9d74635ea3 Update footer image in README 2022-01-10 14:57:12 -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 RochaandGitHub f09987549a Various timer improvements (#83)
* Add IDs to timers
* Add IDs to timer-related messages
* Ignore messages from other timers
* Add `Timeout` property to `TickMsg`
* Add `Start()`, `Stop()`, and `Toggle()` commands to timer
* Add `Timedout()` method to timer model
* Add `Running()` method to timer model
2022-01-10 13:55:54 -05:00
Christian Rocha 7b20f4fe24 Expose stopwatch StartStopMsg and ResetMsg and bind them to IDs 2022-01-10 13:37:34 -05:00
Christian Rocha 86e0c53e88 Add support for multiple stopwatches
In short, stopwatches will now ignore messages sent by other
stopwatches.
2022-01-10 13:37:34 -05:00
Christian Rocha 8d3cfdf380 key.Matches now accepts multiple binding arguments 2022-01-10 12:32:37 -05:00
Christian Rocha 0ac5ecdf81 Fix bug where performance rendering could render one line too many 2021-09-17 16:25:25 -04:00
Christian Rocha 8c03905dbe Fix bug where viewport wouldn't render final lines
This previously went unnoticed because we all seemed to have newlines at
the end of our viewport input.

This update introduces the Model.SetYOffset method.
2021-09-17 16:25:25 -04:00
Christian Rocha da9248f877 Update progress bar description and example links 2021-09-07 14:31:40 -04:00
Christian Rocha b691d7f07e Progress bars now statisfy the tea.Model interface 2021-09-07 13:57:46 -04:00
Christian Rocha 8ad268837a Add image and example link for Help bubble 2021-09-07 13:16:26 -04:00
Christian Rocha 0f290114f5 Add mritd/bubbles to "additional bubbles" in the README 2021-09-02 16:39:17 -04:00
Christian Rocha 500d7989e1 Fix keybinding examples 2021-09-01 11:33:41 -04:00
Christian RochaandChristian Muehlhaeuser 0be588365e Add simple helper package for making user-definable keymappings and help bubble 2021-08-23 17:00:29 +02:00
Christian Rocha 4c32a64d65 Add info about promptkit to README 2021-08-02 12:23:25 -04:00
Christian Rocha e723cfd15e Add WithSpringOptions to customize spring in NewModel 2021-07-26 12:41:37 -04:00
Christian Rocha 90d8eaffeb Update progress bar with public harmonica release 2021-07-26 12:41:37 -04:00
Christian Rocha 202d5a9f9d Progress's NewModel no longer returns an error for better usability
To that end, bad hex colors also default to black. This is also how we
handle bad hex notation in Lip Gloss.
2021-07-26 12:41:37 -04:00
Christian Rocha 446433d680 Use Lip Gloss to style percentage in progress bubble 2021-07-26 12:41:37 -04:00
Christian Rocha 2cd3b16343 Use Harmonica to animate progress bar 2021-07-26 12:41:37 -04:00
Christian Rocha 5ae3b7b822 Update go-runewidth to v0.0.13 2021-07-26 12:41:37 -04:00
Christian Rocha 20ead8fb7d Progress can now animate itself 2021-07-26 12:41:37 -04:00
Christian Rocha d06aa4aa48 Ensure that textinputs can only receive their own blink messages 2021-06-02 10:49:43 -04:00
Christian Rocha 10962af2f2 Textinput's focus method now returns a command to initiate cursor blink 2021-06-02 10:49:43 -04:00
Christian Rocha 5082ae6f31 Add API for blink, static and hidden cursor modes to textinput
Closes #53.
2021-06-02 10:49:43 -04:00
Christian Rocha 4365990396 Fix typo in a spinner comment 2021-06-02 10:49:43 -04:00
Christian Rocha 1405b09ec8 Update footer in README for consistency with newer Charm repos 2021-06-02 10:49:43 -04:00
Christian Rocha 9449cc7e41 Don't allow word-based deletion when input is masked in textinput
alt+d and ctrl+w will now delete all the way to the beginning and end,
respectively, if EchoMode is not EchoNormal.
2021-04-26 12:03:57 -04:00
Christian Rocha 58a177394e Don't allow word-to-word movement when input is masked in textinput
When EchoMode is not set to EchoNormal, alt+left/alt+b and
alt+right/alt+b jumps to the beginning and the end, respectively, so as
not to reveal word breaks in the masked text.
2021-04-26 12:03:57 -04:00
Christian Rocha f016c31d83 Add method for returning cursor position in textinput
Previously, Cursor was a member on the model that did absolutely
nothing.
2021-04-26 12:03:57 -04:00
Christian Rocha 74436326b9 Public cursor movement functions no longer return values in textinput
Previously, textinput.SetCursor, textinput.CursotStart, and
textinput.CursorEnd returned bools used interally for managing cursor
blinking. Those methods have been replaced with private counterparts.
2021-04-26 12:03:57 -04:00
Christian Rocha 158097df66 Keep y-offset in bounds when setting content 2021-04-19 19:47:50 -04:00
Christian Rocha 0d5d7e5acd Remove deadcode + small comment on Lip Gloss 2021-04-13 17:09:23 -04:00
Christian Rocha ddd48d9ab7 TextInput now uses Lip Gloss for styling 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 Rocha c8f4855d20 Fix typo in README 2021-01-12 18:19:20 -05:00
Christian Rocha 43d43d14ae A external link to progress example and remove local example 2021-01-12 18:17:42 -05:00
Christian RochaandGitHub de359c53bb README: improve wording + image update for dark backgrounds 2021-01-12 17:53:56 -05:00
Christian RochaandGitHub c7d69b61f0 Add progressbar info and GIF to README 2021-01-12 17:27:14 -05: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 f9c79eef64 Slightly more subtle default gradient 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha c303de1e85 Replace "ramp" with "gradient" on exposed functions 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha 7e5ef42924 Add ability to style percentage readout 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha 79ca4d09d1 Fix doc comments and remove magic number 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha f48e53556a Return an error if we could not initialize a new gradient ramp 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha 5d6d8cb0fb Add functional argument for setting the width of the progress bar 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha 47b8d9c6a8 Doc comments, optimizations, and magic number removal 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha b78277e7ec Add progress bar example 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha 6a768905a6 Add initialization options for scaled ramps 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha 0f06d78b92 Support for solid (non-gradient) fills too 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha 1e16eca939 Set ramp in NewModel via functional argument 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha d81e5713d4 Cache termenv color profile lookup 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha b10dbcb4dd Add option to show percent 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha a2e0a2e72e Remove initial width argument; add default width 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha 3dea7d036e Reduce progress component to (more or less) a pure view function
We really only need the View function in this case since the progress
value will come from the program that implements this.
2020-12-01 17:03:48 -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 84f7b047bb Make Viewport more idomatic BubbleTea (per v0.12.x) 2020-11-08 21:20:15 -05:00
Christian RochaandChristian Rocha 9e1e435bba Make Spinner more idomatic Bubble Tea (per v0.12.x) 2020-11-08 21:20:15 -05:00
Christian RochaandChristian Rocha 0fd072ddcc Make Paginator more idomatic Bubble Tea (per v0.12.x) 2020-11-08 21:20:15 -05:00
Christian Rocha 8e49ee609e Bump Bubble Tea dependency to v0.12.2 2020-11-02 10:24:20 -05:00
Christian RochaandChristian Rocha d02641f6b5 Update textinput for multi-char (IME) input in Bubble Tea master 2020-11-01 09:11:18 -05:00
Christian Rocha 9b47f26bdd Doc and logic corrections per the linter 2020-10-28 21:27:15 -04:00
Christian Rocha 9c780011ff Underpinnings for always-on and always-hidden cursor modes 2020-10-28 21:27:15 -04:00
Christian Rocha 8148e61443 Correct ^F/^B keybindings for forward/back cursor movement 2020-10-28 21:27:15 -04:00
Christian Rocha ce7d8da084 Fix lock-up that could occur with cursor blinking
Note that to do this we've replaced the blink timer with a context.
2020-10-28 21:27:15 -04:00
Christian Rocha d14fdf585c Textinput Update and View functions are now methods on the model 2020-10-28 21:27:15 -04:00
Christian Rocha bf7719e6c1 Handle paste via command/message since it's IO 2020-10-28 21:27:15 -04:00
Christian Rocha 1b530b293c Reset blink timer when moving the cursor 2020-10-28 21:27:15 -04:00
Christian RochaandChristian Rocha 5dbcf95877 Fix situation where short viewports would panic (closes #20) 2020-10-25 15:21:49 -04:00
Christian RochaandChristian Rocha 703de11da4 Fix regression where cursor was misplaced after a paste 2020-10-24 19:51:13 -04:00
Christian RochaandChristian Rocha 03461d6804 Fix panic when pasting into a textinput with no char limit 2020-10-24 19:51:13 -04:00
Christian RochaandChristian Rocha bdd909a5d7 Textinput: bind home/end and fix behavior of delete key 2020-10-22 15:36:54 -04:00
Christian Rocha a498b857d6 Update paginator for bubbletea 0.12.0 2020-10-16 14:36:08 -04:00
Christian Rocha 82097a1c79 Remove unused function 2020-10-16 11:54:44 -04:00
Christian Rocha a8ec421800 Update bubbletea and termenv dependencies 2020-10-16 11:54:00 -04:00
Christian Rocha 9c10cd0586 Remove unused ErrMsg type from textinput module 2020-10-15 18:52:36 -04:00
Christian Rocha 154f3763f7 textinput.View can just accept a textinput.Model argument 2020-10-15 18:43:08 -04:00
Christian Rocha eff931bdea Remove replace directive for bubbletea in go.mod 2020-10-12 22:15:02 -04:00
Christian Rocha 0d7b3ed8e8 Fix URLs to Charm and Glow in README 2020-10-06 13:25:46 -04:00
Christian Rocha cbafae84f9 Update mouse wheel stuff in paginator per last-minute Bubble Tea API change 2020-10-06 12:29:18 -04: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