0

我想将 Griffon 图标替换为我的应用程序的自定义图标。我已替换视图中的图标,如下所示:

application(id: "mainFrame", title: 'selekron',
  preferredSize: [884, 800],
  pack: true,
  //location: [50,50],
  locationByPlatform:true,
  iconImage: imageIcon('/progresomusica-icon-48x48.png').image,
  iconImages: [imageIcon('/progresomusica-icon-48x48.png').image,
               imageIcon('/progresomusica-icon-32x32.png').image,
               imageIcon('/progresomusica-icon-16x16.png').image]) {

我在 griffon-app/conf/BuildConfig.groovy 中有下一个设置:

deploy {
    application {
        title = "${appName} ${appVersion}"
        vendor = System.properties['user.name']
        homepage = "http://localhost/${appName}"
        description {
            complete = "${appName} ${appVersion}"
            oneline  = "${appName} ${appVersion}"
            minimal  = "${appName} ${appVersion}"
            tooltip  = "${appName} ${appVersion}"
        }
        icon {
            'default' {
                name   = 'progresomusica-icon-64x64.png'
                width  = '64'
                height = '64'
            }
            splash {
                name   = 'griffon.png'
                width  = '391'
                height = '123'
            }
            selected {
                name   = 'progresomusica-icon-64x64.png'
                width  = '64'
                height = '64'
            }
            disabled {
                name   = 'progresomusica-icon-64x64.png'
                width  = '64'
                height = '64'
            }
            rollover {
                name   = 'progresomusica-icon-64x64.png'
                width  = '64'
                height = '64'
            }
            shortcut {
                name   = 'progresomusica-icon-64x64.png'
                width  = '64'
                height = '64'
            }
        }

我已删除我的 $HOME/.griffon 文件夹并再次运行该应用程序,但我不断收到 griffon 红色图标。

关于我缺少什么的任何想法?

4

1 回答 1

0

您是否在 OSX 上运行该应用程序?如果是这样,请查看 $GRIFFON_HOME/scripts/_GriffonPackage.groovy。该文件定义了以下闭包

resolveApplicationIcnsFile = {
    File icnsFile = null
    if (buildConfig.application.icon) {
        icnsFile = new File(basedir, buildConfig.application.icon)
        if (!icnsFile.exists()) icnsFile = null
    }
    if (icnsFile == null) {
        icnsFile = new File(basedir, "griffon-app/conf/dist/shared/${griffonAppName}.icns")
        if (!icnsFile.exists()) icnsFile = null
    }
    if (icnsFile == null) {
        icnsFile = new File("${griffonHome}/media/griffon.icns")
    }
    icnsFile
}

基本上,您有 2 种选择来定义要在 OSX 的 Dock 中使用的图标,否则会选择默认图标。如果在 Windows 或 Linux 上运行应用程序,那么更新主视图(如您所做的那样)就足够了

  iconImage: imageIcon('/progresomusica-icon-48x48.png').image,
  iconImages: [imageIcon('/progresomusica-icon-48x48.png').image,
               imageIcon('/progresomusica-icon-32x32.png').image,
               imageIcon('/progresomusica-icon-16x16.png').image]) {
于 2012-06-17T13:48:13.453 回答