Skip to content

Commit

Permalink
Allow developers to skip macOS icon processing
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed May 12, 2023
1 parent 3e17fe7 commit d01ee32
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ More detailed release notes can be found on the [releases page](https://github.c
## Changed

* Go 1.17 or later is now required.
* Icons for macOS bundles are now padded and rounded, disable with "-use-raw-icon"

## 2.3.4 - 3 May 2023

Expand Down
2 changes: 1 addition & 1 deletion cmd/fyne/internal/commands/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type appData struct {
AppID, AppVersion string
AppBuild int
ResGoString string
Release bool
Release, rawIcon bool
CustomMetadata map[string]string
VersionAtLeast2_3 bool
}
Expand Down
6 changes: 6 additions & 0 deletions cmd/fyne/internal/commands/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ func Install() *cli.Command {
Value: "",
Destination: &i.icon,
},
&cli.BoolFlag{
Name: "use-raw-icon",
Usage: "Skip any OS-specific icon pre-processing",
Value: false,
Destination: &i.rawIcon,
},
&cli.StringFlag{
Name: "appID",
Aliases: []string{"id"},
Expand Down
5 changes: 4 additions & 1 deletion cmd/fyne/internal/commands/package-darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ func (p *Packager) packageDarwin() (err error) {
err = r
}
}()
if err := icns.Encode(dest, processMacOSIcon(srcImg)); err != nil {
if !p.rawIcon {
srcImg = processMacOSIcon(srcImg)
}
if err := icns.Encode(dest, srcImg); err != nil {
return fmt.Errorf("failed to encode icns: %w", err)
}

Expand Down
6 changes: 6 additions & 0 deletions cmd/fyne/internal/commands/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ func Package() *cli.Command {
Value: "",
Destination: &p.icon,
},
&cli.BoolFlag{
Name: "use-raw-icon",
Usage: "Skip any OS-specific icon pre-processing",
Value: false,
Destination: &p.rawIcon,
},
&cli.StringFlag{
Name: "appID",
Aliases: []string{"id"},
Expand Down
6 changes: 6 additions & 0 deletions cmd/fyne/internal/commands/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ func Release() *cli.Command {
Value: "",
Destination: &r.icon,
},
&cli.BoolFlag{
Name: "use-raw-icon",
Usage: "Skip any OS-specific icon pre-processing",
Value: false,
Destination: &r.rawIcon,
},
&cli.GenericFlag{
Name: "metadata",
Usage: "Specify custom metadata key value pair that you do not want to store in your FyneApp.toml (key=value)",
Expand Down

0 comments on commit d01ee32

Please sign in to comment.