Commit Graph
100 Commits
Author SHA1 Message Date
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
Christian Rocha 68f11d0b63 Update termenv to 0.7.2 2020-08-22 11:24:06 -04:00
Christian Rocha d4a0ecd3ee Bump bubbletea dependency and set termenv dependency to v0.7.0 2020-08-20 13:31:31 -04:00
Christian Rocha dbd40713ce Remove extraneous methods 2020-07-29 20:04:09 -04:00
Christian Rocha 7fa53ea961 Link directly to example code and flesh out pagination component description 2020-07-29 16:38:59 -04:00
Christian Rocha 0cc5e71a63 Flesh out README and add Charm badge 2020-07-29 16:34:01 -04:00
Christian Rocha f11ca377f4 Add clipboard paste support to textarea 2020-07-23 11:53:58 -04:00
Christian Rocha 10022c964c Fix slice out of bounds errors that could happen when deleting text 2020-07-21 18:22:18 -04:00
Christian Rocha 5357dd61bd Fix bug where scroll wheel could create duplicate lines on top and bottom 2020-07-20 17:46:15 -04:00
Christian Rocha 5a26cb0d8e Use pgup/pgdown as default paginator keystrokes 2020-07-20 12:13:53 -04:00
Christian Rocha 88469a499e Tidy up the key case switch in viewport 2020-07-20 11:56:35 -04:00
Christian Rocha b130d96434 Add methods for jumping to the tom and bottom of the viewport 2020-07-17 19:22:08 -04:00
Christian Rocha 185a19e56f Fix cases where pager would add blank lines to bottom of document 2020-07-17 18:38:38 -04:00
Christian Rocha dbb1d93970 Remove redundant viewport commands 2020-07-17 18:22:51 -04:00
Christian Rocha 2f909886c1 Be more consistent with max() argument order 2020-07-17 18:13:48 -04:00
Christian Rocha 5720cfb35a Correct scroll percentage reporting 2020-07-17 18:13:05 -04:00
Christian Rocha 3c07b97d37 Correct typo, add potential TODO 2020-07-17 17:02:37 -04:00
Christian Rocha 9b3e5476c3 Update README a little. 2020-07-17 14:03:02 -04:00
Christian Rocha 74e84eca55 Bump Bubbletea dependency 2020-07-14 18:26:59 -04:00
Christian Rocha ccf4c90b6b Rework spinner to allow for user-defined custom spinners 2020-07-14 18:21:48 -04:00
Christian Rocha f341e3c896 Correct mouse wheel behavior 2020-06-23 13:10:50 -04:00
Christian Rocha c9196e5407 Add basic mouse wheel support to viewport 2020-06-23 12:00:17 -04:00
Christian Rocha f967f6a87f Fix a bug where placeholder text would not reappear post-input 2020-06-22 15:28:38 -04:00
Christian Rocha 35c3cd626d Fix spinner frame skipping and remove custom message functionality 2020-06-22 14:49:21 -04:00
Christian Rocha 2525319d72 Bump dependencies 2020-06-22 13:51:51 -04:00
Christian Rocha e9dd6b06e0 Fix duplicate character bug when deleting chars in long strings
If the string is longer than the width of the field and the horizontal
viewport (so to speak) was on the right edge, the last character would
repeat when deleting characters because the viewport offset wasn't being
corrected. This fixes that.
2020-06-20 23:34:19 -04:00
Christian Rocha 7cef3a6f59 Document comments 2020-06-20 13:59:13 -04:00
Christian Rocha 1cdc2045c7 Fix a potential out of bounds panic 2020-06-19 19:46:51 -04:00
Christian Rocha cc480dd2f3 Comments 2020-06-19 19:02:14 -04:00
Christian Rocha 0c1781fbb3 Clamp scroll percentage 2020-06-19 15:04:23 -04:00
Christian Rocha 5255143e87 Rework high performance half-view up/down 2020-06-19 13:23:14 -04:00
Christian Rocha 1629afe087 Rework high-performance pgup/pgdown 2020-06-19 12:20:35 -04:00
Christian Rocha da3150ded7 Rework high performance line-up/line-down 2020-06-19 11:51:44 -04:00
Christian Rocha b82cf5071d Send newlines instead of cursor-downs in performance viewport 2020-06-18 18:31:30 -04:00
Christian Rocha d095a6554c Retire the internal viewport renderer 2020-06-18 18:25:57 -04:00
Christian Rocha 34ac608122 Correct slice bounding 2020-06-18 16:29:05 -04:00
Christian Rocha 09ae5da7c3 Don't get/set size in viewport; that should happen in the parent 2020-06-18 14:14:21 -04:00
Christian Rocha 5572542e2e Add command to sync initial high performance view 2020-06-18 13:42:11 -04:00
Christian Rocha 3688351ddf Viewport now can use Bubble Tea high performance scroll renderer (ish) 2020-06-17 20:55:49 -04:00