-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme.go
More file actions
31 lines (25 loc) · 703 Bytes
/
theme.go
File metadata and controls
31 lines (25 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
"image/color"
)
type FlightControlTheme struct{}
func (t *FlightControlTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color {
return theme.DefaultTheme().Color(name, variant)
}
func (t *FlightControlTheme) Icon(name fyne.ThemeIconName) fyne.Resource {
return theme.DefaultTheme().Icon(name)
}
func (t *FlightControlTheme) Size(name fyne.ThemeSizeName) float32 {
if name == "text" {
if fyne.CurrentDevice().IsMobile() {
return 24
}
return 12
}
return theme.DefaultTheme().Size(name)
}
func (t *FlightControlTheme) Font(s fyne.TextStyle) fyne.Resource {
return theme.DefaultTheme().Font(s)
}