Skip to content

Commit

Permalink
Merge pull request #7 from SixofClubsss/dev
Browse files Browse the repository at this point in the history
v0.9.6
  • Loading branch information
SixofClubsss committed May 12, 2023
2 parents 5faf0b1 + 64b0186 commit 97d1348
Show file tree
Hide file tree
Showing 26 changed files with 1,721 additions and 1,104 deletions.
71 changes: 71 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Interact with a variety of different products and services on [Dero's](https://d
- [rpc](#rpc)
- [menu](#menu)
- [dwidget](#dwidget)
- [bundle](#bundle)
6. [Donations](#donations)
7. [Licensing](#licensing)

Expand Down Expand Up @@ -217,6 +218,76 @@ func main() {
w.ShowAndRun()
}
```
### bundle
The bundle package contains all dReams resources. Images, gifs and fonts can be imported as well as the two Dero styled base app themes for Fyne. This example starts a Fyne gui app with various widgets to show case both Dero themes and image imports from bundle.
```
package main
import (
"image/color"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget"
"github.com/SixofClubsss/dReams/bundle"
)
func main() {
// Name my app
app_tag := "My_app"
// Initialize app color to bundle var
bundle.AppColor = color.Black
// Initialize fyne app with Dero theme
a := app.New()
a.Settings().SetTheme(bundle.DeroTheme(bundle.AppColor))
// Initialize fyne window with size and icon from bundle package
w := a.NewWindow(app_tag)
w.SetIcon(bundle.ResourceBlueBadge3Png)
w.Resize(fyne.NewSize(300, 100))
w.SetMaster()
// Initialize fyne container and add some various widgets for viewing purposes
cont := container.NewVBox()
cont.Add(container.NewAdaptiveGrid(3, widget.NewLabel("Label"), widget.NewEntry(), widget.NewButton("Button", nil)))
cont.Add(container.NewAdaptiveGrid(3, widget.NewLabel("Label"), widget.NewCheck("Check", nil), widget.NewButton("Button", nil)))
cont.Add(widget.NewPasswordEntry())
cont.Add(widget.NewSlider(0, 100))
// Widget to change theme
change_theme := widget.NewRadioGroup([]string{"Dark", "Light"}, func(s string) {
switch s {
case "Dark":
bundle.AppColor = color.Black
case "Light":
bundle.AppColor = color.White
default:
}
a.Settings().SetTheme(bundle.DeroTheme(bundle.AppColor))
})
change_theme.Horizontal = true
cont.Add(container.NewCenter(change_theme))
// Add a image from bundle package
gnomon_img := canvas.NewImageFromResource(bundle.ResourceGnomoniconPng)
gnomon_img.SetMinSize(fyne.NewSize(45, 45))
cont.Add(container.NewCenter(gnomon_img))
// Adding last widget
select_entry := widget.NewSelect([]string{"Choice 1", "Choice 2", "Choice 3"}, nil)
cont.Add(select_entry)
// Place widget container and start app
w.SetContent(cont)
w.ShowAndRun()
}
```

## Donations
- **Dero Address**: dero1qyr8yjnu6cl2c5yqkls0hmxe6rry77kn24nmc5fje6hm9jltyvdd5qq4hn5pn
Expand Down
2 changes: 1 addition & 1 deletion baccarat/baccarat.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func BaccaratButtons(w fyne.Window) fyne.CanvasObject {
var searched string
search_entry := widget.NewEntry()
search_entry.SetPlaceHolder("TXID:")
search_button := widget.NewButton(" Search ", func() {
search_button := widget.NewButton(" Search ", func() {
txid := search_entry.Text
if len(txid) == 64 && txid != searched {
searched = txid
Expand Down
Loading

0 comments on commit 97d1348

Please sign in to comment.