This commit is contained in:
unknown committed 2019-12-16 10:43:46 +08:00
1 parent d930d9f003
commit 90ff08ed98
13 files changed
+877

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
// **** THIS FILE IS AUTO-GENERATED, PLEASE DO NOT EDIT IT **** //
package data
import "fyne.io/fyne"
var fynescenedark = &fyne.StaticResource{
StaticName: "fyne_scene_dark.png",
StaticContent: []byte{
137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 1, 201, 0, 0, 1, 79, 8, 6, 0, 0, 0, 38, 214, 53, 180, 0, 0, 0, 1, 115, 82, 71, 66, 0, 174, 206, 28, 233, 0, 0, 0, 150, 101, 88, 73, 102, 77, 77, 0, 42, 0, 0, 0, 8, 0, 5, 1, 18, 0, 3, 0, 0, 0, 1, 0, 1, 0, 0, 1, 26, 0, 5, 0, 0, 0, 1, 0, 0, 0, 74, 1, 27, 0, 5, 0, 0, 0, 1, 0, 0, 0, 82, 1, 49, 0, 2, 0, 0, 0, 17, 0, 0, 0, 90, 135, 105, 0, 4, 0, 0, 0, 1, 0, 0, 0, 108, 0, 0, 0, 0, 0, 0, 0, 120, 0, 0, 0, 1, 0, 0, 0, 120, 0, 0, 0, 1, 119, 119, 119, 46, 105, 110, 107, 115, 99, 97, 112, 101, 46, 111, 114, 103, 0, 0, 0, 3, 160, 1, 0, 3, 0, 0, 0, 1, 0, 1, 0, 0, 160, 2, 0, 4, 0, 0, 0, 1, 0, 0, 1, 201, 160, 3, 0, 4, 0, 0, 0, 1, 0, 0, 1, 79, 0, 0, 0, 0, 52, 31, 119, 147, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 18, 116, 0, 0, 18, 116, 1, 222, 102, 31, 120, 0, 0, 1, 203, 105, 84, 88, 116, 88, 77, 76, 58, 99, 111, 109, 46, 97, 100, 111, 98, 101, 46, 120, 109, 112, 0, 0, 0, 0, 0, 60, 120, 58, 120, 109, 112, 109, 101, 116, 97, 32, 120, 109, 108, 110, 115, 58, 120, 61, 34, 97, 100, 111, 98, 101, 58, 110, 115, 58, 109, 101, 116, 97, 47, 34, 32, 120, 58, 120, 109, 112, 116, 107, 61, 34, 88, 77, 80, 32, 67, 111, 114, 101, 32, 53, 46, 52, 46, 48, 34, 62, 10, 32, 32, 32, 60, 114, 100, 102, 58, 82, 68, 70, 32, 120, 109, 108, 110, 115, 58, 114, 100, 102, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 49, 57, 57, 57, 47, 48, 50, 47, 50, 50, 45, 114, 100, 102, 45, 115, 121, 110, 116, 97, 120, 45, 110, 115, 35, 34, 62, 10, 32, 32, 32, 32, 32, 32, 60, 114, 100, 102, 58, 68, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 32, 114, 100, 102, 58, 97, 98, 111, 117, 116, 61, 34, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 120, 109, 108, 110, 115, 58, 120, 109, 112, 61, 34, 104, 116, 116, 112, 58, 47, 47, 110, 115, 46, 97, 100, 111, 98, 101, 46, 99, 111, 109, 47, 120, 97, 112, 47, 49, 46, 48, 47, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 120, 109, 108, 110, 115, 58, 116, 105, 102, 102, 61, 34, 104, 116, 116, 112, 58, 47, 47, 110, 115, 46, 97, 100, 111, 98, 101, 46, 99, 111, 109, 47, 116, 105, 102, 102, 47, 49, 46, 48, 47, 34, 62, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 60, 120, 109, 112, 58, 67, 114, 101, 97, 116, 111, 114, 84, 111, 111, 108, 62, 119, 119, 119, 46, 105, 110, 107, 115, 99, 97, 112, 101, 46, 111, 114, 103, 60, 47, 120, 109, 112, 58, 67, 114, 101, 97, 116, 111, 114, 84, 111, 111, 108, 62, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 60, 116, 105, 102, 102, 58, 79, 114, 105, 101, 110, 116, 97, 116, 105, 111, 110, 62, 49, 60, 47, 116, 105, 102, 102, 58, 79, 114, 105, 101, 110, 116, 97, 116, 105, 111, 110, 62, 10, 32, 32, 32, 32, 32, 32, 60, 47, 114, 100, 102, 58, 68, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 62, 10, 32, 32, 32, 60, 47, 114, 100, 102, 58, 82, 68, 70, 62, 10, 60, 47, 120, 58, 120, 109, 112, 109, 101, 116, 97, 62, 10, 24, 203, 85, 88, 0, 0, 163, 196, 73, 68, 65, 84, 120, 218, 236, 93, 7, 124, 20, 69, 251, 62, 154, 88, 63, 253, 252, 44, 127, 123, 239, 138, 5, 20, 129, 16, 58, 82, 44, 32, 32, 189, 215, 16, 16, 66, 239, 6, 164, 131, 32, 69, 148, 222, 68, 16, 164, 73, 239, 72, 239, 189, 247, 78, 32, 189, 222, 237, 109, 153, 255, 188, 115, 51, 199, 176, 94, 114, 151, 100, 47, 112, 199, 251, 252, 126, 227, 197, 144, 219, 219, 155, 221, 157, 103, 222, 246, 188, 54, 27, 2, 129, 64, 220, 33, 16, 66, 114, 209, 145, 143, 142, 252, 116, 220, 71, 71, 110, 47, 127, 251, 56, 29, 111, 208, 81, 140, 142, 234, 116, 180, 166, 163, 47, 29, 227, 232, 152, 77, 199, 74, 58, 182, 210, 177, 159, 142, 147, 116, 92, 162, 35, 150, 142, 84, 58, 20, 58, 52, 58, 116, 254, 115, 10, 29, 209, 116, 92, 160, 227, 40, 29, 123, 232, 216, 64, 199, 98, 58, 166, 209, 241, 19, 29, 61, 232, 104, 74, 199, 87, 116, 124, 206, 63, 251, 81, 58, 242, 192, 57, 227, 21, 68, 32, 16, 8, 132, 213, 196, 152, 155, 19, 226, 125, 233, 252, 59, 252, 219, 43, 116, 148, 161, 35, 140, 147, 213, 223, 156, 248, 162, 232, 80, 201, 157, 3, 144, 109, 28, 39, 223, 138, 252, 124, 243, 224, 85, 69, 32, 16, 8, 68, 86, 45, 197, 92, 220, 242, 202, 235, 201, 82, 164, 191, 123, 158, 142, 202, 116, 244, 161, 227, 47, 58, 142, 209, 145, 236, 133, 172, 12, 78, 150, 138, 105, 56, 249, 80, 37, 171, 81, 231, 127, 111, 120, 56, 134, 206, 255, 78, 227, 239, 113, 74, 199, 114, 240, 225, 228, 255, 174, 72, 239, 13, 147, 191, 35, 94, 105, 4, 2, 129, 64, 100, 134, 28, 243, 112, 55, 106, 30, 15, 255, 246, 28, 119, 149, 142, 166, 99, 55, 29, 73, 25, 144, 161, 42, 17, 150, 34, 145, 159, 145, 131, 214, 163, 46, 17, 228, 121, 58, 62, 64, 130, 68, 32, 16, 8, 68, 86, 172, 70, 112, 149, 230, 51, 253, 30, 126, 247, 25, 29, 189, 233, 216, 204, 99, 129, 233, 89, 134, 178, 37, 168, 231, 48, 25, 154, 207, 135, 72, 164, 12, 88, 67, 199, 127, 248, 119, 202, 159, 81, 252, 20, 129, 64, 32, 16, 8, 51, 57, 230, 146, 126, 7, 36, 82, 138, 199, 19, 143, 167, 99, 33, 202, 46, 81, 227, 14, 18, 98, 122, 112, 74, 63, 255, 36, 147, 62, 94, 117, 4, 2, 129, 64, 120, 35, 70, 72, 192, 201, 107, 250,Line truncated
var fynescenelight = &fyne.StaticResource{
StaticName: "fyne_scene_light.png",
StaticContent: []byte{
137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 1, 201, 0, 0, 1, 79, 8, 6, 0, 0, 0, 38, 214, 53, 180, 0, 0, 0, 1, 115, 82, 71, 66, 0, 174, 206, 28, 233, 0, 0, 0, 150, 101, 88, 73, 102, 77, 77, 0, 42, 0, 0, 0, 8, 0, 5, 1, 18, 0, 3, 0, 0, 0, 1, 0, 1, 0, 0, 1, 26, 0, 5, 0, 0, 0, 1, 0, 0, 0, 74, 1, 27, 0, 5, 0, 0, 0, 1, 0, 0, 0, 82, 1, 49, 0, 2, 0, 0, 0, 17, 0, 0, 0, 90, 135, 105, 0, 4, 0, 0, 0, 1, 0, 0, 0, 108, 0, 0, 0, 0, 0, 0, 0, 120, 0, 0, 0, 1, 0, 0, 0, 120, 0, 0, 0, 1, 119, 119, 119, 46, 105, 110, 107, 115, 99, 97, 112, 101, 46, 111, 114, 103, 0, 0, 0, 3, 160, 1, 0, 3, 0, 0, 0, 1, 0, 1, 0, 0, 160, 2, 0, 4, 0, 0, 0, 1, 0, 0, 1, 201, 160, 3, 0, 4, 0, 0, 0, 1, 0, 0, 1, 79, 0, 0, 0, 0, 52, 31, 119, 147, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 18, 116, 0, 0, 18, 116, 1, 222, 102, 31, 120, 0, 0, 1, 203, 105, 84, 88, 116, 88, 77, 76, 58, 99, 111, 109, 46, 97, 100, 111, 98, 101, 46, 120, 109, 112, 0, 0, 0, 0, 0, 60, 120, 58, 120, 109, 112, 109, 101, 116, 97, 32, 120, 109, 108, 110, 115, 58, 120, 61, 34, 97, 100, 111, 98, 101, 58, 110, 115, 58, 109, 101, 116, 97, 47, 34, 32, 120, 58, 120, 109, 112, 116, 107, 61, 34, 88, 77, 80, 32, 67, 111, 114, 101, 32, 53, 46, 52, 46, 48, 34, 62, 10, 32, 32, 32, 60, 114, 100, 102, 58, 82, 68, 70, 32, 120, 109, 108, 110, 115, 58, 114, 100, 102, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 49, 57, 57, 57, 47, 48, 50, 47, 50, 50, 45, 114, 100, 102, 45, 115, 121, 110, 116, 97, 120, 45, 110, 115, 35, 34, 62, 10, 32, 32, 32, 32, 32, 32, 60, 114, 100, 102, 58, 68, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 32, 114, 100, 102, 58, 97, 98, 111, 117, 116, 61, 34, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 120, 109, 108, 110, 115, 58, 120, 109, 112, 61, 34, 104, 116, 116, 112, 58, 47, 47, 110, 115, 46, 97, 100, 111, 98, 101, 46, 99, 111, 109, 47, 120, 97, 112, 47, 49, 46, 48, 47, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 120, 109, 108, 110, 115, 58, 116, 105, 102, 102, 61, 34, 104, 116, 116, 112, 58, 47, 47, 110, 115, 46, 97, 100, 111, 98, 101, 46, 99, 111, 109, 47, 116, 105, 102, 102, 47, 49, 46, 48, 47, 34, 62, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 60, 120, 109, 112, 58, 67, 114, 101, 97, 116, 111, 114, 84, 111, 111, 108, 62, 119, 119, 119, 46, 105, 110, 107, 115, 99, 97, 112, 101, 46, 111, 114, 103, 60, 47, 120, 109, 112, 58, 67, 114, 101, 97, 116, 111, 114, 84, 111, 111, 108, 62, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 60, 116, 105, 102, 102, 58, 79, 114, 105, 101, 110, 116, 97, 116, 105, 111, 110, 62, 49, 60, 47, 116, 105, 102, 102, 58, 79, 114, 105, 101, 110, 116, 97, 116, 105, 111, 110, 62, 10, 32, 32, 32, 32, 32, 32, 60, 47, 114, 100, 102, 58, 68, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 62, 10, 32, 32, 32, 60, 47, 114, 100, 102, 58, 82, 68, 70, 62, 10, 60, 47, 120, 58, 120, 109, 112, 109, 101, 116, 97, 62, 10, 24, 203, 85, 88, 0, 0, 160, 86, 73, 68, 65, 84, 120, 218, 236, 125, 7, 152, 28, 89, 121, 237, 40, 108, 208, 42, 167, 201, 221, 85, 93, 85, 157, 195, 116, 79, 206, 26, 173, 178, 180, 74, 43, 141, 114, 206, 57, 172, 36, 150, 93, 130, 215, 126, 126, 14, 96, 63, 12, 216, 60, 112, 224, 225, 128, 177, 1, 155, 140, 201, 24, 131, 31, 54, 193, 192, 51, 209, 54, 94, 88, 50, 44, 11, 108, 82, 231, 122, 255, 185, 93, 213, 83, 211, 234, 153, 233, 158, 169, 25, 105, 90, 255, 249, 190, 187, 163, 149, 122, 170, 171, 110, 85, 221, 115, 255, 116, 254, 170, 42, 6, 131, 193, 184, 125, 152, 209, 210, 210, 114, 143, 166, 105, 247, 5, 131, 193, 123, 233, 255, 103, 142, 246, 217, 198, 198, 198, 37, 138, 162, 184, 85, 85, 237, 113, 185, 92, 59, 233, 207, 231, 104, 252, 186, 44, 203, 111, 160, 159, 111, 163, 191, 251, 16, 253, 252, 103, 250, 249, 37, 26, 223, 162, 241, 20, 141, 159, 211, 120, 129, 70, 130, 70, 154, 70, 198, 248, 243, 243, 52, 126, 70, 227, 59, 244, 59, 95, 163, 159, 95, 160, 241, 73, 26, 239, 161, 241, 22, 26, 191, 79, 227, 113, 26, 199, 105, 108, 166, 239, 232, 196, 119, 211, 88, 72, 231, 50, 11, 231, 204, 183, 143, 193, 96, 48, 24, 118, 99, 38, 8, 209, 32, 197, 91, 128, 191, 151, 36, 201, 69, 100, 180, 138, 198, 89, 131, 172, 222, 107, 16, 223, 143, 105, 164, 232, 239, 117, 34, 74, 157, 136, 42, 63, 240, 255, 214, 129, 207, 152, 131, 126, 167, 232, 176, 126, 198, 250, 187, 197, 142, 107, 28, 7, 100, 251, 12, 200, 151, 206, 113, 131, 113, 202, 179, 248, 150, 50, 24, 12, 6, 99, 92, 150, 162, 49, 102, 13, 12, 12, 204, 46, 102, 41, 18, 17, 53, 18, 1, 109, 34, 75, 237, 149, 68, 62, 239, 164, 241, 117, 26, 207, 89, 137, 176, 128, 168, 48, 178, 32, 75, 195, 34, 180, 142, 36, 6, 125, 46, 101, 177, 26, 51, 198, 231, 179, 5, 36, 153, 53, 254, 45, 109, 140, 148, 241, 251, 230, 177, 226, 198, 72, 26, 255, 158, 176, 144, 239, 217, 130, 107, 100, 48, 24, 12, 6, 163, 100, 204, 130, 27, 181, 152, 149, 213, 216, 216, 216, 0, 87, 41, 141, 215, 209, 248, 60, 141, 103, 11, 45, 57, 11, 25, 166, 44, 132, 149, 48, 254, 63, 93, 132, 240, 38, 115, 100, 76, 130, 164, 159, 79, 210, 185, 133, 153, 32, 25,Line truncated
Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

+57
View File
@@ -0,0 +1,57 @@
// +build ignore
package main
import (
"fmt"
"os"
"path"
"runtime"
"fyne.io/fyne"
)
func bundleFile(name string, filepath string, f *os.File) {
res, err := fyne.LoadResourceFromPath(filepath)
if err != nil {
fyne.LogError("Unable to load file "+filepath, err)
return
}
_, err = f.WriteString(fmt.Sprintf("var %s = %#v\n", name, res))
if err != nil {
fyne.LogError("Unable to write to bundled file", err)
}
}
func openFile(filename string) *os.File {
os.Remove(filename)
_, dirname, _, _ := runtime.Caller(0)
f, err := os.Create(path.Join(path.Dir(dirname), filename))
if err != nil {
fyne.LogError("Unable to open file "+filename, err)
return nil
}
_, err = f.WriteString("// **** THIS FILE IS AUTO-GENERATED, PLEASE DO NOT EDIT IT **** //\n\npackage data\n\nimport \"fyne.io/fyne\"\n\n")
if err != nil {
fyne.LogError("Unable to write file "+filename, err)
return nil
}
return f
}
func iconDir() string {
_, dirname, _, _ := runtime.Caller(0)
return path.Join(path.Dir(dirname), "icons")
}
func main() {
f := openFile("bundled-scene.go")
bundleFile("fynescenedark", "fyne_scene_dark.png", f)
bundleFile("fynescenelight", "fyne_scene_light.png", f)
f.Close()
}
+40
View File
@@ -0,0 +1,40 @@
package data
import (
"fyne.io/fyne"
)
// ThemedResource is a resource wrapper that will return an appropriate resource
// for the currently selected theme.
type ThemedResource struct {
dark, light fyne.Resource
}
func isLight() bool {
r, g, b, _ := fyne.CurrentApp().Settings().Theme().TextColor().RGBA()
return r < 0xaaaa && g < 0xaaaa && b < 0xaaaa
}
// Name returns the underlying resource name (used for caching)
func (res *ThemedResource) Name() string {
if isLight() {
return res.light.Name()
}
return res.dark.Name()
}
// Content returns the underlying content of the correct resource for the current theme
func (res *ThemedResource) Content() []byte {
if isLight() {
return res.light.Content()
}
return res.dark.Content()
}
// NewThemedResource creates a resource that adapts to the current theme setting.
func NewThemedResource(dark, light fyne.Resource) *ThemedResource {
return &ThemedResource{dark, light}
}
// FyneScene contains the full fyne logo with background design
var FyneScene = NewThemedResource(fynescenedark, fynescenelight)