Add HiDPI support

This commit is contained in:
Alexander Kojevnikov 2023-02-06 19:53:11 -08:00
parent 316be56b66
commit 5a331f5f92
8 changed files with 23 additions and 11 deletions

View File

@ -51,7 +51,7 @@ PKG_CHECK_MODULES(AVCODEC, [libavcodec >= 59.37.100])
PKG_CHECK_MODULES(AVUTIL, [libavutil >= 57.28.100])
AM_OPTIONS_WXCONFIG
reqwx=3.0.0
reqwx=3.1.7
AM_PATH_WXCONFIG($reqwx, wx=1)
if test "$wx" != 1; then
AC_MSG_ERROR([

View File

@ -23,11 +23,11 @@
<key>CFBundleVersion</key>
<string>@VERSION@</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<string>wxNSApplication</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright (c) 2010-2013 Alexander Kojevnikov and contributors</string>
<key>LSMinimumSystemVersion</key>
<string>10.5</string>
<string>10.15</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>

BIN
dist/win/spek.ico vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 401 KiB

1
dist/win/spek.rc vendored
View File

@ -1,3 +1,4 @@
#define wxUSE_DPI_AWARE_MANIFEST 2
#include <wx/msw/wx.rc>
aaaa ICON "spek.ico"

View File

@ -77,6 +77,10 @@ wxIconBundle SpekArtProvider::CreateIconBundle(const wxArtID& id, const wxArtCli
bundle.AddIcon(wxIcon("aaaa", wxBITMAP_TYPE_ICO_RESOURCE, 24, 24));
bundle.AddIcon(wxIcon("aaaa", wxBITMAP_TYPE_ICO_RESOURCE, 32, 32));
bundle.AddIcon(wxIcon("aaaa", wxBITMAP_TYPE_ICO_RESOURCE, 48, 48));
bundle.AddIcon(wxIcon("aaaa", wxBITMAP_TYPE_ICO_RESOURCE, 64, 64));
bundle.AddIcon(wxIcon("aaaa", wxBITMAP_TYPE_ICO_RESOURCE, 96, 96));
bundle.AddIcon(wxIcon("aaaa", wxBITMAP_TYPE_ICO_RESOURCE, 128, 128));
bundle.AddIcon(wxIcon("aaaa", wxBITMAP_TYPE_ICO_RESOURCE, 256, 256));
return bundle;
}
#endif

View File

@ -27,12 +27,6 @@ enum
FFT_BITS = 11,
MIN_FFT_BITS = 8,
MAX_FFT_BITS = 14,
LPAD = 60,
TPAD = 60,
RPAD = 90,
BPAD = 40,
GAP = 10,
RULER = 10,
};
// Forward declarations.
@ -60,7 +54,13 @@ SpekSpectrogram::SpekSpectrogram(wxFrame *parent) :
prev_width(-1),
fft_bits(FFT_BITS),
urange(URANGE),
lrange(LRANGE)
lrange(LRANGE),
LPAD(this->FromDIP(60)),
TPAD(this->FromDIP(60)),
RPAD(this->FromDIP(90)),
BPAD(this->FromDIP(40)),
GAP(this->FromDIP(10)),
RULER(this->FromDIP(10))
{
this->create_palette();

View File

@ -51,6 +51,12 @@ private:
int fft_bits;
int urange;
int lrange;
const int LPAD;
const int TPAD;
const int RPAD;
const int BPAD;
const int GAP;
const int RULER;
DECLARE_EVENT_TABLE()
};

View File

@ -52,10 +52,11 @@ private:
};
SpekWindow::SpekWindow(const wxString& path) :
wxFrame(NULL, -1, wxEmptyString, wxDefaultPosition, wxSize(640, 480)), path(path)
wxFrame(NULL, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize), path(path)
{
this->description = _("Spek - Acoustic Spectrum Analyser");
SetTitle(this->description);
SetSize(this->FromDIP(wxSize(640, 480)));
#ifndef OS_OSX
SetIcons(wxArtProvider::GetIconBundle(ART_SPEK, wxART_FRAME_ICON));