Skip to content

Commit

Permalink
Remove gif animation
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikKalkoken committed Jun 18, 2024
1 parent a8d0e6e commit 149338c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 91 deletions.
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.22.2

require (
fyne.io/fyne/v2 v2.4.5
fyne.io/x/fyne v0.0.0-20240421102438-d5a080914907
github.com/JohannesKaufmann/html-to-markdown v1.6.0
github.com/PuerkitoBio/goquery v1.9.2
github.com/antihax/goesi v0.0.0-20240126031043-6c54d0cb7f95
Expand All @@ -28,7 +27,6 @@ require (
github.com/blend/go-sdk v1.20220411.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/kr/pretty v0.2.0 // indirect
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
)

require (
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ fyne.io/fyne/v2 v2.4.5 h1:W6jpAEmLoBbKyBB+EXqI7GMJ7kLgHQWCa0wZHUV2VfQ=
fyne.io/fyne/v2 v2.4.5/go.mod h1:SlOgbca0y80cRObu/JOhxIJdIgtoW7aCyqUVlTMgs0Y=
fyne.io/systray v1.10.1-0.20231115130155-104f5ef7839e h1:Hvs+kW2VwCzNToF3FmnIAzmivNgrclwPgoUdVSrjkP8=
fyne.io/systray v1.10.1-0.20231115130155-104f5ef7839e/go.mod h1:oM2AQqGJ1AMo4nNqZFYU8xYygSBZkW2hmdJ7n4yjedE=
fyne.io/x/fyne v0.0.0-20240421102438-d5a080914907 h1:Ajr8gCMkVv6f7H2IPviMjfZCq40/+HrgWhAh/ZUOm/k=
fyne.io/x/fyne v0.0.0-20240421102438-d5a080914907/go.mod h1:1pa3ZVIopRWNvfSG4ZrSkcZ3mJ8qoHPZv4PT8/zpn1o=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/JohannesKaufmann/html-to-markdown v1.6.0 h1:04VXMiE50YYfCfLboJCLcgqF5x+rHJnb1ssNmqpLH/k=
Expand Down Expand Up @@ -285,8 +283,6 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
Expand Down
74 changes: 16 additions & 58 deletions internal/app/character/charactermailupdate_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package character_test
import (
"context"
"fmt"
"net/http"
"testing"
"time"

Expand Down Expand Up @@ -47,7 +46,7 @@ func TestUpdateMail(t *testing.T) {
},
}
mailID := 7
labelIDs := []int32{16}
labelIDs := []int32{16, 32}
timestamp := "2015-09-30T16:07:00Z"
subject := "test"
dataHeader := []map[string]any{
Expand All @@ -64,14 +63,8 @@ func TestUpdateMail(t *testing.T) {
httpmock.RegisterResponder(
"GET",
fmt.Sprintf("https://esi.evetech.net/v1/characters/%d/mail/", c1.ID),
func(req *http.Request) (*http.Response, error) {
resp, err := httpmock.NewJsonResponse(200, dataHeader)
if err != nil {
return httpmock.NewStringResponse(500, ""), nil
}
return resp, nil
})

httpmock.NewJsonResponderOrPanic(200, dataHeader),
)
dataMail := map[string]any{
"body": "blah blah blah",
"from": e1.ID,
Expand All @@ -84,14 +77,8 @@ func TestUpdateMail(t *testing.T) {
httpmock.RegisterResponder(
"GET",
fmt.Sprintf("https://esi.evetech.net/v1/characters/%d/mail/%d/", c1.ID, mailID),
func(req *http.Request) (*http.Response, error) {
resp, err := httpmock.NewJsonResponse(200, dataMail)
if err != nil {
return httpmock.NewStringResponse(500, ""), nil
}
return resp, nil
})

httpmock.NewJsonResponderOrPanic(200, dataMail),
)
dataMailList := []map[string]any{
{
"mailing_list_id": m1.ID,
Expand All @@ -101,14 +88,8 @@ func TestUpdateMail(t *testing.T) {
httpmock.RegisterResponder(
"GET",
fmt.Sprintf("https://esi.evetech.net/v1/characters/%d/mail/lists/", c1.ID),
func(req *http.Request) (*http.Response, error) {
resp, err := httpmock.NewJsonResponse(200, dataMailList)
if err != nil {
return httpmock.NewStringResponse(500, ""), nil
}
return resp, nil
})

httpmock.NewJsonResponderOrPanic(200, dataMailList),
)
dataMailLabel := map[string]any{
"labels": []map[string]any{
{
Expand All @@ -129,13 +110,8 @@ func TestUpdateMail(t *testing.T) {
httpmock.RegisterResponder(
"GET",
fmt.Sprintf("https://esi.evetech.net/v3/characters/%d/mail/labels/", c1.ID),
func(req *http.Request) (*http.Response, error) {
resp, err := httpmock.NewJsonResponse(200, dataMailLabel)
if err != nil {
return httpmock.NewStringResponse(500, ""), nil
}
return resp, nil
})
httpmock.NewJsonResponderOrPanic(200, dataMailLabel),
)
// when
_, err := s.UpdateSectionIfNeeded(ctx, character.UpdateSectionParams{
CharacterID: c1.ID,
Expand Down Expand Up @@ -213,14 +189,8 @@ func TestUpdateMail(t *testing.T) {
httpmock.RegisterResponder(
"GET",
fmt.Sprintf("https://esi.evetech.net/v1/characters/%d/mail/lists/", c.ID),
func(req *http.Request) (*http.Response, error) {
resp, err := httpmock.NewJsonResponse(200, dataMailList)
if err != nil {
return httpmock.NewStringResponse(500, ""), nil
}
return resp, nil
})

httpmock.NewJsonResponderOrPanic(200, dataMailList),
)
dataMailLabel := map[string]any{
"labels": []map[string]any{
{
Expand All @@ -241,14 +211,8 @@ func TestUpdateMail(t *testing.T) {
httpmock.RegisterResponder(
"GET",
fmt.Sprintf("https://esi.evetech.net/v3/characters/%d/mail/labels/", c.ID),
func(req *http.Request) (*http.Response, error) {
resp, err := httpmock.NewJsonResponse(200, dataMailLabel)
if err != nil {
return httpmock.NewStringResponse(500, ""), nil
}
return resp, nil
})

httpmock.NewJsonResponderOrPanic(200, dataMailLabel),
)
recipients := []map[string]any{
{
"recipient_id": e2.ID,
Expand All @@ -273,14 +237,8 @@ func TestUpdateMail(t *testing.T) {
httpmock.RegisterResponder(
"GET",
fmt.Sprintf("https://esi.evetech.net/v1/characters/%d/mail/", c.ID),
func(req *http.Request) (*http.Response, error) {
resp, err := httpmock.NewJsonResponse(200, dataHeader)
if err != nil {
return httpmock.NewStringResponse(500, ""), nil
}
return resp, nil
})

httpmock.NewJsonResponderOrPanic(200, dataHeader),
)
// when
_, err := s.UpdateSectionIfNeeded(ctx, character.UpdateSectionParams{
CharacterID: c.ID,
Expand All @@ -302,7 +260,7 @@ func TestUpdateMail(t *testing.T) {
for _, l := range labels {
got.Add(l.LabelID)
}
want := set.NewFromSlice([]int32{32})
want := set.NewFromSlice([]int32{16, 32})
assert.Equal(t, want, got)
}
}
Expand Down
10 changes: 0 additions & 10 deletions internal/app/ui/resource.go

Large diffs are not rendered by default.

25 changes: 8 additions & 17 deletions internal/app/ui/statuswindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"fyne.io/fyne/v2/data/binding"
"fyne.io/fyne/v2/layout"
"fyne.io/fyne/v2/widget"
xwidget "fyne.io/x/fyne/widget"
"github.com/dustin/go-humanize"

"github.com/ErikKalkoken/evebuddy/internal/app"
Expand Down Expand Up @@ -201,19 +200,11 @@ func (a *statusWindow) makeSectionTable() *widget.GridWrap {
l := widget.NewGridWrapWithData(
a.sectionsData,
func() fyne.CanvasObject {
var r fyne.Resource
switch a.ui.themeGet() {
case app.ThemeDark:
r = resourceSpinner1s64pxDarkGif
default:
r = resourceSpinner1s64pxLightGif
}
gif, _ := xwidget.NewAnimatedGifFromResource(r)
gif.Stop()
gif.SetMinSize(fyne.Size{Width: 40, Height: 40})
pb := widget.NewProgressBarInfinite()
pb.Stop()
return container.NewHBox(
widget.NewLabel("Section name long"),
gif,
pb,
layout.NewSpacer(),
widget.NewLabel("Status XXXX"),
)
Expand All @@ -232,13 +223,13 @@ func (a *statusWindow) makeSectionTable() *widget.GridWrap {
status.Importance = i
status.Refresh()

gif := hbox.Objects[1].(*xwidget.AnimatedGif)
pb := hbox.Objects[1].(*widget.ProgressBarInfinite)
if cs.IsRunning() {
gif.Start()
gif.Show()
pb.Start()
pb.Show()
} else {
gif.Stop()
gif.Hide()
pb.Stop()
pb.Hide()
}
},
)
Expand Down
Binary file removed resources/ui/Spinner-1s-64px-dark.gif
Binary file not shown.
Binary file removed resources/ui/Spinner-1s-64px-light.gif
Binary file not shown.

0 comments on commit 149338c

Please sign in to comment.