diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 40204eebfd..9ce90ab5bf 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -489,12 +489,13 @@ set_source_files_properties( dialogs/dialog_user_defined_signals.cpp if( APPLE ) # setup bundle - set( EESCHEMA_RESOURCES eeschema.icns eeschema_doc.icns ) - set_source_files_properties( "${CMAKE_CURRENT_SOURCE_DIR}/eeschema.icns" PROPERTIES - MACOSX_PACKAGE_LOCATION Resources - ) - set_source_files_properties( "${CMAKE_CURRENT_SOURCE_DIR}/eeschema_doc.icns" PROPERTIES - MACOSX_PACKAGE_LOCATION Resources + set( EESCHEMA_RESOURCES eeschema.icns eeschema_doc.icns libedit.icns libedit_doc.icns ) + set_source_files_properties( + "${CMAKE_CURRENT_SOURCE_DIR}/eeschema.icns" + "${CMAKE_CURRENT_SOURCE_DIR}/eeschema_doc.icns" + "${CMAKE_CURRENT_SOURCE_DIR}/libedit.icns" + "${CMAKE_CURRENT_SOURCE_DIR}/libedit_doc.icns" + PROPERTIES MACOSX_PACKAGE_LOCATION Resources ) set( MACOSX_BUNDLE_ICON_FILE eeschema.icns ) set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad.kicad ) diff --git a/eeschema/libedit.icns b/eeschema/libedit.icns new file mode 100644 index 0000000000..bc5612b80c Binary files /dev/null and b/eeschema/libedit.icns differ diff --git a/eeschema/libedit_doc.icns b/eeschema/libedit_doc.icns new file mode 100644 index 0000000000..bc5612b80c Binary files /dev/null and b/eeschema/libedit_doc.icns differ diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 6df834504a..ad2b7cb449 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -578,12 +578,13 @@ set_source_files_properties( dialogs/panel_setup_rules.cpp if( APPLE ) # setup bundle - set( PCBNEW_RESOURCES pcbnew.icns pcbnew_doc.icns ) - set_source_files_properties( "${CMAKE_CURRENT_SOURCE_DIR}/pcbnew.icns" PROPERTIES - MACOSX_PACKAGE_LOCATION Resources - ) - set_source_files_properties( "${CMAKE_CURRENT_SOURCE_DIR}/pcbnew_doc.icns" PROPERTIES - MACOSX_PACKAGE_LOCATION Resources + set( PCBNEW_RESOURCES pcbnew.icns pcbnew_doc.icns fpedit.icns fpedit_doc.icns ) + set_source_files_properties( + "${CMAKE_CURRENT_SOURCE_DIR}/pcbnew.icns" + "${CMAKE_CURRENT_SOURCE_DIR}/pcbnew_doc.icns" + "${CMAKE_CURRENT_SOURCE_DIR}/fpedit.icns" + "${CMAKE_CURRENT_SOURCE_DIR}/fpedit_doc.icns" + PROPERTIES MACOSX_PACKAGE_LOCATION Resources ) set( MACOSX_BUNDLE_ICON_FILE pcbnew.icns ) set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad.kicad ) diff --git a/pcbnew/fpedit.icns b/pcbnew/fpedit.icns new file mode 100644 index 0000000000..0d641cefb9 Binary files /dev/null and b/pcbnew/fpedit.icns differ diff --git a/pcbnew/fpedit_doc.icns b/pcbnew/fpedit_doc.icns new file mode 100644 index 0000000000..0d641cefb9 Binary files /dev/null and b/pcbnew/fpedit_doc.icns differ diff --git a/resources/macos/plist/eeschema.Info.plist.in b/resources/macos/plist/eeschema.Info.plist.in index 7d8fc6e554..30e51fb24c 100644 --- a/resources/macos/plist/eeschema.Info.plist.in +++ b/resources/macos/plist/eeschema.Info.plist.in @@ -15,13 +15,23 @@ <key>CFBundleTypeName</key> <string>KiCad schematic document</string> <key>LSHandlerRank</key> <string>Owner</string> </dict> + <dict> + <key>CFBundleTypeRole</key> <string>None</string> + <key>CFBundleTypeExtensions</key> + <array> + <string>kicad_sym</string> + </array> + <key>CFBundleTypeIconFile</key> <string>libedit_doc.icns</string> + <key>CFBundleTypeName</key> <string>KiCad symbol library</string> + <key>LSHandlerRank</key> <string>None</string> + </dict> </array> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>eeschema</string> <key>CFBundleGetInfoString</key> <string></string> <key>CFBundleIconFile</key> <string>eeschema.icns</string> <key>CFBundleIdentifier</key> <string>org.kicad.eeschema</string> - <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> + <key>CFBundleInfoDictionaryVersion</key> <string>7.0</string> <key>CFBundleLongVersionString</key> <string>@KICAD_VERSION_FULL@</string> <key>CFBundleName</key> <string>Schematic Editor</string> <key>CFBundlePackageType</key> <string>APPL</string> diff --git a/resources/macos/plist/kicad.Info.plist.in b/resources/macos/plist/kicad.Info.plist.in index 645cf04118..acedb26e3e 100644 --- a/resources/macos/plist/kicad.Info.plist.in +++ b/resources/macos/plist/kicad.Info.plist.in @@ -11,16 +11,25 @@ <string>pro</string> <string>kicad_pro</string> </array> - <key>CFBundleTypeName</key> <string>kicad project files</string> + <key>CFBundleTypeName</key> <string>KiCad project file</string> <key>LSHandlerRank</key> <string>Owner</string> </dict> + <dict> + <key>CFBundleTypeRole</key> <string>None</string> + <key>CFBundleTypeExtensions</key> + <array> + <string>kicad_mod</string> + </array> + <key>CFBundleTypeName</key> <string>KiCad project local settings</string> + <key>LSHandlerRank</key> <string>None</string> + </dict> </array> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>kicad</string> <key>CFBundleGetInfoString</key> <string></string> <key>CFBundleIconFile</key> <string>kicad.icns</string> <key>CFBundleIdentifier</key> <string>org.kicad.kicad</string> - <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> + <key>CFBundleInfoDictionaryVersion</key> <string>7.0</string> <key>CFBundleLongVersionString</key> <string>@KICAD_VERSION_FULL@</string> <key>CFBundleName</key> <string>KiCad</string> <key>CFBundlePackageType</key> <string>APPL</string> diff --git a/resources/macos/plist/pcbnew.Info.plist.in b/resources/macos/plist/pcbnew.Info.plist.in index 3253b8769a..82fa696c38 100644 --- a/resources/macos/plist/pcbnew.Info.plist.in +++ b/resources/macos/plist/pcbnew.Info.plist.in @@ -13,16 +13,35 @@ <string>brd</string> </array> - <key>CFBundleTypeName</key> <string>pcbnew board</string> + <key>CFBundleTypeName</key> <string>KiCad PCB document</string> <key>LSHandlerRank</key> <string>Owner</string> </dict> + <dict> + <key>CFBundleTypeRole</key> <string>None</string> + <key>CFBundleTypeExtensions</key> + <array> + <string>kicad_mod</string> + </array> + <key>CFBundleTypeIconFile</key> <string>fpedit_doc.icns</string> + <key>CFBundleTypeName</key> <string>KiCad footprint</string> + <key>LSHandlerRank</key> <string>None</string> + </dict> + <dict> + <key>CFBundleTypeRole</key> <string>None</string> + <key>CFBundleTypeExtensions</key> + <array> + <string>kicad_dru</string> + </array> + <key>CFBundleTypeName</key> <string>KiCad custom design rules</string> + <key>LSHandlerRank</key> <string>None</string> + </dict> </array> <key>CFBundleExecutable</key> <string>pcbnew</string> <key>CFBundleGetInfoString</key> <string></string> <key>CFBundleIconFile</key> <string>pcbnew.icns</string> <key>CFBundleIdentifier</key> <string>org.kicad.pcbnew</string> - <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> + <key>CFBundleInfoDictionaryVersion</key> <string>7.0</string> <key>CFBundleLongVersionString</key> <string>@KICAD_VERSION_FULL@</string> <key>CFBundleName</key> <string>PCB Editor</string> <key>CFBundlePackageType</key> <string>APPL</string> diff --git a/tools/build/mk_macos_icons.py b/tools/build/mk_macos_icons.py old mode 100644 new mode 100755 index d4363f791c..c900c6f95e --- a/tools/build/mk_macos_icons.py +++ b/tools/build/mk_macos_icons.py @@ -1,36 +1,38 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # This script regenerates the .icns files for MacOS application packaging. # You need to be running on MacOS to use it (for iconutil) -# You also need imagemagick + rsvg installed, with something like: -# brew install imagemagick --with-librsvg +# You also need rsvg-convert installed, with something like: +# brew install librsvg import os from shutil import copy, rmtree from subprocess import call -ICON_SOURCES = "../../resources/bitmaps_png/sources/" +ICON_SOURCES = "../../resources/bitmaps_png/sources/light/" +# (sourcename, (dest1, dest2, ...), output_dir) ICONS = [ - ("bitmap2component", ("bitmap2component",), "../../bitmap2component"), - ("cvpcb", ("cvpcb", "cvpcb_doc"), "../../cvpcb"), - ("eeschema", ("eeschema", "eeschema_doc"), "../../eeschema"), - ("libedit", ("eeschema", "eeschema_doc"), "../../eeschema"), - ("gerbview", ("gerbview", "gerbview_doc"), "../../gerbview"), - ("kicad", ("kicad", "kicad_doc"), "../../kicad"), - ("pagelayout_editor", ("pl_editor", "pl_editor_doc"), "../../pagelayout_editor"), - ("pcbcalculator", ("pcb_calculator",), "../../pcb_calculator"), - ("pcbnew", ("pcbnew", "pcbnew_doc"), "../../pcbnew") + # ("bitmap2component", ("bitmap2component",), "../../bitmap2component"), + # ("cvpcb", ("cvpcb", "cvpcb_doc"), "../../cvpcb"), + # ("eeschema", ("eeschema", "eeschema_doc"), "../../eeschema"), + ("libedit", ("libedit", "libedit_doc"), "../../eeschema"), + # ("gerbview", ("gerbview", "gerbview_doc"), "../../gerbview"), + # ("kicad", ("kicad", "kicad_doc"), "../../kicad"), + # ("pagelayout_editor", ("pagelayout_editor", "pagelayout_editor_doc"), "../../pagelayout_editor"), + # ("pcbcalculator", ("pcb_calculator",), "../../pcb_calculator"), + # ("pcbnew", ("pcbnew", "pcbnew_doc"), "../../pcbnew"), + ("modedit", ("fpedit", "fpedit_doc"), "../../pcbnew") ] SIZES = [ - ("!16x16", ("16x16",)), - ("!32x32", ("16x16@2x", "32x32")), - ("!64x64", ("32x32@2x",)), - ("!128x128", ("128x128",)), - ("!256x256", ("128x128@2x", "256x256")), - ("!512x512", ("256x256@2x", "512x512")), - ("!1024x1024", ("512x512@2x",)) + ("16", ("16x16",)), + ("32", ("16x16@2x", "32x32")), + ("64", ("32x32@2x",)), + ("128", ("128x128",)), + ("256", ("128x128@2x", "256x256")), + ("512", ("256x256@2x", "512x512")), + ("1024", ("512x512@2x",)) ] if __name__ == '__main__': @@ -39,13 +41,16 @@ if __name__ == '__main__': src = ICON_SOURCES + "icon_" + src + ".svg" iconset = dest[0] + ".iconset" + os.mkdir(iconset) for size, outputs in SIZES: dest_path = os.path.join(iconset, "icon_" + outputs[0] + ".png") - print size, src, dest_path - call(["convert", "-background", "none", "-density", "5000", - "-resize", size, src, dest_path]) + convert_size = "!{}x{}".format(size, size) + print(size, convert_size, src, dest_path) + call(["rsvg-convert", "--background-color=transparent", "--dpi-x=5000", "--dpi-y=5000", + "--width={}".format(size), "--height={}".format(size), "--output={}".format(dest_path), + src]) for duplicate in outputs[1:]: dupe_path = os.path.join(iconset, "icon_" + duplicate + ".png") copy(dest_path, dupe_path)