Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update README to reference the new hex widget #13

Merged
merged 5 commits into from May 10, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Expand Up @@ -51,6 +51,25 @@ tree.Sorter = func(u1, u2 fyne.URI) bool {
</p>


### 7-Segment ("Hex") Display

A skeuomorphic widget simulating a 7-segment "hex" display. Support setting
charlesdaniels marked this conversation as resolved.
Show resolved Hide resolved
digits by value, as well as directly controlling which segments are on or
off.

Check out the [demo](./cmd/hexwidget_demo/main.go) for an example of usage.


![](img/hexwidget_00abcdef.png)

![](img/hexwidget_12345678.png)

```go
h := widget.NewHexWidget()
// show the value 'F' on the display
h.Set(0xf)
```

## Validation

Community contributed validators.
Expand All @@ -65,3 +84,4 @@ for validation using an entropy system.
```go
pw := validation.NewPassword(70) // Minimum password entropy allowed defined as 70.
```

20 changes: 10 additions & 10 deletions cmd/hexwidget_demo/main.go
Expand Up @@ -6,7 +6,7 @@ import (
"fyne.io/fyne/v2/dialog"
"fyne.io/fyne/v2/widget"

"fyne.io/x/fyne/widget/hexwidget"
xwidget "fyne.io/x/fyne/widget"

"image/color"
"strconv"
Expand All @@ -15,16 +15,16 @@ import (
func main() {
app := app.New()

h1 := hexwidget.NewHexWidget()
h2 := hexwidget.NewHexWidget()
h3 := hexwidget.NewHexWidget()
h4 := hexwidget.NewHexWidget()
h5 := hexwidget.NewHexWidget()
h6 := hexwidget.NewHexWidget()
h7 := hexwidget.NewHexWidget()
h8 := hexwidget.NewHexWidget()
h1 := xwidget.NewHexWidget()
h2 := xwidget.NewHexWidget()
h3 := xwidget.NewHexWidget()
h4 := xwidget.NewHexWidget()
h5 := xwidget.NewHexWidget()
h6 := xwidget.NewHexWidget()
h7 := xwidget.NewHexWidget()
h8 := xwidget.NewHexWidget()

hexes := []*hexwidget.HexWidget{h1, h2, h3, h4, h5, h6, h7, h8}
hexes := []*xwidget.HexWidget{h1, h2, h3, h4, h5, h6, h7, h8}

e := widget.NewEntry()
e.PlaceHolder = "enter a 32-bit number"
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Expand Up @@ -7,8 +7,11 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3 h1:FDqhDm7pcsLhhWl1QtD8vlzI4mm59llRvNzrFg6/LAA=
github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3/go.mod h1:CzM2G82Q9BDUvMTGHnXf/6OExw/Dz2ivDj48nVg7Lg8=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fyne-io/mobile v0.1.3-0.20210318200029-09e9c4e13a8f h1:rguJ/t99j/6zRSFzsBKlsmmyl+vOvCeTJ+2uTBvuXFI=
github.com/fyne-io/mobile v0.1.3-0.20210318200029-09e9c4e13a8f/go.mod h1:/kOrWrZB6sasLbEy2JIvr4arEzQTXBTZGb3Y96yWbHY=
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw=
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210311203641-62640a716d48 h1:QrUfZrT8n72FUuiABt4tbu8PwDnOPAbnj3Mql1UhdRI=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210311203641-62640a716d48/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
Expand Down Expand Up @@ -59,6 +62,7 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666 h1:gVCS+QOncANNPlmlO1AhlU3oxs4V9z+gTtPwIk3p2N8=
golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
Expand Down
File renamed without changes
File renamed without changes
3 changes: 1 addition & 2 deletions widget/hexwidget/hexwidget.go → widget/hexwidget.go
@@ -1,5 +1,4 @@
// Package hexwidget implements a 7-segment style hexadecimal display
package hexwidget
package widget

import (
"image/color"
Expand Down
16 changes: 0 additions & 16 deletions widget/hexwidget/README.md

This file was deleted.