diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-05-12 00:10:38 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-05-12 13:13:36 +0200 |
| commit | 61724dd3c9656d1e26ae945ce784ca50c2059695 (patch) | |
| tree | c2de5d60de62b2ae10fae03d645e78e3412efc42 /src/wx/wx_util.cc | |
| parent | 14712fbdb5bd2f6226b9969c581fc32c2e19ecbf (diff) | |
Move bitmap_path() to wx_util.{cc,h}
Diffstat (limited to 'src/wx/wx_util.cc')
| -rw-r--r-- | src/wx/wx_util.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 6eef0d147..f8756549b 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -567,3 +567,26 @@ get_offsets (vector<Offset>& offsets) return utc; } + + +wxString +bitmap_path (string name) +{ + boost::filesystem::path base; + +#ifdef DCPOMATIC_DEBUG + /* Hack to allow OS X to find icons when running from the source tree */ + char* path = getenv ("DCPOMATIC_GRAPHICS"); + if (path) { + base = path; + } else { + base = shared_path(); + } +#else + base = shared_path(); +#endif + + boost::filesystem::path p = base / String::compose("%1.png", name); + return std_to_wx (p.string()); +} + |
