Skip to content

Commit

Permalink
Moved the theme into the new ui folder
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianrudnik committed Oct 29, 2023
1 parent 4ecf4c7 commit d329103
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions service/theme.go → service/internal/ui/theme.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package main
package ui

import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
"image/color"
)

type ablegramTheme struct{}
type AblegramTheme struct{}

func (m ablegramTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color {
func (m AblegramTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color {
if name == theme.ColorNameBackground {
if variant == theme.VariantLight {
return color.White
Expand All @@ -19,15 +19,15 @@ func (m ablegramTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant
return theme.DefaultTheme().Color(name, variant)
}

func (m ablegramTheme) Font(name fyne.TextStyle) fyne.Resource {
func (m AblegramTheme) Font(name fyne.TextStyle) fyne.Resource {
return theme.DefaultTheme().Font(name)
}

func (m ablegramTheme) Icon(name fyne.ThemeIconName) fyne.Resource {
func (m AblegramTheme) Icon(name fyne.ThemeIconName) fyne.Resource {
return theme.DefaultTheme().Icon(name)
}

func (m ablegramTheme) Size(name fyne.ThemeSizeName) float32 {
func (m AblegramTheme) Size(name fyne.ThemeSizeName) float32 {
if name == theme.SizeNamePadding {
return 14
}
Expand Down
2 changes: 1 addition & 1 deletion service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func main() {
// Define a clean theme

a := app.New()
a.Settings().SetTheme(&ablegramTheme{})
a.Settings().SetTheme(&ui.AblegramTheme{})
a.SetIcon(resourceIconPng)
w := a.NewWindow("Ablegram")
w.CenterOnScreen()
Expand Down

0 comments on commit d329103

Please sign in to comment.