spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit 12871fb2713b43c1ab3c9f1b124798be9b9fc548
parent a53b4df231731900f1d4f1f2b648e97372efeb7d
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Wed,  5 Sep 2012 10:01:21 -0700

osx: Bundle toolbar icons, fixes #21

Diffstat:
Adist/osx/about.png | 0
Mdist/osx/bundle.sh | 1+
Adist/osx/close.png | 0
Adist/osx/open.png | 0
Adist/osx/save.png | 0
Msrc/spek-artwork.cc | 12++++++++++++
Msrc/spek-artwork.hh | 2--
Msrc/spek-window.cc | 4+++-
8 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/dist/osx/about.png b/dist/osx/about.png Binary files differ. diff --git a/dist/osx/bundle.sh b/dist/osx/bundle.sh @@ -17,6 +17,7 @@ mkdir -p Spek.app/Contents/Resources mv ../../src/spek Spek.app/Contents/MacOS/Spek cp Info.plist Spek.app/Contents/ cp Spek.icns Spek.app/Contents/Resources/ +cp *.png Spek.app/Contents/Resources/ for lang in $LANGUAGES; do mkdir -p Spek.app/Contents/Resources/"$lang".lproj diff --git a/dist/osx/close.png b/dist/osx/close.png Binary files differ. diff --git a/dist/osx/open.png b/dist/osx/open.png Binary files differ. diff --git a/dist/osx/save.png b/dist/osx/save.png Binary files differ. diff --git a/src/spek-artwork.cc b/src/spek-artwork.cc @@ -45,6 +45,9 @@ wxBitmap SpekArtProvider::CreateBitmap( #ifdef OS_WIN return wxIcon(wxT("about"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24); #endif +#ifdef OS_OSX + return wxBitmap(wxT("about"), wxBITMAP_TYPE_PNG_RESOURCE); +#endif } if (id == ART_OPEN) { #ifdef OS_UNIX @@ -53,6 +56,9 @@ wxBitmap SpekArtProvider::CreateBitmap( #ifdef OS_WIN return wxIcon(wxT("open"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24); #endif +#ifdef OS_OSX + return wxBitmap(wxT("open"), wxBITMAP_TYPE_PNG_RESOURCE); +#endif } if (id == ART_SAVE) { #ifdef OS_UNIX @@ -61,6 +67,9 @@ wxBitmap SpekArtProvider::CreateBitmap( #ifdef OS_WIN return wxIcon(wxT("save"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24); #endif +#ifdef OS_OSX + return wxBitmap(wxT("save"), wxBITMAP_TYPE_PNG_RESOURCE); +#endif } if (id == ART_CLOSE) { #ifdef OS_UNIX @@ -69,6 +78,9 @@ wxBitmap SpekArtProvider::CreateBitmap( #ifdef OS_WIN return wxIcon(wxT("close"), wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); #endif +#ifdef OS_OSX + return wxBitmap(wxT("close"), wxBITMAP_TYPE_PNG_RESOURCE); +#endif } return wxNullBitmap; } diff --git a/src/spek-artwork.hh b/src/spek-artwork.hh @@ -21,8 +21,6 @@ #include <wx/string.h> -#define ART_HAS_ICON_BUNDLES wxCHECK_VERSION(2, 9, 0) - #define ART_SPEK wxT("art-spek") #define ART_OPEN wxT("art-open") #define ART_SAVE wxT("art-save") diff --git a/src/spek-window.cc b/src/spek-window.cc @@ -76,8 +76,10 @@ SpekWindow::SpekWindow(const wxString& path) : this->description = _("Spek - Acoustic Spectrum Analyser"); SetTitle(this->description); -#if ART_HAS_ICON_BUNDLES +#if wxCHECK_VERSION(2, 9, 0) +#ifndef OS_OSX SetIcons(wxArtProvider::GetIconBundle(ART_SPEK, wxART_FRAME_ICON)); +#endif #else SetIcon(wxArtProvider::GetIcon(ART_SPEK, wxART_FRAME_ICON, wxSize(48, 48))); #endif