Skip to content

Commit

Permalink
Fix more deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Aug 17, 2024
1 parent 53b4a5b commit b7f8882
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
11 changes: 7 additions & 4 deletions internal/ui/about.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ func (w *widgetPanel) showAbout() {
widget.NewLabelWithStyle("\nWith great thanks to our many kind contributors\n", fyne.TextAlignCenter, fyne.TextStyle{Italic: true}))
scroll := container.NewScroll(content)

bgColor := withAlpha(theme.BackgroundColor(), 0xe0)
shadowColor := withAlpha(theme.BackgroundColor(), 0x33)
themeBG := theme.Color(theme.ColorNameBackground)
bgColor := withAlpha(themeBG, 0xe0)
shadowColor := withAlpha(themeBG, 0x33)

underlay := canvas.NewImageFromResource(theme2.FyshOSLogo)
bg := canvas.NewRectangle(bgColor)
Expand All @@ -81,11 +82,13 @@ func (w *widgetPanel) showAbout() {
fyne.CurrentApp().Settings().AddChangeListener(listen)
go func() {
for range listen {
bgColor = withAlpha(theme.BackgroundColor(), 0xe0)
themeBG := theme.Color(theme.ColorNameBackground)

bgColor = withAlpha(themeBG, 0xe0)
bg.FillColor = bgColor
bg.Refresh()

shadowColor = withAlpha(theme.BackgroundColor(), 0x33)
shadowColor = withAlpha(themeBG, 0x33)
footerBG.FillColor = bgColor
footer.Refresh()
}
Expand Down
8 changes: 4 additions & 4 deletions internal/ui/bar.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (b *bar) append(object fyne.CanvasObject) {

// appendSeparator adds a separator between the default icons and the taskbar
func (b *bar) appendSeparator() {
b.separator = canvas.NewRectangle(theme.ForegroundColor())
b.separator = canvas.NewRectangle(theme.Color(theme.ColorNameForeground))
b.append(b.separator)
}

Expand Down Expand Up @@ -278,7 +278,7 @@ func (b *bar) CreateRenderer() fyne.WidgetRenderer {
if fynedesk.Instance().Settings().NarrowLeftLauncher() {
bg = canvas.NewRectangle(wmTheme.WidgetPanelBackground())
} else {
bg = canvas.NewLinearGradient(theme.BackgroundColor(), color.Transparent, 180)
bg = canvas.NewLinearGradient(theme.Color(theme.ColorNameBackground), color.Transparent, 180)
}
return &barRenderer{objects: b.children, background: bg, layout: newBarLayout(b), appBar: b}
}
Expand Down Expand Up @@ -335,10 +335,10 @@ func (b *barRenderer) Refresh() {
if fynedesk.Instance().Settings().NarrowLeftLauncher() {
b.background = canvas.NewRectangle(wmTheme.WidgetPanelBackground())
} else {
b.background = canvas.NewLinearGradient(theme.BackgroundColor(), color.Transparent, 180)
b.background = canvas.NewLinearGradient(theme.Color(theme.ColorNameBackground), color.Transparent, 180)
}
if b.appBar.separator != nil {
b.appBar.separator.FillColor = theme.ForegroundColor()
b.appBar.separator.FillColor = theme.Color(theme.ColorNameForeground)
}
b.objects = b.appBar.children
b.Layout(b.appBar.Size())
Expand Down
2 changes: 1 addition & 1 deletion internal/ui/bar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestAppBarBackground(t *testing.T) {
assert.Equal(t, wmTheme.NarrowBarWidth, bg.Size().Width)
} else {
assert.Equal(t, color.Transparent, bg.(*canvas.LinearGradient).EndColor)
assert.Equal(t, theme.BackgroundColor(), bg.(*canvas.LinearGradient).StartColor)
assert.Equal(t, theme.Color(theme.ColorNameBackground), bg.(*canvas.LinearGradient).StartColor)
assert.Equal(t, testBar.iconSize+theme.Padding()*2, bg.Size().Width)
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/ui/menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (w *widgetPanel) askLogout() {
nil, nil,
widget.NewLabel("Are you sure you want to log out?"))

r, g, b, _ := theme.OverlayBackgroundColor().RGBA()
r, g, b, _ := theme.Color(theme.ColorNameOverlayBackground).RGBA()
bgCol := &color.NRGBA{R: uint8(r), G: uint8(g), B: uint8(b), A: 230}

bg := canvas.NewRectangle(bgCol)
Expand Down

0 comments on commit b7f8882

Please sign in to comment.