Skip to content

Commit 3adf86d

Browse files
committed
Fix window icons (macOS).
1 parent 2bedb36 commit 3adf86d

File tree

10 files changed

+26
-12
lines changed

10 files changed

+26
-12
lines changed

color_darwin.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ func selectColor(opts options) (color.Color, error) {
1010
var data zenutil.Color
1111
if opts.attach != nil {
1212
data.Application = opts.attach
13-
} else if i, ok := opts.windowIcon.(string); ok {
13+
}
14+
if i, ok := opts.windowIcon.(string); ok {
1415
data.WindowIcon = i
1516
}
1617

date_darwin.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ func calendar(text string, opts options) (t time.Time, err error) {
2525
} else {
2626
data.Text = text
2727
}
28+
if opts.attach != nil {
29+
data.Application = opts.attach
30+
}
2831
if i, ok := opts.windowIcon.(string); ok {
2932
data.WindowIcon = i
3033
}

entry_darwin.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ func entry(text string, opts options) (string, error) {
1616
data.Options.Timeout = zenutil.Timeout
1717
if opts.attach != nil {
1818
data.Application = opts.attach
19-
} else if i, ok := opts.windowIcon.(string); ok {
19+
}
20+
if i, ok := opts.windowIcon.(string); ok {
2021
data.WindowIcon = i
2122
}
2223
switch i := opts.icon.(type) {

file_darwin.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ func selectFile(opts options) (string, error) {
99
data.Options.Location, _ = splitDirAndName(opts.filename)
1010
if opts.attach != nil {
1111
data.Application = opts.attach
12-
} else if i, ok := opts.windowIcon.(string); ok {
12+
}
13+
if i, ok := opts.windowIcon.(string); ok {
1314
data.WindowIcon = i
1415
}
1516

@@ -33,7 +34,8 @@ func selectFileMultiple(opts options) ([]string, error) {
3334
data.Separator = zenutil.Separator
3435
if opts.attach != nil {
3536
data.Application = opts.attach
36-
} else if i, ok := opts.windowIcon.(string); ok {
37+
}
38+
if i, ok := opts.windowIcon.(string); ok {
3739
data.WindowIcon = i
3840
}
3941

@@ -55,7 +57,8 @@ func selectFileSave(opts options) (string, error) {
5557
data.Options.Location, data.Options.Name = splitDirAndName(opts.filename)
5658
if opts.attach != nil {
5759
data.Application = opts.attach
58-
} else if i, ok := opts.windowIcon.(string); ok {
60+
}
61+
if i, ok := opts.windowIcon.(string); ok {
5962
data.WindowIcon = i
6063
}
6164

internal/zenutil/osa_generated.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/zenutil/osascripts/common.gojs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
var app = Application.currentApplication()
55
{{- end}}
66

7-
{{- if .WindowIcon}}{
7+
{{if .WindowIcon}}{
88
ObjC.import('Cocoa')
99
let nsapp = $.NSApplication.sharedApplication
1010
let nsimg = $.NSImage.alloc.initWithContentsOfFile({{json .WindowIcon}})
1111
nsapp.setActivationPolicy($.NSApplicationActivationPolicyRegular)
1212
nsapp.setApplicationIconImage(nsimg)
13-
}{{- end}}
13+
}{{end}}
1414

1515
app.includeStandardAdditions = true
1616
app.activate()

list_darwin.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ func list(text string, items []string, opts options) (string, error) {
2424
data.Options.Empty = !opts.disallowEmpty
2525
if opts.attach != nil {
2626
data.Application = opts.attach
27-
} else if i, ok := opts.windowIcon.(string); ok {
27+
}
28+
if i, ok := opts.windowIcon.(string); ok {
2829
data.WindowIcon = i
2930
}
3031

msg_darwin.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ func message(kind messageKind, text string, opts options) error {
1212
data.Options.Timeout = zenutil.Timeout
1313
if opts.attach != nil {
1414
data.Application = opts.attach
15-
} else if i, ok := opts.windowIcon.(string); ok {
15+
}
16+
if i, ok := opts.windowIcon.(string); ok {
1617
data.WindowIcon = i
1718
}
1819

progress_darwin.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ func progress(opts options) (ProgressDialog, error) {
1919
if opts.maxValue >= 0 {
2020
data.Total = &opts.maxValue
2121
}
22+
if opts.attach != nil {
23+
data.Application = opts.attach
24+
}
2225
if i, ok := opts.windowIcon.(string); ok {
2326
data.WindowIcon = i
2427
}

pwd_darwin.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ func password(opts options) (string, string, error) {
2020
data.Options.Timeout = zenutil.Timeout
2121
if opts.attach != nil {
2222
data.Application = opts.attach
23-
} else if i, ok := opts.windowIcon.(string); ok {
23+
}
24+
if i, ok := opts.windowIcon.(string); ok {
2425
data.WindowIcon = i
2526
}
2627
switch i := opts.icon.(type) {

0 commit comments

Comments
 (0)