From 30c915d73b615bf111db25b47022daf4ff2423a5 Mon Sep 17 00:00:00 2001 From: Alexei Anoshenko Date: Tue, 27 Feb 2024 17:08:05 +0300 Subject: [PATCH] Bug fixing --- appServer.go | 6 +++--- image.go | 4 ++-- listView.go | 32 ++++++++++++++++---------------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/appServer.go b/appServer.go index 275567a..6979145 100644 --- a/appServer.go +++ b/appServer.go @@ -169,10 +169,10 @@ func (app *application) socketReader(bridge webBridge) { session.handleAnswer(obj) case "imageLoaded": - session.imageManager().imageLoaded(obj, session) + session.imageManager().imageLoaded(obj) case "imageError": - session.imageManager().imageLoadError(obj, session) + session.imageManager().imageLoadError(obj) default: events <- obj @@ -295,7 +295,7 @@ func OpenBrowser(url string) bool { case "linux": for _, provider := range []string{"xdg-open", "x-www-browser", "www-browser"} { if _, err = exec.LookPath(provider); err == nil { - if exec.Command(provider, url).Start(); err == nil { + if err = exec.Command(provider, url).Start(); err == nil { return true } } diff --git a/image.go b/image.go index 007afb8..fb7e154 100644 --- a/image.go +++ b/image.go @@ -83,7 +83,7 @@ func (manager *imageManager) loadImage(url string, onLoaded func(Image), session return image } -func (manager *imageManager) imageLoaded(obj DataObject, session Session) { +func (manager *imageManager) imageLoaded(obj DataObject) { if manager.images == nil { manager.images = make(map[string]*imageData) return @@ -109,7 +109,7 @@ func (manager *imageManager) imageLoaded(obj DataObject, session Session) { } } -func (manager *imageManager) imageLoadError(obj DataObject, session Session) { +func (manager *imageManager) imageLoadError(obj DataObject) { if manager.images == nil { manager.images = make(map[string]*imageData) return diff --git a/listView.go b/listView.go index 5a3b0e3..94cd3ab 100644 --- a/listView.go +++ b/listView.go @@ -589,7 +589,7 @@ func (listView *listViewData) getItemFrames() []Frame { return listView.itemFrame } -func (listView *listViewData) itemAlign(self View, buffer *strings.Builder) { +func (listView *listViewData) itemAlign(buffer *strings.Builder) { values := enumProperties[ItemHorizontalAlign].cssValues if hAlign := GetListItemHorizontalAlign(listView); hAlign >= 0 && hAlign < len(values) { buffer.WriteString(" justify-items: ") @@ -605,7 +605,7 @@ func (listView *listViewData) itemAlign(self View, buffer *strings.Builder) { } } -func (listView *listViewData) itemSize(self View, buffer *strings.Builder) { +func (listView *listViewData) itemSize(buffer *strings.Builder) { if itemWidth := GetListItemWidth(listView); itemWidth.Type != Auto { buffer.WriteString(` min-width: `) buffer.WriteString(itemWidth.cssString("", listView.Session())) @@ -619,14 +619,14 @@ func (listView *listViewData) itemSize(self View, buffer *strings.Builder) { } } -func (listView *listViewData) getDivs(self View, checkbox, hCheckboxAlign, vCheckboxAlign int) (string, string, string) { +func (listView *listViewData) getDivs(checkbox, hCheckboxAlign, vCheckboxAlign int) (string, string, string) { session := listView.Session() contentBuilder := allocStringBuilder() defer freeStringBuilder(contentBuilder) contentBuilder.WriteString(`
`)