Commit Graph

39 Commits

Author SHA1 Message Date
Jakub Sobon 5ac468c10a
Moving terminal, terminalapi and widgetapi to internal subdirectory.
And adding a README under internal.
2019-02-23 21:19:16 -05:00
Jakub Sobon 2ff1818c0e
Moving keyboard and mouse to internal. 2019-02-23 21:11:50 -05:00
Jakub Sobon 6c03991fb9
Moving draw and event to internal. 2019-02-23 21:10:51 -05:00
Jakub Sobon 7ee222ac58
Moving private libraries into internal subdirectory. 2019-02-23 21:09:38 -05:00
Jakub Sobon 0490734d1e
Running gofmt. 2019-02-23 00:42:47 -05:00
Jakub Sobon 22946f2f65
Allowing widgets to select the scope for mouse events too. 2019-02-23 00:41:58 -05:00
Jakub Sobon 495eaa4ee5
Merge pull request #146 from mum4k/widgets-global-keys
Allow widgets to subscribe to global keyboard events
2019-02-22 00:48:42 -05:00
Jakub Sobon 0df7387862
Widgets can now register for global keyboard events. 2019-02-22 00:33:55 -05:00
Jakub Sobon 793925feb8
Migrating all calls to the runewidth wrapper. 2019-02-21 23:24:42 -05:00
Jakub Sobon 38a2a36234
Adding Text Write option that atomically replaces the text content. 2019-02-15 00:40:15 -05:00
Jakub Sobon 2784a1c7a0
Constructor of Text now returns an error. 2019-02-15 00:20:20 -05:00
Jakub Sobon e44d70b568
Merge pull request #101 from mum4k/segment-display
Segment display
2019-02-06 23:46:50 -05:00
Jakub Sobon 38aae8e556
Switching text to attrrange. 2019-02-04 21:41:04 -05:00
Jakub Sobon 34a715fc1d
Fixing a comment. 2019-02-03 23:39:29 -05:00
Andrea Manzini ceae209ba2 cleanup lint issues 2019-01-19 16:16:19 +01:00
Jakub Sobon c18a940df4
Adding a demo of a more complete dashboard. 2019-01-15 22:40:44 -05:00
Jakub Sobon 964d676e31
Allowing container.Option to report an error. 2019-01-14 00:08:20 -05:00
Jakub Sobon 5d5c7c1e38
Adding missing licences. 2018-06-24 23:51:26 -04:00
Jakub Sobon 367af3f86d
Merge branch 'text-widget/5/widget' into text-widget/6/wide-runes 2018-05-27 16:21:14 +01:00
Jakub Sobon 126cb00247
Rename newText field to contentChanged. 2018-05-27 16:15:56 +01:00
Jakub Sobon 06097229a9
Merge branch 'text-widget/4/scroll-tracker' into text-widget/5/widget 2018-05-27 16:12:25 +01:00
Jakub Sobon 6ab8088f51
Improving comments to make the scroll.go file more understandable. 2018-05-27 16:11:18 +01:00
Jakub Sobon c2db521710
Merge branch 'text-widget/3/line-scanner' into text-widget/4/scroll-tracker 2018-05-27 15:51:25 +01:00
Jakub Sobon 39c624a84c
Making it more obvious what width in the test cases is.
- renaming it to cvsWidth.
- adding a comment explaining that it is the width of the canvas.
2018-05-27 15:49:13 +01:00
Jakub Sobon 929bf2b8fc
The text widget now supports full-width runes.
Refactoring the draw() implementation to make it more readable:
- taking out the line trimming logic.
- taking out the drawing of the scroll up/down markers.
2018-05-20 22:51:38 +01:00
Jakub Sobon ecb27cd1c5
Adding licence. 2018-05-14 22:45:40 +01:00
Jakub Sobon 4f65598b39 Merge branch 'text-widget/4/scroll-tracker' into text-widget/5/widget 2018-05-14 22:45:29 +01:00
Jakub Sobon a386289162
Adding licence. 2018-05-14 22:44:49 +01:00
Jakub Sobon 6bbd64a30d Merge branch 'text-widget/3/line-scanner' into text-widget/4/scroll-tracker 2018-05-14 22:44:41 +01:00
Jakub Sobon 2f210f3ab9
Adding licence. 2018-05-14 22:44:18 +01:00
Jakub Sobon d6cd0106fb Merge branch 'text-widget/2/write-options' into text-widget/3/line-scanner 2018-05-14 22:44:08 +01:00
Jakub Sobon a3dfd1a4a5
Adding licence. 2018-05-14 22:43:48 +01:00
Jakub Sobon d0ca7ec5f5 Merge branch 'text-widget/1/widget-options' into text-widget/2/write-options 2018-05-14 22:43:36 +01:00
Jakub Sobon d3db859678
Adding licence. 2018-05-14 22:42:39 +01:00
Jakub Sobon d6c153fbaf
Implementing the text widget.
And adding a demo.
2018-05-14 22:16:14 +01:00
Jakub Sobon 4c54b8a46e
Adding an object that tracks the scrolling state. 2018-05-14 22:13:16 +01:00
Jakub Sobon 7d14d2219f
Adding line scanner.
The line scanner identifies and counts lines in the input text and
performs wrapping if required.
2018-05-14 22:12:08 +01:00
Jakub Sobon e786777410
Defining options for text written to the widget.
Each set of options applies to a range of characters equal to the length
of the text added.

E.g. on write calls like:
Write("text", opts1)
Write("long text", opts2)

The two passed options will be stored as:
opts1 for byte range low:0, high:4
opts2 for byte range low:4, high:13

The text itself will be stored in a bytes.Buffer.
2018-05-14 22:08:53 +01:00
Jakub Sobon a824210882
Defining options for the text widget. 2018-05-14 22:07:04 +01:00