Skip to content

Commit

Permalink
Merge pull request #288 from mum4k/release-0-14
Browse files Browse the repository at this point in the history
Releasing Termdash v0.14.
  • Loading branch information
mum4k authored Dec 30, 2020
2 parents fbd21e7 + 54c48db commit d2b202a
Show file tree
Hide file tree
Showing 44 changed files with 4,678 additions and 345 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Exclude MacOS attribute files.
.DS_Store

# Exclude IDE files.
.idea/
73 changes: 72 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,76 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.14.0] - 30-Dec-2020

### Breaking API changes

- The `widgetapi.Widget.Keyboard` and `widgetapi.Widget.Mouse` methods now
accepts a second argument which provides widgets with additional metadata.
All widgets implemented outside of the `termdash` repository will need to be
updated similarly to the `Barchart` example below. Change the original method
signatures:
```go
func (*BarChart) Keyboard(k *terminalapi.Keyboard) error { ... }

func (*BarChart) Mouse(m *terminalapi.Mouse) error { ... }

```

By adding the new `*widgetapi.EventMeta` argument as follows:
```go
func (*BarChart) Keyboard(k *terminalapi.Keyboard, meta *widgetapi.EventMeta) error { ... }
func (*BarChart) Mouse(m *terminalapi.Mouse, meta *widgetapi.EventMeta) error { ... }
```

### Fixed

- `termdash` no longer crashes when `tcell` is used and the terminal window
downsizes while content is being drawn.

### Added

#### Text input form functionality with keyboard navigation

- added a new `formdemo` that demonstrates a text input form with keyboard
navigation.

#### Infrastructure changes

- `container` now allows users to configure keyboard keys that move focus to
the next or the previous container.
- containers can request to be skipped when focus is moved using keyboard keys.
- containers can register into separate focus groups and specific keyboard keys
can be configured to move the focus within each focus group.
- widgets can now request keyboard events exclusively when focused.
- users can now set a `container` as focused using the new `container.Focused`
option.

#### Updates to the `button` widget

- the `button` widget allows users to specify multiple trigger keys.
- the `button` widget now supports different keys for the global and focused
scope.
- the `button` widget can now be drawn without the shadow or the press
animation.
- the `button` widget can now be drawn without horizontal padding around its
text.
- the `button` widget now allows specifying cell options for each cell of the
displayed text. Separate cell options can be specified for each of button's
main states (up, focused and up, down).
- the `button` widget allows specifying separate fill color values for each of
its main states (up, focused and up, down).
- the `button` widget now has a method `SetCallback` that allows updating the
callback function on an existing `button` instance.
#### Updates to the `textinput` widget
- the `textinput` widget can now be configured to request keyboard events
exclusively when focused.
- the `textinput` widget can now be initialized with a default text in the
input box.
## [0.13.0] - 17-Nov-2020
### Added
Expand Down Expand Up @@ -369,7 +439,8 @@ identifiers shouldn't be used externally.
- The Gauge widget.
- The Text widget.

[unreleased]: https://github.com/mum4k/termdash/compare/v0.13.0...devel
[unreleased]: https://github.com/mum4k/termdash/compare/v0.14.0...devel
[0.14.0]: https://github.com/mum4k/termdash/compare/v0.13.0...v0.14.0
[0.13.0]: https://github.com/mum4k/termdash/compare/v0.12.2...v0.13.0
[0.12.2]: https://github.com/mum4k/termdash/compare/v0.12.1...v0.12.2
[0.12.1]: https://github.com/mum4k/termdash/compare/v0.12.0...v0.12.1
Expand Down
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ To install this library, run the following:

```go
go get -u github.com/mum4k/termdash
cd github.com/mum4k/termdash
```

# Usage
Expand All @@ -63,7 +64,7 @@ The usage of most of these elements is demonstrated in
[termdashdemo.go](termdashdemo/termdashdemo.go). To execute the demo:

```go
go run github.com/mum4k/termdash/termdashdemo/termdashdemo.go
go run termdashdemo/termdashdemo.go
```

# Documentation
Expand All @@ -80,7 +81,7 @@ Run the
[buttondemo](widgets/button/buttondemo/buttondemo.go).

```go
go run github.com/mum4k/termdash/widgets/button/buttondemo/buttondemo.go
go run widgets/button/buttondemo/buttondemo.go
```

[<img src="./doc/images/buttondemo.gif" alt="buttondemo" type="image/gif" width="50%">](widgets/button/buttondemo/buttondemo.go)
Expand All @@ -92,18 +93,26 @@ submitting text data. Run the
[textinputdemo](widgets/textinput/textinputdemo/textinputdemo.go).

