75 lines
2.3 KiB
Go
75 lines
2.3 KiB
Go
package theme
|
|
|
|
import (
|
|
"image/color"
|
|
|
|
"fyne.io/fyne/v2"
|
|
"fyne.io/fyne/v2/theme"
|
|
)
|
|
|
|
// Definiere unsere benutzerdefinierten Farben basierend auf dem Mock-up
|
|
var (
|
|
ColorSlate900 = color.NRGBA{R: 0x0f, G: 0x17, B: 0x2a, A: 0xff} // bg-slate-900
|
|
ColorSlate800 = color.NRGBA{R: 0x1e, G: 0x29, B: 0x3b, A: 0xff} // bg-slate-800
|
|
ColorSlate400 = color.NRGBA{R: 0x94, G: 0xa3, B: 0xb8, A: 0xff} // text-slate-400
|
|
ColorSlate200 = color.NRGBA{R: 0xe2, G: 0xe8, B: 0xf0, A: 0xff} // text-slate-200
|
|
ColorSky500 = color.NRGBA{R: 0x0e, G: 0xa5, B: 0xe9, A: 0xff} // bg-sky-500
|
|
ColorSky400 = color.NRGBA{R: 0x38, G: 0xbd, B: 0xf8, A: 0xff} // text-sky-400
|
|
ColorRed500 = color.NRGBA{R: 0xef, G: 0x44, B: 0x44, A: 0xff} // red-500
|
|
)
|
|
|
|
// KettlebellTheme ist unsere benutzerdefinierte Theme-Implementierung
|
|
type KettlebellTheme struct{}
|
|
|
|
func (t *KettlebellTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color {
|
|
switch name {
|
|
case theme.ColorNameBackground:
|
|
return ColorSlate900
|
|
case theme.ColorNameButton:
|
|
return ColorSlate800
|
|
case theme.ColorNameDisabledButton:
|
|
return ColorSlate800
|
|
case theme.ColorNamePrimary:
|
|
return ColorSky500
|
|
case theme.ColorNamePlaceHolder:
|
|
return ColorSlate400
|
|
case theme.ColorNameHover:
|
|
return color.NRGBA{R: 0x33, G: 0x41, B: 0x55, A: 0xff} // Slate 700
|
|
case theme.ColorNameForeground:
|
|
return ColorSlate200
|
|
case theme.ColorNameDisabled:
|
|
return ColorSlate400
|
|
case theme.ColorNameError:
|
|
return ColorRed500
|
|
case theme.ColorNameInputBackground:
|
|
return ColorSlate800
|
|
case theme.ColorNameSeparator:
|
|
return color.NRGBA{R: 0x33, G: 0x41, B: 0x55, A: 0xff} // Slate 700
|
|
default:
|
|
return theme.DefaultTheme().Color(name, variant)
|
|
}
|
|
}
|
|
|
|
func (t *KettlebellTheme) Icon(name fyne.ThemeIconName) fyne.Resource {
|
|
// Hier könnten wir benutzerdefinierte Icons laden, wenn nötig.
|
|
// Vorerst verwenden wir die Standard-Icons.
|
|
return theme.DefaultTheme().Icon(name)
|
|
}
|
|
|
|
func (t *KettlebellTheme) Font(style fyne.TextStyle) fyne.Resource {
|
|
// Hier könnten wir eine benutzerdefinierte Schriftart wie 'Inter' laden.
|
|
return theme.DefaultTheme().Font(style)
|
|
}
|
|
|
|
func (t *KettlebellTheme) Size(name fyne.ThemeSizeName) float32 {
|
|
switch name {
|
|
case theme.SizeNamePadding:
|
|
return 8
|
|
case theme.SizeNameText:
|
|
return 16
|
|
case theme.SizeNameHeadingText:
|
|
return 28
|
|
default:
|
|
return theme.DefaultTheme().Size(name)
|
|
}
|
|
}
|