如何替换自定义图标的griffon应用程序图标

时间:2012-06-17 07:33:34

标签: griffon

我想替换我的应用程序的自定义图标的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文件夹并再次运行该应用程序,但我不断获得格里芬红色图标。

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

1 个答案:

答案 0 :(得分: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
}

基本上,您有两个选择来定义要在OSX的底座中使用的图标,否则会选择默认图标。如果在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]) {