Skip to content

Commit

Permalink
remove redundant CenterPad layout
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed May 25, 2024
1 parent 819f42d commit ceed42d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 47 deletions.
3 changes: 1 addition & 2 deletions ui/dialogs/aboutdialog.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"net/url"

"github.com/dweymouth/supersonic/res"
"github.com/dweymouth/supersonic/ui/layouts"

"fyne.io/fyne/v2"
"fyne.io/fyne/v2/canvas"
Expand Down Expand Up @@ -75,7 +74,7 @@ func (a *AboutDialog) buildMainTabContainer(version string) *fyne.Container {
widget.NewHyperlink("Support the project", kofiUrl)),
)

return container.New(&layouts.CenterPadLayout{PadTopBottom: 10},
return container.New(&layout.CustomPaddedLayout{TopPadding: 10, BottomPadding: 10},
container.NewVBox(iconImage,
container.New(layout.NewCustomPaddedVBoxLayout(theme.Padding()-10), title, versionLbl, copyright, license, githubKofi)))
}
Expand Down
39 changes: 0 additions & 39 deletions ui/layouts/centerpadlayout.go

This file was deleted.

3 changes: 1 addition & 2 deletions ui/widgets/gridviewitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"slices"

"github.com/dweymouth/supersonic/res"
"github.com/dweymouth/supersonic/ui/layouts"
"github.com/dweymouth/supersonic/ui/util"

"fyne.io/fyne/v2"
Expand Down Expand Up @@ -201,7 +200,7 @@ func (g *GridViewItem) createContainer() {
g.focusRect.StrokeWidth = 3
coverStack := container.NewStack(g.Cover, g.focusRect)
c := container.New(layout.NewCustomPaddedVBoxLayout(theme.Padding()-5), coverStack, info)
pad := &layouts.CenterPadLayout{PadLeftRight: 20, PadTopBottom: 10}
pad := layout.NewCustomPaddedLayout(10, 10, 20, 20)
g.container = container.New(pad, c)
}

Expand Down
6 changes: 2 additions & 4 deletions ui/widgets/loadingdots.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/layout"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
"github.com/dweymouth/supersonic/ui/layouts"
)

type LoadingDots struct {
Expand Down Expand Up @@ -92,9 +92,7 @@ func (l *LoadingDots) doTick(foreground, disabled color.Color) {

func (l *LoadingDots) CreateRenderer() fyne.WidgetRenderer {
if l.container == nil {
layout := &layouts.CenterPadLayout{
PadLeftRight: 3,
}
layout := layout.NewCustomPaddedLayout(0, 0, 3, 3)
l.container = container.NewHBox(
container.New(layout, &l.dots[0]),
container.New(layout, &l.dots[1]),
Expand Down

0 comments on commit ceed42d

Please sign in to comment.