diff --git a/go.mod b/go.mod index e85001fa..2baf35d3 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/atc0005/safelinks go 1.22.0 require ( - fyne.io/fyne/v2 v2.5.2 + fyne.io/fyne/v2 v2.5.3 github.com/google/go-cmp v0.6.0 ) diff --git a/go.sum b/go.sum index 15c4627b..b46e5a57 100644 --- a/go.sum +++ b/go.sum @@ -37,8 +37,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -fyne.io/fyne/v2 v2.5.2 h1:eSyGTmSkv10yAdAeHpDet6u2KkKxOGFc14kQu81We7Q= -fyne.io/fyne/v2 v2.5.2/go.mod h1:26gqPDvtaxHeyct+C0BBjuGd2zwAJlPkUGSBrb+d7Ug= +fyne.io/fyne/v2 v2.5.3 h1:k6LjZx6EzRZhClsuzy6vucLZBstdH2USDGHSGWq8ly8= +fyne.io/fyne/v2 v2.5.3/go.mod h1:0GOXKqyvNwk3DLmsFu9v0oYM0ZcD1ysGnlHCerKoAmo= fyne.io/systray v1.11.0 h1:D9HISlxSkx+jHSniMBR6fCFOUjk1x/OOOJLa9lJYAKg= fyne.io/systray v1.11.0/go.mod h1:RVwqP9nYMo7h5zViCBHri2FgjXF7H2cub7MAq4NSoLs= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= diff --git a/vendor/fyne.io/fyne/v2/CHANGELOG.md b/vendor/fyne.io/fyne/v2/CHANGELOG.md index 6f3f63a0..154d08c9 100644 --- a/vendor/fyne.io/fyne/v2/CHANGELOG.md +++ b/vendor/fyne.io/fyne/v2/CHANGELOG.md @@ -3,6 +3,33 @@ This file lists the main changes with each version of the Fyne toolkit. More detailed release notes can be found on the [releases page](https://github.com/fyne-io/fyne/releases). +## 2.5.3 - 15 December 2024 + +### Changed + +* Smoothly decelerate scroll on mobile +* Added Spanish translation + +### Fixed + +* Starting location can be wrong in file dialogs with custom repository (#5200) +* Improve how shortcut special keys for menu items are rendered on Windows and Linux (#5108) +* Blank page in Chrome for Android +* Mobile Entry: cursor arrows don't work (#5258) +* FileDialog does not handle relative file URIs well. (#5234) +* [Linux] Only change variant when color scheme changes +* [Linux] Window with list flickers in Wayland (#5133) +* Package command fails on OpenBSD (#5195) +* System theme fallback is not working with custom themes +* Translucency and images with Alpha channel (#1977) +* Performance regression when scrolling inside the file dialog (#4307) +* Empty but visible images consume high CPU on 2.4.x (#4345) +* Improved performance of text render caching +* nil pointer dereference in dialog.Resize() for color picker (#5236) +* Tiny files written in iOS may be empty +* Some SVG resources don't update appearance correctly with the theme (#3900) + + ## 2.5.2 - 15 October 2024 ### Fixed @@ -201,7 +228,6 @@ More detailed release notes can be found on the [releases page](https://github.c * Avoid memory leak in Android driver code * Entry Field on Android in Landscape Mode Shows "0" (#4036) * DocTabs Indicator remains visible after last tab is removed (#4220) -* Some SVG resources don't update appearance correctly with the theme (#3900) * Fix mobile simulation builds on OpenBSD * Fix alignment of menu button on mobile * Fix Compilation with Android NDK r26 diff --git a/vendor/fyne.io/fyne/v2/app/app.go b/vendor/fyne.io/fyne/v2/app/app.go index 6c44d951..b1f1ca20 100644 --- a/vendor/fyne.io/fyne/v2/app/app.go +++ b/vendor/fyne.io/fyne/v2/app/app.go @@ -39,6 +39,9 @@ func (a *fyneApp) Icon() fyne.Resource { return a.icon } + if a.Metadata().Icon == nil || len(a.Metadata().Icon.Content()) == 0 { + return nil + } return a.Metadata().Icon } diff --git a/vendor/fyne.io/fyne/v2/app/app_desktop_darwin.go b/vendor/fyne.io/fyne/v2/app/app_desktop_darwin.go index 026e823d..01aca7c3 100644 --- a/vendor/fyne.io/fyne/v2/app/app_desktop_darwin.go +++ b/vendor/fyne.io/fyne/v2/app/app_desktop_darwin.go @@ -16,7 +16,6 @@ import ( "net/url" "os" "os/exec" - "path/filepath" "fyne.io/fyne/v2" ) @@ -41,13 +40,6 @@ func (a *fyneApp) SetSystemTrayMenu(menu *fyne.Menu) { } } -func rootConfigDir() string { - homeDir, _ := os.UserHomeDir() - - desktopConfig := filepath.Join(filepath.Join(homeDir, "Library"), "Preferences") - return filepath.Join(desktopConfig, "fyne") -} - //export themeChanged func themeChanged() { fyne.CurrentApp().Settings().(*settings).setupTheme() diff --git a/vendor/fyne.io/fyne/v2/app/app_goxjs.go b/vendor/fyne.io/fyne/v2/app/app_goxjs.go index 08c2df76..f3c4a49e 100644 --- a/vendor/fyne.io/fyne/v2/app/app_goxjs.go +++ b/vendor/fyne.io/fyne/v2/app/app_goxjs.go @@ -50,10 +50,6 @@ func (a *fyneApp) SendNotification(n *fyne.Notification) { } } -func rootConfigDir() string { - return "/data/" -} - var themeChanged = js.FuncOf(func(this js.Value, args []js.Value) interface{} { if len(args) > 0 && args[0].Type() == js.TypeObject { fyne.CurrentApp().Settings().(*settings).setupTheme() diff --git a/vendor/fyne.io/fyne/v2/app/app_mobile_and.go b/vendor/fyne.io/fyne/v2/app/app_mobile_and.go index 9abf0474..fb1d8afa 100644 --- a/vendor/fyne.io/fyne/v2/app/app_mobile_and.go +++ b/vendor/fyne.io/fyne/v2/app/app_mobile_and.go @@ -12,10 +12,7 @@ void sendNotification(uintptr_t java_vm, uintptr_t jni_env, uintptr_t ctx, char */ import "C" import ( - "log" "net/url" - "os" - "path/filepath" "unsafe" "fyne.io/fyne/v2" @@ -44,13 +41,3 @@ func (a *fyneApp) SendNotification(n *fyne.Notification) { return nil }) } - -func rootConfigDir() string { - filesDir := os.Getenv("FILESDIR") - if filesDir == "" { - log.Println("FILESDIR env was not set by android native code") - return "/data/data" // probably won't work, but we can't make a better guess - } - - return filepath.Join(filesDir, "fyne") -} diff --git a/vendor/fyne.io/fyne/v2/app/app_mobile_ios.go b/vendor/fyne.io/fyne/v2/app/app_mobile_ios.go index 86b12d1f..833ae4fd 100644 --- a/vendor/fyne.io/fyne/v2/app/app_mobile_ios.go +++ b/vendor/fyne.io/fyne/v2/app/app_mobile_ios.go @@ -8,22 +8,15 @@ package app #include -char *documentsPath(void); void openURL(char *urlStr); void sendNotification(char *title, char *content); */ import "C" import ( "net/url" - "path/filepath" "unsafe" ) -func rootConfigDir() string { - root := C.documentsPath() - return filepath.Join(C.GoString(root), "fyne") -} - func (a *fyneApp) OpenURL(url *url.URL) error { urlStr := C.CString(url.String()) C.openURL(urlStr) diff --git a/vendor/fyne.io/fyne/v2/app/app_mobile_ios.m b/vendor/fyne.io/fyne/v2/app/app_mobile_ios.m index d1e6ab48..bfdbfebe 100644 --- a/vendor/fyne.io/fyne/v2/app/app_mobile_ios.m +++ b/vendor/fyne.io/fyne/v2/app/app_mobile_ios.m @@ -8,8 +8,3 @@ void openURL(char *urlStr) { [app openURL:url options:@{} completionHandler:nil]; } -char *documentsPath() { - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *path = paths.firstObject; - return [path UTF8String]; -} diff --git a/vendor/fyne.io/fyne/v2/app/app_other.go b/vendor/fyne.io/fyne/v2/app/app_other.go index 83c336de..72601c7a 100644 --- a/vendor/fyne.io/fyne/v2/app/app_other.go +++ b/vendor/fyne.io/fyne/v2/app/app_other.go @@ -5,16 +5,10 @@ package app import ( "errors" "net/url" - "os" - "path/filepath" "fyne.io/fyne/v2" ) -func rootConfigDir() string { - return filepath.Join(os.TempDir(), "fyne-test") -} - func (a *fyneApp) OpenURL(_ *url.URL) error { return errors.New("Unable to open url for unknown operating system") } diff --git a/vendor/fyne.io/fyne/v2/app/app_windows.go b/vendor/fyne.io/fyne/v2/app/app_windows.go index e6eb3096..ad3a6832 100644 --- a/vendor/fyne.io/fyne/v2/app/app_windows.go +++ b/vendor/fyne.io/fyne/v2/app/app_windows.go @@ -29,13 +29,6 @@ $xml.LoadXml($toastXml.OuterXml) $toast = [Windows.UI.Notifications.ToastNotification]::new($xml) [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("%s").Show($toast);` -func rootConfigDir() string { - homeDir, _ := os.UserHomeDir() - - desktopConfig := filepath.Join(filepath.Join(homeDir, "AppData"), "Roaming") - return filepath.Join(desktopConfig, "fyne") -} - func (a *fyneApp) OpenURL(url *url.URL) error { cmd := exec.Command("rundll32", "url.dll,FileProtocolHandler", url.String()) cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr diff --git a/vendor/fyne.io/fyne/v2/app/app_xdg.go b/vendor/fyne.io/fyne/v2/app/app_xdg.go index e1835181..a9068a4f 100644 --- a/vendor/fyne.io/fyne/v2/app/app_xdg.go +++ b/vendor/fyne.io/fyne/v2/app/app_xdg.go @@ -6,7 +6,6 @@ import ( "net/url" "os" "os/exec" - "path/filepath" "sync/atomic" "github.com/godbus/dbus/v5" @@ -114,22 +113,18 @@ func (a *fyneApp) SetSystemTrayIcon(icon fyne.Resource) { } } -func rootConfigDir() string { - desktopConfig, _ := os.UserConfigDir() - return filepath.Join(desktopConfig, "fyne") -} - func watchTheme(s *settings) { go func() { // Theme lookup hangs on some desktops. Update theme variant cache from within goroutine. - internalapp.CurrentVariant.Store(uint64(findFreedesktopColorScheme())) - s.setupTheme() + themeVariant := findFreedesktopColorScheme() + internalapp.CurrentVariant.Store(uint64(themeVariant)) + s.applyVariant(themeVariant) portalSettings.OnSignalSettingChanged(func(changed portalSettings.Changed) { - if changed.Namespace == "org.freedesktop.appearance" && changed.Key == "color-scheme" { + if changed.Namespace == appearance.Namespace && changed.Key == "color-scheme" { themeVariant := colorSchemeToThemeVariant(appearance.ColorScheme(changed.Value.(uint32))) internalapp.CurrentVariant.Store(uint64(themeVariant)) - s.setupTheme() + s.applyVariant(themeVariant) } }) }() diff --git a/vendor/fyne.io/fyne/v2/app/preferences.go b/vendor/fyne.io/fyne/v2/app/preferences.go index 138fd30e..24ef00e0 100644 --- a/vendor/fyne.io/fyne/v2/app/preferences.go +++ b/vendor/fyne.io/fyne/v2/app/preferences.go @@ -183,12 +183,7 @@ func convertLists(values map[string]any) { floats[i] = item.(float64) } values[k] = floats - case int: - ints := make([]int, len(items)) - for i, item := range items { - ints[i] = item.(int) - } - values[k] = ints + //case int: // json has no int! case string: strings := make([]string, len(items)) for i, item := range items { diff --git a/vendor/fyne.io/fyne/v2/app/preferences_android.go b/vendor/fyne.io/fyne/v2/app/preferences_android.go index a2e7e47f..ac9f834c 100644 --- a/vendor/fyne.io/fyne/v2/app/preferences_android.go +++ b/vendor/fyne.io/fyne/v2/app/preferences_android.go @@ -2,7 +2,11 @@ package app -import "path/filepath" +import ( + "path/filepath" + + "fyne.io/fyne/v2/internal/app" +) // storagePath returns the location of the settings storage func (p *preferences) storagePath() string { @@ -12,7 +16,7 @@ func (p *preferences) storagePath() string { // storageRoot returns the location of the app storage func (a *fyneApp) storageRoot() string { - return rootConfigDir() // we are in a sandbox, so no app ID added to this path + return app.RootConfigDir() // we are in a sandbox, so no app ID added to this path } func (p *preferences) watch() { diff --git a/vendor/fyne.io/fyne/v2/app/preferences_ios.go b/vendor/fyne.io/fyne/v2/app/preferences_ios.go index 8720dcf3..b861eec4 100644 --- a/vendor/fyne.io/fyne/v2/app/preferences_ios.go +++ b/vendor/fyne.io/fyne/v2/app/preferences_ios.go @@ -4,6 +4,8 @@ package app import ( "path/filepath" + + "fyne.io/fyne/v2/internal/app" ) import "C" @@ -15,7 +17,7 @@ func (p *preferences) storagePath() string { // storageRoot returns the location of the app storage func (a *fyneApp) storageRoot() string { - return rootConfigDir() // we are in a sandbox, so no app ID added to this path + return app.RootConfigDir() // we are in a sandbox, so no app ID added to this path } func (p *preferences) watch() { diff --git a/vendor/fyne.io/fyne/v2/app/preferences_mobile.go b/vendor/fyne.io/fyne/v2/app/preferences_mobile.go index 0faa1226..1fd186f9 100644 --- a/vendor/fyne.io/fyne/v2/app/preferences_mobile.go +++ b/vendor/fyne.io/fyne/v2/app/preferences_mobile.go @@ -2,7 +2,11 @@ package app -import "path/filepath" +import ( + "path/filepath" + + "fyne.io/fyne/v2/internal/app" +) // storagePath returns the location of the settings storage func (p *preferences) storagePath() string { @@ -11,7 +15,7 @@ func (p *preferences) storagePath() string { // storageRoot returns the location of the app storage func (a *fyneApp) storageRoot() string { - return filepath.Join(rootConfigDir(), a.UniqueID()) + return filepath.Join(app.RootConfigDir(), a.UniqueID()) } func (p *preferences) watch() { diff --git a/vendor/fyne.io/fyne/v2/app/preferences_other.go b/vendor/fyne.io/fyne/v2/app/preferences_other.go index 47225374..3e698c2c 100644 --- a/vendor/fyne.io/fyne/v2/app/preferences_other.go +++ b/vendor/fyne.io/fyne/v2/app/preferences_other.go @@ -2,7 +2,11 @@ package app -import "path/filepath" +import ( + "path/filepath" + + "fyne.io/fyne/v2/internal/app" +) // storagePath returns the location of the settings storage func (p *preferences) storagePath() string { @@ -11,7 +15,7 @@ func (p *preferences) storagePath() string { // storageRoot returns the location of the app storage func (a *fyneApp) storageRoot() string { - return filepath.Join(rootConfigDir(), a.UniqueID()) + return filepath.Join(app.RootConfigDir(), a.UniqueID()) } func (p *preferences) watch() { diff --git a/vendor/fyne.io/fyne/v2/app/settings.go b/vendor/fyne.io/fyne/v2/app/settings.go index ca83c84e..dc0cbf20 100644 --- a/vendor/fyne.io/fyne/v2/app/settings.go +++ b/vendor/fyne.io/fyne/v2/app/settings.go @@ -7,7 +7,7 @@ import ( "sync" "fyne.io/fyne/v2" - internalapp "fyne.io/fyne/v2/internal/app" + "fyne.io/fyne/v2/internal/app" "fyne.io/fyne/v2/internal/build" "fyne.io/fyne/v2/theme" ) @@ -27,7 +27,7 @@ type SettingsSchema struct { // StoragePath returns the location of the settings storage func (sc *SettingsSchema) StoragePath() string { - return filepath.Join(rootConfigDir(), "settings.json") + return filepath.Join(app.RootConfigDir(), "settings.json") } // Declare conformity with Settings interface @@ -97,6 +97,13 @@ func (s *settings) applyTheme(theme fyne.Theme, variant fyne.ThemeVariant) { s.apply() } +func (s *settings) applyVariant(variant fyne.ThemeVariant) { + s.propertyLock.Lock() + defer s.propertyLock.Unlock() + s.variant = variant + s.apply() +} + func (s *settings) Scale() float32 { s.propertyLock.RLock() defer s.propertyLock.RUnlock() @@ -129,7 +136,7 @@ func (s *settings) fileChanged() { } func (s *settings) loadSystemTheme() fyne.Theme { - path := filepath.Join(rootConfigDir(), "theme.json") + path := filepath.Join(app.RootConfigDir(), "theme.json") data, err := fyne.LoadResourceFromPath(path) if err != nil { if !os.IsNotExist(err) { @@ -153,7 +160,7 @@ func (s *settings) setupTheme() { name = env } - variant := internalapp.DefaultVariant() + variant := app.DefaultVariant() effectiveTheme := s.theme if !s.themeSpecified { effectiveTheme = s.loadSystemTheme() diff --git a/vendor/fyne.io/fyne/v2/canvas/image.go b/vendor/fyne.io/fyne/v2/canvas/image.go index 074bb657..fce634b5 100644 --- a/vendor/fyne.io/fyne/v2/canvas/image.go +++ b/vendor/fyne.io/fyne/v2/canvas/image.go @@ -100,7 +100,9 @@ func (i *Image) Hide() { // MinSize returns the specified minimum size, if set, or {1, 1} otherwise. func (i *Image) MinSize() fyne.Size { if i.Image == nil || i.aspect == 0 { - i.Refresh() + if i.File != "" || i.Resource != nil { + i.Refresh() + } } return i.baseObject.MinSize() } diff --git a/vendor/fyne.io/fyne/v2/container/tabs.go b/vendor/fyne.io/fyne/v2/container/tabs.go index 742523e9..0fe73c7e 100644 --- a/vendor/fyne.io/fyne/v2/container/tabs.go +++ b/vendor/fyne.io/fyne/v2/container/tabs.go @@ -708,14 +708,13 @@ func (r *tabButtonRenderer) Refresh() { case *theme.ThemedResource: if r.button.importance == widget.HighImportance { r.icon.Resource = theme.NewPrimaryThemedResource(res) - r.icon.Refresh() } case *theme.PrimaryThemedResource: if r.button.importance != widget.HighImportance { r.icon.Resource = res.Original() - r.icon.Refresh() } } + r.icon.Refresh() } else { r.icon.Hide() } diff --git a/vendor/fyne.io/fyne/v2/internal/app/config.go b/vendor/fyne.io/fyne/v2/internal/app/config.go new file mode 100644 index 00000000..bb31841f --- /dev/null +++ b/vendor/fyne.io/fyne/v2/internal/app/config.go @@ -0,0 +1,5 @@ +package app + +func RootConfigDir() string { + return rootConfigDir() +} diff --git a/vendor/fyne.io/fyne/v2/internal/app/config_desktop_darwin.go b/vendor/fyne.io/fyne/v2/internal/app/config_desktop_darwin.go new file mode 100644 index 00000000..1571b17e --- /dev/null +++ b/vendor/fyne.io/fyne/v2/internal/app/config_desktop_darwin.go @@ -0,0 +1,15 @@ +//go:build !ci && !ios && !wasm && !test_web_driver && !mobile + +package app + +import ( + "os" + "path/filepath" +) + +func rootConfigDir() string { + homeDir, _ := os.UserHomeDir() + + desktopConfig := filepath.Join(filepath.Join(homeDir, "Library"), "Preferences") + return filepath.Join(desktopConfig, "fyne") +} diff --git a/vendor/fyne.io/fyne/v2/internal/app/config_goxjs.go b/vendor/fyne.io/fyne/v2/internal/app/config_goxjs.go new file mode 100644 index 00000000..c3441d20 --- /dev/null +++ b/vendor/fyne.io/fyne/v2/internal/app/config_goxjs.go @@ -0,0 +1,7 @@ +//go:build !ci && (!android || !ios || !mobile) && (wasm || test_web_driver) + +package app + +func rootConfigDir() string { + return "/data/" +} diff --git a/vendor/fyne.io/fyne/v2/internal/app/config_mobile_and.go b/vendor/fyne.io/fyne/v2/internal/app/config_mobile_and.go new file mode 100644 index 00000000..9c3d855b --- /dev/null +++ b/vendor/fyne.io/fyne/v2/internal/app/config_mobile_and.go @@ -0,0 +1,19 @@ +//go:build !ci && android + +package app + +import ( + "log" + "os" + "path/filepath" +) + +func rootConfigDir() string { + filesDir := os.Getenv("FILESDIR") + if filesDir == "" { + log.Println("FILESDIR env was not set by android native code") + return "/data/data" // probably won't work, but we can't make a better guess + } + + return filepath.Join(filesDir, "fyne") +} diff --git a/vendor/fyne.io/fyne/v2/internal/app/config_mobile_ios.go b/vendor/fyne.io/fyne/v2/internal/app/config_mobile_ios.go new file mode 100644 index 00000000..0516fe1c --- /dev/null +++ b/vendor/fyne.io/fyne/v2/internal/app/config_mobile_ios.go @@ -0,0 +1,19 @@ +//go:build !ci && ios && !mobile + +package app + +import ( + "path/filepath" +) + +/* +#include + +char *documentsPath(void); +*/ +import "C" + +func rootConfigDir() string { + root := C.documentsPath() + return filepath.Join(C.GoString(root), "fyne") +} diff --git a/vendor/fyne.io/fyne/v2/internal/app/config_mobile_ios.m b/vendor/fyne.io/fyne/v2/internal/app/config_mobile_ios.m new file mode 100644 index 00000000..059005aa --- /dev/null +++ b/vendor/fyne.io/fyne/v2/internal/app/config_mobile_ios.m @@ -0,0 +1,9 @@ +//go:build !ci && ios + +#import + +char *documentsPath() { + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + NSString *path = paths.firstObject; + return [path UTF8String]; +} \ No newline at end of file diff --git a/vendor/fyne.io/fyne/v2/internal/app/config_other.go b/vendor/fyne.io/fyne/v2/internal/app/config_other.go new file mode 100644 index 00000000..1b45477c --- /dev/null +++ b/vendor/fyne.io/fyne/v2/internal/app/config_other.go @@ -0,0 +1,12 @@ +//go:build ci || (mobile && !android && !ios) || (!linux && !darwin && !windows && !freebsd && !openbsd && !netbsd && !wasm && !test_web_driver) + +package app + +import ( + "os" + "path/filepath" +) + +func rootConfigDir() string { + return filepath.Join(os.TempDir(), "fyne-test") +} diff --git a/vendor/fyne.io/fyne/v2/internal/app/config_windows.go b/vendor/fyne.io/fyne/v2/internal/app/config_windows.go new file mode 100644 index 00000000..c0960036 --- /dev/null +++ b/vendor/fyne.io/fyne/v2/internal/app/config_windows.go @@ -0,0 +1,15 @@ +//go:build !ci && !android && !ios && !wasm && !test_web_driver + +package app + +import ( + "os" + "path/filepath" +) + +func rootConfigDir() string { + homeDir, _ := os.UserHomeDir() + + desktopConfig := filepath.Join(filepath.Join(homeDir, "AppData"), "Roaming") + return filepath.Join(desktopConfig, "fyne") +} diff --git a/vendor/fyne.io/fyne/v2/internal/app/config_xdg.go b/vendor/fyne.io/fyne/v2/internal/app/config_xdg.go new file mode 100644 index 00000000..3a04463c --- /dev/null +++ b/vendor/fyne.io/fyne/v2/internal/app/config_xdg.go @@ -0,0 +1,13 @@ +//go:build !ci && !wasm && !test_web_driver && !android && !ios && !mobile && (linux || openbsd || freebsd || netbsd) + +package app + +import ( + "os" + "path/filepath" +) + +func rootConfigDir() string { + desktopConfig, _ := os.UserConfigDir() + return filepath.Join(desktopConfig, "fyne") +} diff --git a/vendor/fyne.io/fyne/v2/internal/app/theme_darwin.go b/vendor/fyne.io/fyne/v2/internal/app/theme_darwin.go index f01ea3ac..a74eb2ec 100644 --- a/vendor/fyne.io/fyne/v2/internal/app/theme_darwin.go +++ b/vendor/fyne.io/fyne/v2/internal/app/theme_darwin.go @@ -13,7 +13,7 @@ bool isDarkMode(); import "C" import ( "fyne.io/fyne/v2" - "fyne.io/fyne/v2/theme" + "fyne.io/fyne/v2/internal/theme" ) // DefaultVariant returns the systems default fyne.ThemeVariant. diff --git a/vendor/fyne.io/fyne/v2/internal/app/theme_other.go b/vendor/fyne.io/fyne/v2/internal/app/theme_other.go index f2d69da0..9a6cc4d0 100644 --- a/vendor/fyne.io/fyne/v2/internal/app/theme_other.go +++ b/vendor/fyne.io/fyne/v2/internal/app/theme_other.go @@ -4,7 +4,7 @@ package app import ( "fyne.io/fyne/v2" - "fyne.io/fyne/v2/theme" + "fyne.io/fyne/v2/internal/theme" ) // DefaultVariant returns the systems default fyne.ThemeVariant. diff --git a/vendor/fyne.io/fyne/v2/internal/app/theme_wasm.go b/vendor/fyne.io/fyne/v2/internal/app/theme_wasm.go index 427ae3fe..ca000872 100644 --- a/vendor/fyne.io/fyne/v2/internal/app/theme_wasm.go +++ b/vendor/fyne.io/fyne/v2/internal/app/theme_wasm.go @@ -6,7 +6,7 @@ import ( "syscall/js" "fyne.io/fyne/v2" - "fyne.io/fyne/v2/theme" + "fyne.io/fyne/v2/internal/theme" ) // DefaultVariant returns the systems default fyne.ThemeVariant. diff --git a/vendor/fyne.io/fyne/v2/internal/app/theme_web.go b/vendor/fyne.io/fyne/v2/internal/app/theme_web.go index 310317c0..fcb86608 100644 --- a/vendor/fyne.io/fyne/v2/internal/app/theme_web.go +++ b/vendor/fyne.io/fyne/v2/internal/app/theme_web.go @@ -4,7 +4,7 @@ package app import ( "fyne.io/fyne/v2" - "fyne.io/fyne/v2/theme" + "fyne.io/fyne/v2/internal/theme" ) // DefaultVariant returns the systems default fyne.ThemeVariant. diff --git a/vendor/fyne.io/fyne/v2/internal/app/theme_windows.go b/vendor/fyne.io/fyne/v2/internal/app/theme_windows.go index 7bb906bc..83a20e2d 100644 --- a/vendor/fyne.io/fyne/v2/internal/app/theme_windows.go +++ b/vendor/fyne.io/fyne/v2/internal/app/theme_windows.go @@ -8,7 +8,7 @@ import ( "golang.org/x/sys/windows/registry" "fyne.io/fyne/v2" - "fyne.io/fyne/v2/theme" + "fyne.io/fyne/v2/internal/theme" ) const themeRegKey = `SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize` diff --git a/vendor/fyne.io/fyne/v2/internal/cache/text.go b/vendor/fyne.io/fyne/v2/internal/cache/text.go index 0cbf754e..17f546c2 100644 --- a/vendor/fyne.io/fyne/v2/internal/cache/text.go +++ b/vendor/fyne.io/fyne/v2/internal/cache/text.go @@ -1,6 +1,7 @@ package cache import ( + "image/color" "sync" "time" @@ -19,10 +20,17 @@ type fontMetric struct { } type fontSizeEntry struct { - text string - size float32 - style fyne.TextStyle - custom string + Text string + Size float32 + Style fyne.TextStyle + Source string +} + +type FontCacheEntry struct { + fontSizeEntry + + Canvas fyne.Canvas + Color color.Color } // GetFontMetrics looks up a calculated size and baseline required for the specified text parameters. diff --git a/vendor/fyne.io/fyne/v2/internal/cache/texture_common.go b/vendor/fyne.io/fyne/v2/internal/cache/texture_common.go index abfd54f6..be0dce90 100644 --- a/vendor/fyne.io/fyne/v2/internal/cache/texture_common.go +++ b/vendor/fyne.io/fyne/v2/internal/cache/texture_common.go @@ -13,8 +13,17 @@ func DeleteTexture(obj fyne.CanvasObject) { textures.Delete(obj) } +// GetTextTexture gets cached texture for a text run. +func GetTextTexture(ent FontCacheEntry) (TextureType, bool) { + return load(ent) +} + // GetTexture gets cached texture. func GetTexture(obj fyne.CanvasObject) (TextureType, bool) { + return load(obj) +} + +func load(obj any) (TextureType, bool) { t, ok := textures.Load(obj) if t == nil || !ok { return NoTexture, false @@ -31,6 +40,17 @@ func GetTexture(obj fyne.CanvasObject) (TextureType, bool) { func RangeExpiredTexturesFor(canvas fyne.Canvas, f func(fyne.CanvasObject)) { now := timeNow() textures.Range(func(key, value any) bool { + if _, ok := key.(FontCacheEntry); ok { + tinfo := value.(*textureInfo) + + // just free text directly when that string/style combo is done + if tinfo.isExpired(now) && tinfo.canvas == canvas { + textures.Delete(key) + tinfo.textFree() + } + + return true + } obj, tinfo := key.(fyne.CanvasObject), value.(*textureInfo) if tinfo.isExpired(now) && tinfo.canvas == canvas { f(obj) @@ -40,11 +60,16 @@ func RangeExpiredTexturesFor(canvas fyne.Canvas, f func(fyne.CanvasObject)) { } // RangeTexturesFor range over the textures for the specified canvas. +// It will not return the texture for a `canvas.Text` as their render lifecycle is handled separately. // // Note: If this is used to free textures, then it should be called inside a current // gl context to ensure textures are deleted from gl. func RangeTexturesFor(canvas fyne.Canvas, f func(fyne.CanvasObject)) { textures.Range(func(key, value any) bool { + if _, ok := key.(FontCacheEntry); ok { + return true // do nothing, text cache lives outside the scope of an object + } + obj, tinfo := key.(fyne.CanvasObject), value.(*textureInfo) if tinfo.canvas == canvas { f(obj) @@ -53,9 +78,21 @@ func RangeTexturesFor(canvas fyne.Canvas, f func(fyne.CanvasObject)) { }) } +// SetTextTexture sets cached texture for a text run. +func SetTextTexture(ent FontCacheEntry, texture TextureType, canvas fyne.Canvas, free func()) { + store(ent, texture, canvas, free) +} + // SetTexture sets cached texture. func SetTexture(obj fyne.CanvasObject, texture TextureType, canvas fyne.Canvas) { + store(obj, texture, canvas, nil) +} + +func store(obj any, texture TextureType, canvas fyne.Canvas, free func()) { texInfo := &textureInfo{texture: texture} + if free != nil { + texInfo.textFree = free + } texInfo.canvas = canvas texInfo.setAlive() textures.Store(obj, texInfo) diff --git a/vendor/fyne.io/fyne/v2/internal/cache/texture_desktop.go b/vendor/fyne.io/fyne/v2/internal/cache/texture_desktop.go index 26062eb7..9627731d 100644 --- a/vendor/fyne.io/fyne/v2/internal/cache/texture_desktop.go +++ b/vendor/fyne.io/fyne/v2/internal/cache/texture_desktop.go @@ -10,7 +10,9 @@ var NoTexture = TextureType(0) type textureInfo struct { textureCacheBase - texture TextureType + + texture TextureType + textFree func() } // IsValid will return true if the passed texture is potentially a texture diff --git a/vendor/fyne.io/fyne/v2/internal/cache/texture_gomobile.go b/vendor/fyne.io/fyne/v2/internal/cache/texture_gomobile.go index 4b0d89cf..14ea8cc7 100644 --- a/vendor/fyne.io/fyne/v2/internal/cache/texture_gomobile.go +++ b/vendor/fyne.io/fyne/v2/internal/cache/texture_gomobile.go @@ -11,7 +11,9 @@ var NoTexture = gl.Texture{0} type textureInfo struct { textureCacheBase - texture TextureType + + texture TextureType + textFree func() } // IsValid will return true if the passed texture is potentially a texture diff --git a/vendor/fyne.io/fyne/v2/internal/cache/texture_goxjs.go b/vendor/fyne.io/fyne/v2/internal/cache/texture_goxjs.go index 17669ea5..246f9021 100644 --- a/vendor/fyne.io/fyne/v2/internal/cache/texture_goxjs.go +++ b/vendor/fyne.io/fyne/v2/internal/cache/texture_goxjs.go @@ -2,7 +2,7 @@ package cache -import gl "github.com/fyne-io/gl-js" +import "github.com/fyne-io/gl-js" // TextureType represents an uploaded GL texture type TextureType = gl.Texture @@ -11,7 +11,9 @@ var NoTexture = gl.NoTexture type textureInfo struct { textureCacheBase - texture TextureType + + texture TextureType + textFree func() } // IsValid will return true if the passed texture is potentially a texture diff --git a/vendor/fyne.io/fyne/v2/internal/driver/common/canvas.go b/vendor/fyne.io/fyne/v2/internal/driver/common/canvas.go index 26e1d3ee..80c61ecf 100644 --- a/vendor/fyne.io/fyne/v2/internal/driver/common/canvas.go +++ b/vendor/fyne.io/fyne/v2/internal/driver/common/canvas.go @@ -336,23 +336,6 @@ func (c *Canvas) Painter() gl.Painter { // Refresh refreshes a canvas object. func (c *Canvas) Refresh(obj fyne.CanvasObject) { - walkNeeded := false - switch obj.(type) { - case *fyne.Container: - walkNeeded = true - case fyne.Widget: - walkNeeded = true - } - - if walkNeeded { - driver.WalkCompleteObjectTree(obj, func(co fyne.CanvasObject, p1, p2 fyne.Position, s fyne.Size) bool { - if i, ok := co.(*canvas.Image); ok { - i.Refresh() - } - return false - }, nil) - } - c.refreshQueue.In(obj) c.SetDirty() } diff --git a/vendor/fyne.io/fyne/v2/internal/driver/mobile/canvas.go b/vendor/fyne.io/fyne/v2/internal/driver/mobile/canvas.go index 5c8c6a5d..081153ee 100644 --- a/vendor/fyne.io/fyne/v2/internal/driver/mobile/canvas.go +++ b/vendor/fyne.io/fyne/v2/internal/driver/mobile/canvas.go @@ -25,6 +25,7 @@ type canvas struct { initialized bool lastTapDown map[int]time.Time lastTapDownPos map[int]fyne.Position + lastTapDelta map[int]fyne.Delta menu fyne.CanvasObject padded bool scale float32 @@ -54,6 +55,7 @@ func newCanvas(dev fyne.Device) fyne.Canvas { device: d, lastTapDown: make(map[int]time.Time), lastTapDownPos: make(map[int]fyne.Position), + lastTapDelta: make(map[int]fyne.Delta), padded: true, scale: dev.SystemScaleForWindow(nil), // we don't need a window parameter on mobile, touched: make(map[int]mobile.Touchable), @@ -258,6 +260,8 @@ func (c *canvas) tapMove(pos fyne.Position, tapID int, return } c.lastTapDownPos[tapID] = pos + offset := fyne.Delta{DX: deltaX, DY: deltaY} + c.lastTapDelta[tapID] = offset co, objPos, _ := c.findObjectAtPositionMatching(pos, func(object fyne.CanvasObject) bool { if _, ok := object.(fyne.Draggable); ok { @@ -292,7 +296,7 @@ func (c *canvas) tapMove(pos fyne.Position, tapID int, ev := &fyne.DragEvent{} draggedObjDelta := c.dragStart.Subtract(c.dragging.(fyne.CanvasObject).Position()) ev.Position = pos.Subtract(c.dragOffset).Add(draggedObjDelta) - ev.Dragged = fyne.Delta{DX: deltaX, DY: deltaY} + ev.Dragged = offset dragCallback(c.dragging, ev) } @@ -301,10 +305,11 @@ func (c *canvas) tapUp(pos fyne.Position, tapID int, tapCallback func(fyne.Tappable, *fyne.PointEvent), tapAltCallback func(fyne.SecondaryTappable, *fyne.PointEvent), doubleTapCallback func(fyne.DoubleTappable, *fyne.PointEvent), - dragCallback func(fyne.Draggable)) { + dragCallback func(fyne.Draggable, *fyne.DragEvent)) { if c.dragging != nil { - dragCallback(c.dragging) + previousDelta := c.lastTapDelta[tapID] + dragCallback(c.dragging, &fyne.DragEvent{Dragged: previousDelta}) c.dragging = nil return diff --git a/vendor/fyne.io/fyne/v2/internal/driver/mobile/device_android.go b/vendor/fyne.io/fyne/v2/internal/driver/mobile/device_android.go index 6952e22e..44c0398c 100644 --- a/vendor/fyne.io/fyne/v2/internal/driver/mobile/device_android.go +++ b/vendor/fyne.io/fyne/v2/internal/driver/mobile/device_android.go @@ -4,7 +4,7 @@ package mobile import "fyne.io/fyne/v2" -const tapYOffset = -12.0 // to compensate for how we hold our fingers on the device +const tapYOffset = -8.0 // to compensate for how we hold our fingers on the device func (*device) SystemScaleForWindow(_ fyne.Window) float32 { if currentDPI >= 600 { diff --git a/vendor/fyne.io/fyne/v2/internal/driver/mobile/device_ios.go b/vendor/fyne.io/fyne/v2/internal/driver/mobile/device_ios.go index a69bcbf1..284b6c04 100644 --- a/vendor/fyne.io/fyne/v2/internal/driver/mobile/device_ios.go +++ b/vendor/fyne.io/fyne/v2/internal/driver/mobile/device_ios.go @@ -4,7 +4,7 @@ package mobile import "fyne.io/fyne/v2" -const tapYOffset = -12.0 // to compensate for how we hold our fingers on the device +const tapYOffset = -8.0 // to compensate for how we hold our fingers on the device func (*device) SystemScaleForWindow(_ fyne.Window) float32 { if currentDPI >= 450 { diff --git a/vendor/fyne.io/fyne/v2/internal/driver/mobile/driver.go b/vendor/fyne.io/fyne/v2/internal/driver/mobile/driver.go index 41675ee5..636a026d 100644 --- a/vendor/fyne.io/fyne/v2/internal/driver/mobile/driver.go +++ b/vendor/fyne.io/fyne/v2/internal/driver/mobile/driver.go @@ -1,6 +1,7 @@ package mobile import ( + "math" "runtime" "strconv" "sync/atomic" @@ -30,9 +31,11 @@ import ( ) const ( - tapMoveThreshold = 4.0 // how far can we move before it is a drag - tapSecondaryDelay = 300 * time.Millisecond // how long before secondary tap - tapDoubleDelay = 500 * time.Millisecond // max duration between taps for a DoubleTap event + tapMoveDecay = 0.92 // how much should the scroll continue decay on each frame? + tapMoveEndThreshold = 2.0 // at what offset will we stop decaying? + tapMoveThreshold = 4.0 // how far can we move before it is a drag + tapSecondaryDelay = 300 * time.Millisecond // how long before secondary tap + tapDoubleDelay = 500 * time.Millisecond // max duration between taps for a DoubleTap event ) // Configuration is the system information about the current device @@ -395,8 +398,27 @@ func (d *driver) tapUpCanvas(w *window, x, y float32, tapID touch.Sequence) { w.QueueEvent(func() { wid.TappedSecondary(ev) }) }, func(wid fyne.DoubleTappable, ev *fyne.PointEvent) { w.QueueEvent(func() { wid.DoubleTapped(ev) }) - }, func(wid fyne.Draggable) { - w.QueueEvent(wid.DragEnd) + }, func(wid fyne.Draggable, ev *fyne.DragEvent) { + if math.Abs(float64(ev.Dragged.DX)) <= tapMoveEndThreshold && math.Abs(float64(ev.Dragged.DY)) <= tapMoveEndThreshold { + w.QueueEvent(wid.DragEnd) + return + } + + go func() { + for math.Abs(float64(ev.Dragged.DX)) > tapMoveEndThreshold || math.Abs(float64(ev.Dragged.DY)) > tapMoveEndThreshold { + if math.Abs(float64(ev.Dragged.DX)) > 0 { + ev.Dragged.DX *= tapMoveDecay + } + if math.Abs(float64(ev.Dragged.DY)) > 0 { + ev.Dragged.DY *= tapMoveDecay + } + + w.QueueEvent(func() { wid.Dragged(ev) }) + time.Sleep(time.Millisecond * 16) + } + + w.QueueEvent(wid.DragEnd) + }() }) } @@ -412,6 +434,11 @@ var keyCodeMap = map[key.Code]fyne.KeyName{ key.CodeHome: fyne.KeyHome, key.CodeEnd: fyne.KeyEnd, + key.CodeLeftArrow: fyne.KeyLeft, + key.CodeRightArrow: fyne.KeyRight, + key.CodeUpArrow: fyne.KeyUp, + key.CodeDownArrow: fyne.KeyDown, + key.CodeF1: fyne.KeyF1, key.CodeF2: fyne.KeyF2, key.CodeF3: fyne.KeyF3, diff --git a/vendor/fyne.io/fyne/v2/internal/driver/mobile/file_ios.m b/vendor/fyne.io/fyne/v2/internal/driver/mobile/file_ios.m index 3bf74323..0520d293 100644 --- a/vendor/fyne.io/fyne/v2/internal/driver/mobile/file_ios.m +++ b/vendor/fyne.io/fyne/v2/internal/driver/mobile/file_ios.m @@ -39,6 +39,7 @@ bool iosExistsPath(const char* path) { void iosCloseFileWriter(void* handlePtr) { NSFileHandle* handle = (NSFileHandle*)handlePtr; + [handle synchronizeFile]; [handle closeFile]; } diff --git a/vendor/fyne.io/fyne/v2/internal/metadata/data.go b/vendor/fyne.io/fyne/v2/internal/metadata/data.go index 6517c025..99c9df3d 100644 --- a/vendor/fyne.io/fyne/v2/internal/metadata/data.go +++ b/vendor/fyne.io/fyne/v2/internal/metadata/data.go @@ -6,7 +6,9 @@ type FyneApp struct { Details AppDetails Development map[string]string `toml:",omitempty"` Release map[string]string `toml:",omitempty"` + Source *AppSource `toml:",omitempty"` LinuxAndBSD *LinuxAndBSD `toml:",omitempty"` + Languages []string `toml:",omitempty"` } // AppDetails describes the build information, this group may be OS or arch specific @@ -17,6 +19,10 @@ type AppDetails struct { Build int `toml:",omitempty"` } +type AppSource struct { + Repo, Dir string `toml:",omitempty"` +} + // LinuxAndBSD describes specific metadata for desktop files on Linux and BSD. type LinuxAndBSD struct { GenericName string `toml:",omitempty"` diff --git a/vendor/fyne.io/fyne/v2/internal/painter/gl/draw.go b/vendor/fyne.io/fyne/v2/internal/painter/gl/draw.go index e1fc6abf..c4c1aecd 100644 --- a/vendor/fyne.io/fyne/v2/internal/painter/gl/draw.go +++ b/vendor/fyne.io/fyne/v2/internal/painter/gl/draw.go @@ -264,10 +264,8 @@ func (p *painter) drawTextureWithDetails(o fyne.CanvasObject, creator func(canva p.defineVertexArray(p.program, "vert", 3, 5, 0) p.defineVertexArray(p.program, "vertTexCoord", 2, 5, 3) - // here we have to choose between blending the image alpha or fading it... - // TODO find a way to support both if alpha != 1.0 { - p.ctx.BlendColor(0, 0, 0, alpha) + p.ctx.BlendColor(alpha, alpha, alpha, alpha) p.ctx.BlendFunc(constantAlpha, oneMinusConstantAlpha) } else { p.ctx.BlendFunc(one, oneMinusSrcAlpha) diff --git a/vendor/fyne.io/fyne/v2/internal/painter/gl/shaders.go b/vendor/fyne.io/fyne/v2/internal/painter/gl/shaders.go index fb7cf999..81e0b5b4 100644 --- a/vendor/fyne.io/fyne/v2/internal/painter/gl/shaders.go +++ b/vendor/fyne.io/fyne/v2/internal/painter/gl/shaders.go @@ -58,7 +58,7 @@ var shaderRoundrectangleesFrag = &fyne.StaticResource{ var shaderSimpleFrag = &fyne.StaticResource{ StaticName: "simple.frag", StaticContent: []byte( - "#version 110\n\nuniform sampler2D tex;\n\nvarying vec2 fragTexCoord;\n\nvoid main() {\n gl_FragColor = texture2D(tex, fragTexCoord);\n}\n"), + "#version 110\n\nuniform sampler2D tex;\n\nvarying vec2 fragTexCoord;\n\nvoid main() {\n vec4 texColor = texture2D(tex, fragTexCoord);\n if(texColor.a < 0.01)\n discard;\n gl_FragColor = texColor;\n}\n"), } var shaderSimpleVert = &fyne.StaticResource{ StaticName: "simple.vert", diff --git a/vendor/fyne.io/fyne/v2/internal/painter/gl/texture.go b/vendor/fyne.io/fyne/v2/internal/painter/gl/texture.go index 207ee6cd..5cfda8be 100644 --- a/vendor/fyne.io/fyne/v2/internal/painter/gl/texture.go +++ b/vendor/fyne.io/fyne/v2/internal/painter/gl/texture.go @@ -33,6 +33,30 @@ func (p *painter) freeTexture(obj fyne.CanvasObject) { } func (p *painter) getTexture(object fyne.CanvasObject, creator func(canvasObject fyne.CanvasObject) Texture) (Texture, error) { + if t, ok := object.(*canvas.Text); ok { + custom := "" + if t.FontSource != nil { + custom = t.FontSource.Name() + } + ent := cache.FontCacheEntry{Color: t.Color, Canvas: p.canvas} + ent.Text = t.Text + ent.Size = t.TextSize + ent.Style = t.TextStyle + ent.Source = custom + + texture, ok := cache.GetTextTexture(ent) + + if !ok { + tex := creator(object) + texture = cache.TextureType(tex) + cache.SetTextTexture(ent, texture, p.canvas, func() { + p.ctx.DeleteTexture(tex) + }) + } + + return Texture(texture), nil + } + texture, ok := cache.GetTexture(object) if !ok { diff --git a/vendor/fyne.io/fyne/v2/internal/painter/software/draw.go b/vendor/fyne.io/fyne/v2/internal/painter/software/draw.go index bd81c0b5..6cc880fb 100644 --- a/vendor/fyne.io/fyne/v2/internal/painter/software/draw.go +++ b/vendor/fyne.io/fyne/v2/internal/painter/software/draw.go @@ -3,6 +3,7 @@ package software import ( "fmt" "image" + "image/color" "math" "fyne.io/fyne/v2" @@ -46,7 +47,7 @@ func drawGradient(c fyne.Canvas, g gradient, pos fyne.Position, base *image.NRGB width := scale.ToScreenCoordinate(c, bounds.Width) height := scale.ToScreenCoordinate(c, bounds.Height) tex := g.Generate(width, height) - drawTex(scale.ToScreenCoordinate(c, pos.X), scale.ToScreenCoordinate(c, pos.Y), width, height, base, tex, clip) + drawTex(scale.ToScreenCoordinate(c, pos.X), scale.ToScreenCoordinate(c, pos.Y), width, height, base, tex, clip, 1.0) } func drawImage(c fyne.Canvas, img *canvas.Image, pos fyne.Position, base *image.NRGBA, clip image.Rectangle) { @@ -75,13 +76,13 @@ func drawImage(c fyne.Canvas, img *canvas.Image, pos fyne.Position, base *image. } } - drawPixels(scaledX, scaledY, width, height, img.ScaleMode, base, origImg, clip) + drawPixels(scaledX, scaledY, width, height, img.ScaleMode, base, origImg, clip, img.Alpha()) } -func drawPixels(x, y, width, height int, mode canvas.ImageScale, base *image.NRGBA, origImg image.Image, clip image.Rectangle) { +func drawPixels(x, y, width, height int, mode canvas.ImageScale, base *image.NRGBA, origImg image.Image, clip image.Rectangle, alpha float64) { if origImg.Bounds().Dx() == width && origImg.Bounds().Dy() == height { // do not scale or duplicate image since not needed, draw directly - drawTex(x, y, width, height, base, origImg, clip) + drawTex(x, y, width, height, base, origImg, clip, alpha) return } @@ -99,7 +100,7 @@ func drawPixels(x, y, width, height int, mode canvas.ImageScale, base *image.NRG draw.CatmullRom.Scale(scaledImg, scaledBounds, origImg, origImg.Bounds(), draw.Over, nil) } - drawTex(x, y, width, height, base, scaledImg, clip) + drawTex(x, y, width, height, base, scaledImg, clip, alpha) } func drawLine(c fyne.Canvas, line *canvas.Line, pos fyne.Position, base *image.NRGBA, clip image.Rectangle) { @@ -124,11 +125,16 @@ func drawLine(c fyne.Canvas, line *canvas.Line, pos fyne.Position, base *image.N draw.Draw(base, bounds, raw, image.Point{offX, offY}, draw.Over) } -func drawTex(x, y, width, height int, base *image.NRGBA, tex image.Image, clip image.Rectangle) { +func drawTex(x, y, width, height int, base *image.NRGBA, tex image.Image, clip image.Rectangle, alpha float64) { outBounds := image.Rect(x, y, x+width, y+height) clippedBounds := clip.Intersect(outBounds) srcPt := image.Point{X: clippedBounds.Min.X - outBounds.Min.X, Y: clippedBounds.Min.Y - outBounds.Min.Y} - draw.Draw(base, clippedBounds, tex, srcPt, draw.Over) + if alpha == 1.0 { + draw.Draw(base, clippedBounds, tex, srcPt, draw.Over) + } else { + mask := &image.Uniform{C: color.NRGBA{R: 0xff, G: 0xff, B: 0xff, A: uint8(float64(0xff) * alpha)}} + draw.DrawMask(base, clippedBounds, tex, srcPt, mask, srcPt, draw.Over) + } } func drawText(c fyne.Canvas, text *canvas.Text, pos fyne.Position, base *image.NRGBA, clip image.Rectangle) { @@ -176,9 +182,9 @@ func drawRaster(c fyne.Canvas, rast *canvas.Raster, pos fyne.Position, base *ima pix := rast.Generator(width, height) if pix.Bounds().Bounds().Dx() != width || pix.Bounds().Dy() != height { - drawPixels(scaledX, scaledY, width, height, rast.ScaleMode, base, pix, clip) + drawPixels(scaledX, scaledY, width, height, rast.ScaleMode, base, pix, clip, 1.0) } else { - drawTex(scaledX, scaledY, width, height, base, pix, clip) + drawTex(scaledX, scaledY, width, height, base, pix, clip, 1.0) } } diff --git a/vendor/fyne.io/fyne/v2/internal/repository/file.go b/vendor/fyne.io/fyne/v2/internal/repository/file.go index 45837cd4..8b6342a8 100644 --- a/vendor/fyne.io/fyne/v2/internal/repository/file.go +++ b/vendor/fyne.io/fyne/v2/internal/repository/file.go @@ -171,15 +171,14 @@ func (r *FileRepository) Parent(u fyne.URI) (fyne.URI, error) { // trim the scheme s = strings.TrimPrefix(s, fileSchemePrefix) - // Completely empty URI with just a scheme - if s == "" { + // Completely empty URI or only root component + if s == "" || s == "/" || (len(s) == 2 && s[1] == ':') { return nil, repository.ErrURIRoot } - parent := "" - // use the system native path resolution - parent = filepath.Dir(s) - if parent[len(parent)-1] != filepath.Separator { + child := filepath.Base(s) + parent := s[:len(s)-len(child)] // avoid filepath.Dir as it follows platform rules + if parent == "" || parent[len(parent)-1] != '/' { parent += "/" } diff --git a/vendor/fyne.io/fyne/v2/internal/svg/svg.go b/vendor/fyne.io/fyne/v2/internal/svg/svg.go index c89be41d..9e78efc3 100644 --- a/vendor/fyne.io/fyne/v2/internal/svg/svg.go +++ b/vendor/fyne.io/fyne/v2/internal/svg/svg.go @@ -119,8 +119,8 @@ func IsResourceSVG(res fyne.Resource) bool { type svg struct { XMLName xml.Name `xml:"svg"` XMLNS string `xml:"xmlns,attr"` - Width string `xml:"width,attr"` - Height string `xml:"height,attr"` + Width string `xml:"width,attr,omitempty"` + Height string `xml:"height,attr,omitempty"` ViewBox string `xml:"viewBox,attr,omitempty"` Paths []*pathObj `xml:"path"` Rects []*rectObj `xml:"rect"` @@ -140,6 +140,7 @@ type pathObj struct { StrokeLineJoin string `xml:"stroke-linejoin,attr,omitempty"` StrokeDashArray string `xml:"stroke-dasharray,attr,omitempty"` D string `xml:"d,attr"` + Transform string `xml:"transform,attr,omitempty"` } type rectObj struct { @@ -155,6 +156,7 @@ type rectObj struct { Y string `xml:"y,attr,omitempty"` Width string `xml:"width,attr,omitempty"` Height string `xml:"height,attr,omitempty"` + Transform string `xml:"transform,attr,omitempty"` } type circleObj struct { @@ -169,6 +171,7 @@ type circleObj struct { CX string `xml:"cx,attr,omitempty"` CY string `xml:"cy,attr,omitempty"` R string `xml:"r,attr,omitempty"` + Transform string `xml:"transform,attr,omitempty"` } type ellipseObj struct { @@ -184,6 +187,7 @@ type ellipseObj struct { CY string `xml:"cy,attr,omitempty"` RX string `xml:"rx,attr,omitempty"` RY string `xml:"ry,attr,omitempty"` + Transform string `xml:"transform,attr,omitempty"` } type polygonObj struct { @@ -196,6 +200,7 @@ type polygonObj struct { StrokeLineJoin string `xml:"stroke-linejoin,attr,omitempty"` StrokeDashArray string `xml:"stroke-dasharray,attr,omitempty"` Points string `xml:"points,attr"` + Transform string `xml:"transform,attr,omitempty"` } type objGroup struct { @@ -207,6 +212,7 @@ type objGroup struct { StrokeLineCap string `xml:"stroke-linecap,attr,omitempty"` StrokeLineJoin string `xml:"stroke-linejoin,attr,omitempty"` StrokeDashArray string `xml:"stroke-dasharray,attr,omitempty"` + Transform string `xml:"transform,attr,omitempty"` Paths []*pathObj `xml:"path"` Circles []*circleObj `xml:"circle"` Ellipses []*ellipseObj `xml:"ellipse"` diff --git a/vendor/fyne.io/fyne/v2/lang/locale.go b/vendor/fyne.io/fyne/v2/lang/locale.go index 77f396fe..93b43623 100644 --- a/vendor/fyne.io/fyne/v2/lang/locale.go +++ b/vendor/fyne.io/fyne/v2/lang/locale.go @@ -14,13 +14,13 @@ func SystemLocale() fyne.Locale { if err != nil { fyne.LogError("Failed to look up user locale", err) } - if loc == "" { + if len(loc) < 2 { loc = "en" } tag, err := language.Parse(loc) if err != nil { - fyne.LogError("Error parsing user locale", err) + fyne.LogError("Error parsing user locale "+loc, err) } return localeFromTag(tag) } @@ -32,7 +32,7 @@ func closestSupportedLocale(locs []string) fyne.Locale { for i, loc := range locs { tag, err := language.Parse(loc) if err != nil { - fyne.LogError("Error parsing user locale", err) + fyne.LogError("Error parsing user locale "+loc, err) } tags[i] = tag } diff --git a/vendor/fyne.io/fyne/v2/lang/translations/base.es.json b/vendor/fyne.io/fyne/v2/lang/translations/base.es.json new file mode 100644 index 00000000..587f444e --- /dev/null +++ b/vendor/fyne.io/fyne/v2/lang/translations/base.es.json @@ -0,0 +1,47 @@ +{ + "Advanced": "Avanzado", + "Cancel": "Cancelar", + "Confirm": "Confirmar", + "Copy": "Copiar", + "Create Folder": "Crear Carpeta", + "Cut": "Cortar", + "Enter filename": "Introduzca nombres del archivo", + "Error": "Error", + "Favourites": "Favoritos", + "File": "Archivo", + "Folder": "Carpeta", + "New Folder": "Nueva Carpeta", + "No": "No", + "OK": "OK", + "Open": "Abrir", + "Paste": "Pegar", + "Quit": "Salir", + "Redo": "Rehacer", + "Save": "Guardar", + "Select all": "Seleccionar todo", + "Show Hidden Files": "Mostrar archivos ocultos", + "Undo": "Deshacer", + "Yes": "Si", + + "file.name": { + "other": "Nombre" + }, + "file.parent": { + "other": "Padre" + }, + + "monday": "Lunes", + "monday.short": "Lun", + "tuesday": "Martes", + "tuesday.short": "Mar", + "wednesday": "Miércoles", + "wednesday.short": "Mie", + "thursday": "Jueves", + "thursday.short": "Jue", + "friday": "Viernes", + "friday.short": "Vie", + "saturday": "Sábado", + "saturday.short": "Sab", + "sunday": "Domingo", + "sunday.short": "Dom" +} diff --git a/vendor/fyne.io/fyne/v2/menu.go b/vendor/fyne.io/fyne/v2/menu.go index 7a3c5473..eadf0485 100644 --- a/vendor/fyne.io/fyne/v2/menu.go +++ b/vendor/fyne.io/fyne/v2/menu.go @@ -48,7 +48,7 @@ type MenuItem struct { IsQuit bool IsSeparator bool Label string - Action func() + Action func() `json:"-"` // Since: 2.1 Disabled bool // Since: 2.1 diff --git a/vendor/fyne.io/fyne/v2/storage/uri.go b/vendor/fyne.io/fyne/v2/storage/uri.go index 5a8974a3..36b2c08a 100644 --- a/vendor/fyne.io/fyne/v2/storage/uri.go +++ b/vendor/fyne.io/fyne/v2/storage/uri.go @@ -1,12 +1,31 @@ package storage import ( + "path/filepath" + "fyne.io/fyne/v2" "fyne.io/fyne/v2/storage/repository" ) // NewFileURI creates a new URI from the given file path. +// Relative paths will be converted to absolute using filepath.Abs if required. func NewFileURI(path string) fyne.URI { + assumeAbs := false // avoid filepath.IsAbs as it follows platform rules + if len(path) >= 1 { + if path[0] == '/' { + assumeAbs = true + } else if len(path) >= 2 { + assumeAbs = path[1] == ':' + } + } + + if !assumeAbs { + absolute, err := filepath.Abs(path) + if err == nil { + path = absolute + } + } + return repository.NewFileURI(path) } diff --git a/vendor/fyne.io/fyne/v2/theme/json.go b/vendor/fyne.io/fyne/v2/theme/json.go index a0bbf81b..78d26f18 100644 --- a/vendor/fyne.io/fyne/v2/theme/json.go +++ b/vendor/fyne.io/fyne/v2/theme/json.go @@ -27,12 +27,16 @@ func FromJSON(data string) (fyne.Theme, error) { // // Since: 2.2 func FromJSONReader(r io.Reader) (fyne.Theme, error) { + return fromJSONWithFallback(r, DefaultTheme()) +} + +func fromJSONWithFallback(r io.Reader, fallback fyne.Theme) (fyne.Theme, error) { var th *schema if err := json.NewDecoder(r).Decode(&th); err != nil { - return DefaultTheme(), err + return fallback, err } - return &jsonTheme{data: th, fallback: DefaultTheme()}, nil + return &jsonTheme{data: th, fallback: fallback}, nil } type hexColor string diff --git a/vendor/fyne.io/fyne/v2/theme/theme.go b/vendor/fyne.io/fyne/v2/theme/theme.go index c9774566..f59b4b8d 100644 --- a/vendor/fyne.io/fyne/v2/theme/theme.go +++ b/vendor/fyne.io/fyne/v2/theme/theme.go @@ -2,11 +2,14 @@ package theme // import "fyne.io/fyne/v2/theme" import ( + "bytes" "image/color" "os" + "path/filepath" "strings" "fyne.io/fyne/v2" + internalApp "fyne.io/fyne/v2/internal/app" "fyne.io/fyne/v2/internal/cache" internaltheme "fyne.io/fyne/v2/internal/theme" ) @@ -24,7 +27,7 @@ const ( VariantLight = internaltheme.VariantLight ) -var defaultTheme fyne.Theme +var defaultTheme, systemTheme fyne.Theme // DarkTheme defines the built-in dark theme colors and sizes. // @@ -45,6 +48,11 @@ func DefaultTheme() fyne.Theme { defaultTheme = setupDefaultTheme() } + // check system too + if systemTheme != nil { + return systemTheme + } + return defaultTheme } @@ -376,7 +384,30 @@ func selectionColorNamed(name string) color.NRGBA { func setupDefaultTheme() fyne.Theme { theme := &builtinTheme{variant: internaltheme.VariantNameUserPreference} - theme.initFonts() + + systemTheme = setupSystemTheme(theme) + return theme } + +func setupSystemTheme(fallback fyne.Theme) fyne.Theme { + root := internalApp.RootConfigDir() + + path := filepath.Join(root, "theme.json") + data, err := fyne.LoadResourceFromPath(path) + if err != nil { + if !os.IsNotExist(err) { + fyne.LogError("Failed to load user theme file: "+path, err) + } + return nil + } + if data != nil && data.Content() != nil { + th, err := fromJSONWithFallback(bytes.NewReader(data.Content()), fallback) + if err == nil { + return th + } + fyne.LogError("Failed to parse user theme file: "+path, err) + } + return nil +} diff --git a/vendor/fyne.io/fyne/v2/uri.go b/vendor/fyne.io/fyne/v2/uri.go index a4228306..0991cb62 100644 --- a/vendor/fyne.io/fyne/v2/uri.go +++ b/vendor/fyne.io/fyne/v2/uri.go @@ -23,9 +23,10 @@ type URIWriteCloser interface { // URI represents the identifier of a resource on a target system. This // resource may be a file or another data source such as an app or file sharing -// system. +// system. The URI represents an absolute location of a resource, it is up to any +// parse or constructor implementations to ensure that relative resources are made absolute. // -// In general, it is expected that URI implementations follow IETF RFC3896. +// In general, it is expected that URI implementations follow IETF RFC3986. // Implementations are highly recommended to utilize [net/url] to implement URI // parsing methods, especially [net/url/url.Scheme], [net/url/url.Authority], // [net/url/url.Path], [net/url/url.Query], and [net/url/url.Fragment]. diff --git a/vendor/fyne.io/fyne/v2/widget/check.go b/vendor/fyne.io/fyne/v2/widget/check.go index 22cf72d4..8ecf04b7 100644 --- a/vendor/fyne.io/fyne/v2/widget/check.go +++ b/vendor/fyne.io/fyne/v2/widget/check.go @@ -363,7 +363,9 @@ func (c *checkRenderer) updateResource(th fyne.Theme) { bgRes.ColorName = theme.ColorNameBackground } c.icon.Resource = res + c.icon.Refresh() c.bg.Resource = bgRes + c.bg.Refresh() } // must be called while holding c.check.propertyLock for reading diff --git a/vendor/fyne.io/fyne/v2/widget/entry_password.go b/vendor/fyne.io/fyne/v2/widget/entry_password.go index ff8f75d4..45f98927 100644 --- a/vendor/fyne.io/fyne/v2/widget/entry_password.go +++ b/vendor/fyne.io/fyne/v2/widget/entry_password.go @@ -83,5 +83,5 @@ func (r *passwordRevealerRenderer) Refresh() { if r.entry.disabled.Load() { r.icon.Resource = theme.NewDisabledResource(r.icon.Resource) } - canvas.Refresh(r.icon) + r.icon.Refresh() } diff --git a/vendor/fyne.io/fyne/v2/widget/fileicon.go b/vendor/fyne.io/fyne/v2/widget/fileicon.go index ec93f693..b2249ca6 100644 --- a/vendor/fyne.io/fyne/v2/widget/fileicon.go +++ b/vendor/fyne.io/fyne/v2/widget/fileicon.go @@ -184,11 +184,6 @@ func (s *fileIconRenderer) Refresh() { s.file.setURI(s.file.URI) s.file.propertyLock.Unlock() - s.file.propertyLock.RLock() - s.img.Resource = s.file.resource - s.ext.Text = s.file.extension - s.file.propertyLock.RUnlock() - if s.file.Selected { s.background.Show() s.ext.Color = th.Color(theme.ColorNameSelection, v) @@ -203,9 +198,18 @@ func (s *fileIconRenderer) Refresh() { } } - s.img.Refresh() + s.file.propertyLock.RLock() + if s.img.Resource != s.file.resource { + s.img.Resource = s.file.resource + s.img.Refresh() + } + if s.ext.Text != s.file.extension { + s.ext.Text = s.file.extension + s.ext.Refresh() + } + s.file.propertyLock.RUnlock() + canvas.Refresh(s.file.super()) - canvas.Refresh(s.ext) } func trimmedExtension(uri fyne.URI) string { diff --git a/vendor/fyne.io/fyne/v2/widget/menu_item.go b/vendor/fyne.io/fyne/v2/widget/menu_item.go index eb70a3fa..9eecdd08 100644 --- a/vendor/fyne.io/fyne/v2/widget/menu_item.go +++ b/vendor/fyne.io/fyne/v2/widget/menu_item.go @@ -11,47 +11,20 @@ import ( "fyne.io/fyne/v2/theme" ) -// TODO - -const ( - runeModifierAlt = '⌥' - runeModifierControl = '⌃' - runeModifierShift = '⇧' -) - -var keySymbols = map[fyne.KeyName]rune{ - fyne.KeyBackspace: '⌫', - fyne.KeyDelete: '⌦', - fyne.KeyDown: '↓', - fyne.KeyEnd: '↘', - fyne.KeyEnter: '↩', - fyne.KeyEscape: '⎋', - fyne.KeyHome: '↖', - fyne.KeyLeft: '←', - fyne.KeyPageDown: '⇟', - fyne.KeyPageUp: '⇞', - fyne.KeyReturn: '↩', - fyne.KeyRight: '→', - fyne.KeySpace: '␣', - fyne.KeyTab: '⇥', - fyne.KeyUp: '↑', -} - var _ fyne.Widget = (*menuItem)(nil) // menuItem is a widget for displaying a fyne.menuItem. type menuItem struct { widget.Base - Item *fyne.MenuItem - Parent *Menu + Item *fyne.MenuItem - alignment fyne.TextAlign - child *Menu + alignment fyne.TextAlign + child, parent *Menu } // newMenuItem creates a new menuItem. func newMenuItem(item *fyne.MenuItem, parent *Menu) *menuItem { - i := &menuItem{Item: item, Parent: parent} + i := &menuItem{Item: item, parent: parent} i.alignment = parent.alignment i.ExtendBaseWidget(i) return i @@ -61,7 +34,7 @@ func (i *menuItem) Child() *Menu { if i.Item.ChildMenu != nil && i.child == nil { child := NewMenu(i.Item.ChildMenu) child.Hide() - child.OnDismiss = i.Parent.Dismiss + child.OnDismiss = i.parent.Dismiss i.child = child } return i.child @@ -71,7 +44,7 @@ func (i *menuItem) Child() *Menu { // // Implements: fyne.Widget func (i *menuItem) CreateRenderer() fyne.WidgetRenderer { - th := i.Parent.Theme() + th := i.parent.Theme() v := fyne.CurrentApp().Settings().ThemeVariant() background := canvas.NewRectangle(th.Color(theme.ColorNameHover, v)) @@ -165,7 +138,7 @@ func (i *menuItem) activate() { if i.Child() != nil { i.Child().Show() } - i.Parent.activateItem(i) + i.parent.activateItem(i) } func (i *menuItem) activateLastSubmenu() bool { @@ -184,7 +157,7 @@ func (i *menuItem) deactivate() { if i.Child() != nil { i.Child().Hide() } - i.Parent.DeactivateChild() + i.parent.DeactivateChild() } func (i *menuItem) deactivateLastSubmenu() bool { @@ -199,7 +172,7 @@ func (i *menuItem) deactivateLastSubmenu() bool { } func (i *menuItem) isActive() bool { - return i.Parent.activeItem == i + return i.parent.activeItem == i } func (i *menuItem) isSubmenuOpen() bool { @@ -207,7 +180,7 @@ func (i *menuItem) isSubmenuOpen() bool { } func (i *menuItem) trigger() { - i.Parent.Dismiss() + i.parent.Dismiss() if i.Item.Action != nil { i.Item.Action() } @@ -235,7 +208,7 @@ type menuItemRenderer struct { } func (r *menuItemRenderer) Layout(size fyne.Size) { - th := r.i.Parent.Theme() + th := r.i.parent.Theme() innerPad := th.Size(theme.SizeNameInnerPadding) inlineIcon := th.Size(theme.SizeNameInlineIcon) @@ -284,7 +257,7 @@ func (r *menuItemRenderer) MinSize() fyne.Size { return r.minSize } - th := r.i.Parent.Theme() + th := r.i.parent.Theme() innerPad := th.Size(theme.SizeNameInnerPadding) inlineIcon := th.Size(theme.SizeNameInlineIcon) innerPad2 := innerPad * 2 @@ -308,7 +281,7 @@ func (r *menuItemRenderer) MinSize() fyne.Size { } func (r *menuItemRenderer) updateVisuals() { - th := r.i.Parent.Theme() + th := r.i.parent.Theme() v := fyne.CurrentApp().Settings().ThemeVariant() r.background.CornerRadius = th.Size(theme.SizeNameSelectionRadius) if fyne.CurrentDevice().IsMobile() { @@ -342,14 +315,14 @@ func (r *menuItemRenderer) Refresh() { } func (r *menuItemRenderer) checkSpace() float32 { - if r.i.Parent.containsCheck { + if r.i.parent.containsCheck { return theme.IconInlineSize() + theme.InnerPadding() } return 0 } func (r *menuItemRenderer) minSizeUnchanged() bool { - th := r.i.Parent.Theme() + th := r.i.parent.Theme() return !r.minSize.IsZero() && r.text.TextSize == th.Size(theme.SizeNameText) && @@ -369,7 +342,7 @@ func (r *menuItemRenderer) updateIcon(img *canvas.Image, rsc fyne.Resource) { } func (r *menuItemRenderer) refreshText(text *canvas.Text, shortcut bool) { - th := r.i.Parent.Theme() + th := r.i.parent.Theme() v := fyne.CurrentApp().Settings().ThemeVariant() text.TextSize = th.Size(theme.SizeNameText) @@ -392,33 +365,38 @@ func shortcutColor(th fyne.Theme) color.Color { return color.NRGBA{R: uint8(r), G: uint8(g), B: uint8(b), A: uint8(a)} } -func textsForShortcut(s fyne.KeyboardShortcut, th fyne.Theme) (texts []*canvas.Text) { +func textsForShortcut(sc fyne.KeyboardShortcut, th fyne.Theme) (texts []*canvas.Text) { + // add modifier b := strings.Builder{} - mods := s.Mod() + mods := sc.Mod() if mods&fyne.KeyModifierControl != 0 { - b.WriteRune(runeModifierControl) + b.WriteString(textModifierControl) } if mods&fyne.KeyModifierAlt != 0 { - b.WriteRune(runeModifierAlt) + b.WriteString(textModifierAlt) } if mods&fyne.KeyModifierShift != 0 { - b.WriteRune(runeModifierShift) + b.WriteString(textModifierShift) } if mods&fyne.KeyModifierSuper != 0 { - b.WriteRune(runeModifierSuper) - } - r := keySymbols[s.Key()] - if r != 0 { - b.WriteRune(r) + b.WriteString(textModifierSuper) } shortColor := shortcutColor(th) - t := canvas.NewText(b.String(), shortColor) - t.TextStyle.Symbol = true + if b.Len() > 0 { + t := canvas.NewText(b.String(), shortColor) + t.TextStyle = styleModifiers + texts = append(texts, t) + } + // add key + style := defaultStyleKeys + s, ok := keyTexts[sc.Key()] + if !ok { + s = string(sc.Key()) + } else if len(s) == 1 { + style = fyne.TextStyle{Symbol: true} + } + t := canvas.NewText(s, shortColor) + t.TextStyle = style texts = append(texts, t) - if r == 0 { - text := canvas.NewText(string(s.Key()), shortColor) - text.TextStyle.Monospace = true - texts = append(texts, text) - } return } diff --git a/vendor/fyne.io/fyne/v2/widget/menu_item_darwin.go b/vendor/fyne.io/fyne/v2/widget/menu_item_darwin.go index eb10eba3..099d2fb1 100644 --- a/vendor/fyne.io/fyne/v2/widget/menu_item_darwin.go +++ b/vendor/fyne.io/fyne/v2/widget/menu_item_darwin.go @@ -1,3 +1,35 @@ package widget -const runeModifierSuper = '⌘' +import ( + "fyne.io/fyne/v2" +) + +const ( + textModifierAlt = "⌥" + textModifierControl = "⌃" + textModifierShift = "⇧" + textModifierSuper = "⌘" +) + +var ( + styleModifiers = fyne.TextStyle{Symbol: true} + defaultStyleKeys = fyne.TextStyle{Monospace: true} +) + +var keyTexts = map[fyne.KeyName]string{ + fyne.KeyBackspace: "⌫", + fyne.KeyDelete: "⌦", + fyne.KeyDown: "↓", + fyne.KeyEnd: "↘", + fyne.KeyEnter: "↩", + fyne.KeyEscape: "⎋", + fyne.KeyHome: "↖", + fyne.KeyLeft: "←", + fyne.KeyPageDown: "⇟", + fyne.KeyPageUp: "⇞", + fyne.KeyReturn: "↩", + fyne.KeyRight: "→", + fyne.KeySpace: "␣", + fyne.KeyTab: "⇥", + fyne.KeyUp: "↑", +} diff --git a/vendor/fyne.io/fyne/v2/widget/menu_item_other.go b/vendor/fyne.io/fyne/v2/widget/menu_item_other.go index 6c8f5522..6a63f642 100644 --- a/vendor/fyne.io/fyne/v2/widget/menu_item_other.go +++ b/vendor/fyne.io/fyne/v2/widget/menu_item_other.go @@ -2,4 +2,36 @@ package widget -const runeModifierSuper = '❖' +import ( + "fyne.io/fyne/v2" +) + +const ( + textModifierAlt = "Alt+" + textModifierControl = "Ctrl+" + textModifierShift = "Shift+" + textModifierSuper = "Super+" +) + +var ( + styleModifiers = fyne.TextStyle{} + defaultStyleKeys = fyne.TextStyle{} +) + +var keyTexts = map[fyne.KeyName]string{ + fyne.KeyBackspace: "Backspace", + fyne.KeyDelete: "Del", + fyne.KeyDown: "↓", + fyne.KeyEnd: "End", + fyne.KeyEnter: "Enter", + fyne.KeyEscape: "Esc", + fyne.KeyHome: "Home", + fyne.KeyLeft: "←", + fyne.KeyPageDown: "PgDn", + fyne.KeyPageUp: "PgUp", + fyne.KeyReturn: "Return", + fyne.KeyRight: "→", + fyne.KeySpace: "Space", + fyne.KeyTab: "Tab", + fyne.KeyUp: "↑", +} diff --git a/vendor/fyne.io/fyne/v2/widget/radio_item.go b/vendor/fyne.io/fyne/v2/widget/radio_item.go index fbcf075e..2aa9da11 100644 --- a/vendor/fyne.io/fyne/v2/widget/radio_item.go +++ b/vendor/fyne.io/fyne/v2/widget/radio_item.go @@ -207,7 +207,9 @@ func (r *radioItemRenderer) update() { out.ColorName = theme.ColorNameDisabled } r.icon.Resource = in + r.icon.Refresh() r.over.Resource = out + r.over.Refresh() if r.item.Disabled() { r.focusIndicator.FillColor = color.Transparent diff --git a/vendor/modules.txt b/vendor/modules.txt index c2a8a1f0..655103f6 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# fyne.io/fyne/v2 v2.5.2 +# fyne.io/fyne/v2 v2.5.3 ## explicit; go 1.19 fyne.io/fyne/v2 fyne.io/fyne/v2/app