```go
go run github.com/mum4k/termdash/widgets/textinput/textinputdemo/textinputdemo.go
go run widgets/textinput/textinputdemo/textinputdemo.go
```

[<img src="./doc/images/textinputdemo.gif" alt="textinputdemo" type="image/gif" width="80%">](widgets/textinput/textinputdemo/textinputdemo.go)

Can be used to create text input forms that support keyboard navigation:

```go
go run widgets/textinput/formdemo/formdemo.go
```

[<img src="./doc/images/formdemo.gif" alt="formdemo" type="image/gif" width="50%">](widgets/textinput/formdemo/formdemo.go)

## The Gauge

Displays the progress of an operation. Run the
[gaugedemo](widgets/gauge/gaugedemo/gaugedemo.go).

```go
go run github.com/mum4k/termdash/widgets/gauge/gaugedemo/gaugedemo.go
go run widgets/gauge/gaugedemo/gaugedemo.go
```

[<img src="./doc/images/gaugedemo.gif" alt="gaugedemo" type="image/gif">](widgets/gauge/gaugedemo/gaugedemo.go)
Expand All @@ -114,7 +123,7 @@ Visualizes progress of an operation as a partial or a complete donut. Run the
[donutdemo](widgets/donut/donutdemo/donutdemo.go).

```go
go run github.com/mum4k/termdash/widgets/donut/donutdemo/donutdemo.go
go run widgets/donut/donutdemo/donutdemo.go
```

[<img src="./doc/images/donutdemo.gif" alt="donutdemo" type="image/gif">](widgets/donut/donutdemo/donutdemo.go)
Expand All @@ -125,7 +134,7 @@ Displays text content, supports trimming and scrolling of content. Run the
[textdemo](widgets/text/textdemo/textdemo.go).

```go
go run github.com/mum4k/termdash/widgets/text/textdemo/textdemo.go
go run widgets/text/textdemo/textdemo.go
```

[<img src="./doc/images/textdemo.gif" alt="textdemo" type="image/gif">](widgets/text/textdemo/textdemo.go)
Expand All @@ -137,7 +146,7 @@ sub-cell height. Run the
[sparklinedemo](widgets/sparkline/sparklinedemo/sparklinedemo.go).

```go
go run github.com/mum4k/termdash/widgets/sparkline/sparklinedemo/sparklinedemo.go
go run widgets/sparkline/sparklinedemo/sparklinedemo.go
```

[<img src="./doc/images/sparklinedemo.gif" alt="sparklinedemo" type="image/gif" width="50%">](widgets/sparkline/sparklinedemo/sparklinedemo.go)
Expand All @@ -148,7 +157,7 @@ Displays multiple bars showing relative ratios of values. Run the
[barchartdemo](widgets/barchart/barchartdemo/barchartdemo.go).

```go
go run github.com/mum4k/termdash/widgets/barchart/barchartdemo/barchartdemo.go
go run widgets/barchart/barchartdemo/barchartdemo.go
```

[<img src="./doc/images/barchartdemo.gif" alt="barchartdemo" type="image/gif" width="50%">](widgets/barchart/barchartdemo/barchartdemo.go)
Expand All @@ -160,7 +169,7 @@ events. Run the
[linechartdemo](widgets/linechart/linechartdemo/linechartdemo.go).

```go
go run github.com/mum4k/termdash/widgets/linechart/linechartdemo/linechartdemo.go
go run widgets/linechart/linechartdemo/linechartdemo.go
```

[<img src="./doc/images/linechartdemo.gif" alt="linechartdemo" type="image/gif" width="70%">](widgets/linechart/linechartdemo/linechartdemo.go)
Expand All @@ -171,7 +180,7 @@ Displays text by simulating a 16-segment display. Run the
[segmentdisplaydemo](widgets/segmentdisplay/segmentdisplaydemo/segmentdisplaydemo.go).

```go
go run github.com/mum4k/termdash/widgets/segmentdisplay/segmentdisplaydemo/segmentdisplaydemo.go
go run widgets/segmentdisplay/segmentdisplaydemo/segmentdisplaydemo.go
```

[<img src="./doc/images/segmentdisplaydemo.gif" alt="segmentdisplaydemo" type="image/gif">](widgets/segmentdisplay/segmentdisplaydemo/segmentdisplaydemo.go)
Expand Down
Loading

0 comments on commit d2b202a

Please sign in to comment.