--- src/interface/aui_notebook_ex.cpp	2024-01-02 22:09:45.000000000 +0800
+++ src/interface/aui_notebook_ex.cpp	2024-04-27 22:28:49.000000000 +0800
@@ -62,6 +62,7 @@
 	disabled = active.ConvertToDisabled(brightness);
 }
 
+#if wxCHECK_VERSION(3, 2, 1)
 void PrepareTabIcon(wxBitmapBundle & active, wxBitmapBundle & disabled, wxString const& art, wxSize const& size, wxSize const& canvasSize, wxSize const& offset = wxSize(), std::function<void(wxImage&)> const& f = nullptr, unsigned char brightness = 128)
 {
 	wxBitmap a, d;
@@ -69,6 +70,7 @@
 	active = MakeBmpBundle(a);
 	disabled = MakeBmpBundle(d);
 }
+#endif
 }
 #endif
 
@@ -99,7 +101,11 @@
 		return art;
 	}
 
+#if wxCHECK_VERSION(3, 2, 1)
 	virtual wxSize GetTabSize(wxDC& dc, wxWindow* wnd, const wxString& caption, const wxBitmapBundle& bitmap, bool active, int close_button_state, int* x_extent) override
+#else
+	virtual wxSize GetTabSize(wxDC& dc, wxWindow* wnd, const wxString& caption, const wxBitmap& bitmap, bool active, int close_button_state, int* x_extent) override
+#endif
 	{
 		wxSize size = TabArtBase::GetTabSize(dc, wnd, caption, bitmap, active, close_button_state, x_extent);
 
@@ -180,11 +186,13 @@
 protected:
 
 #if USE_PREPARED_ICONS
+#if wxCHECK_VERSION(3, 2, 1)
 	virtual void UpdateColoursFromSystem() override
 	{
 		TabArtBase::UpdateColoursFromSystem();
 		PrepareIcons();
 	}
+#endif
 
 	void PrepareIcons()
 	{

--- src/interface/graphics.cpp	2024-01-02 22:09:45.000000000 +0800
+++ src/interface/graphics.cpp	2024-04-27 22:33:29.000000000 +0800
@@ -61,12 +61,12 @@
 	auto combo = dynamic_cast<wxComboBox*>(&m_wnd);
 	if (combo) {
 		wxColour c = wxTextCtrl::GetClassDefaultAttributes().colBg;
-
+#if wxCHECK_VERSION(3, 2, 1)
 		// In old versions of macOS, the wrong color may be reported. Try to detect it and just default to white.
 		if ((!c.IsOk() || c == *wxBLACK) && !wxSystemSettingsNative::GetAppearance().IsDark()) {
 			return wxColour(255, 255, 255);
 		}
-
+#endif
 		return c;
 	}
 #endif

--- src/interface/filelistctrl.cpp	2024-02-07 00:35:09.000000000 +0800
+++ src/interface/filelistctrl.cpp	2024-04-27 22:32:11.000000000 +0800
@@ -878,7 +878,7 @@
 
 	const int item = event.GetIndex();
 
-#if !defined(__WXMSW__)
+#if !defined(__WXMSW__) && wxCHECK_VERSION(3, 2, 1)
 	if (item == -1) {
 		if (wxGetKeyState(WXK_SHIFT)) {
 			// Sad, so expensive.

--- src/interface/themeprovider.cpp	2024-01-27 12:30:02.000000000 +0800
+++ src/interface/themeprovider.cpp	2024-04-27 23:00:33.000000000 +0800
@@ -338,7 +338,7 @@
 	}
 
 	bool allowContentScale{true};
-#if defined(__WXMAC__)
+#if defined(__WXMAC__) && wxCHECK_VERSION(3, 2, 1)
 	if (client == wxART_TOOLBAR) {
 		allowContentScale = false;
 	}

--- src/interface/textctrlex.cpp	2024-01-02 22:09:45.000000000 +0800
+++ src/interface/textctrlex.cpp	2024-04-27 22:42:37.000000000 +0800
@@ -19,7 +19,7 @@
 	}
 #endif
 
-#if defined(__WXMAC__)
+#if defined(__WXMAC__) && wxCHECK_VERSION(3,2,1)
 	OSXEnableAutomaticQuoteSubstitution(false);
 	OSXEnableAutomaticDashSubstitution(false);
 #endif

--- src/interface/StatusView.cpp	2024-02-07 00:13:14.000000000 +0800
+++ src/interface/StatusView.cpp	2024-04-27 22:41:55.000000000 +0800
@@ -95,7 +95,7 @@
 	: COptionChangeEventHandler(this)
 	, options_(options)
 {
-#if defined(__WXMAC__)
+#if defined(__WXMAC__) && wxCHECK_VERSION(3, 1, 0)
 	int const border = wxBORDER_NONE;
 #else
 	int const border = wxBORDER_SUNKEN;

--- src/interface/statusbar.cpp	2024-01-02 22:09:45.000000000 +0800
+++ src/interface/statusbar.cpp	2024-04-27 22:41:14.000000000 +0800
@@ -761,7 +761,7 @@
 void CStatusBar::SetFieldBitmap(int field, wxStaticBitmap*& indicator, wxBitmap const& bmp, wxSize const& s)
 {
 	if (indicator) {
-#if defined(__WXMAC__)
+#if defined(__WXMAC__) && wxCHECK_VERSION(3, 2, 1)
 		RemoveField(field);
 		indicator->Destroy();
 		indicator = nullptr;

--- src/interface/sitemanager_dialog.cpp	2024-03-06 12:30:02.000000000 +0800
+++ src/interface/sitemanager_dialog.cpp	2024-04-27 22:40:21.000000000 +0800
@@ -1128,7 +1128,7 @@
 		m_is_deleting = false;
 	}
 
-#if !defined(__WXMSW__)
+#if !defined(__WXMSW__) && wxCHECK_VERSION(3, 2, 1)
 	auto focused = tree_->GetFocusedItem();
 	if (focused) {
 		tree_->EnsureVisible(focused);

--- src/interface/renderer.cpp	2024-01-02 22:09:45.000000000 +0800
+++ src/interface/renderer.cpp	2024-04-27 22:39:30.000000000 +0800
@@ -1,7 +1,7 @@
 #include "filezilla.h"
 #include "renderer.h"
 
-#if defined(__WXMAC__)
+#if defined(__WXMAC__) && wxCHECK_VERSION(3, 1, 0)
 
 #include "themeprovider.h"
 #include <wx/renderer.h>

--- src/interface/queue.cpp	2024-01-02 22:09:45.000000000 +0800
+++ src/interface/queue.cpp	2024-04-27 22:38:37.000000000 +0800
@@ -896,7 +896,7 @@
 END_EVENT_TABLE()
 
 namespace {
-#if defined(__WXMAC__)
+#if defined(__WXMAC__) && wxCHECK_VERSION(3, 1, 0)
 	int constexpr border = wxBORDER_NONE;
 #else
 	int constexpr border = wxBORDER_SUNKEN;

--- src/interface/viewheader.cpp	2024-01-02 22:09:45.000000000 +0800
+++ src/interface/viewheader.cpp	2024-04-27 22:57:31.000000000 +0800
@@ -18,13 +18,15 @@
 
 #ifdef __WXMSW__
 const int border_offset = 0;
-#elif defined(__WXMAC__)
+#elif defined(__WXMAC__) && wxCHECK_VERSION(3, 2, 1)
 const int border_offset = 12;
+#elif defined(__WXMAC__)
+const int border_offset = 6;
 #else
 const int border_offset = 10;
 #endif
 
-#if defined(__WXMAC__)
+#if defined(__WXMAC__) && wxCHECK_VERSION(3, 2, 1)
 const int combo_offset = -1;
 #else
 const int combo_offset = 0;
@@ -152,7 +154,15 @@
 	}
 
 #if wxUSE_UXTHEME
-	if (!wxUxThemeIsActive())
+#if wxCHECK_VERSION(3, 1, 0)
+	if (wxUxThemeIsActive())
+#else
+	wxUxThemeEngine *p = wxUxThemeEngine::Get();
+	if (p && p->IsThemeActive())
+#endif
+	{
+	}
+	else
 #endif //wxUSE_UXTHEME
 	{
 		dc.SetPen(wxPen(wxSystemSettings::GetColour(IsEnabled() ? wxSYS_COLOUR_WINDOW : wxSYS_COLOUR_BTNFACE)));

--- src/interface/view.cpp	2024-01-02 22:09:45.000000000 +0800
+++ src/interface/view.cpp	2024-04-27 22:55:07.000000000 +0800
@@ -15,7 +15,7 @@
 
 CView::CView(wxWindow* pParent)
 {
-#if defined(__WXMAC__)
+#if defined(__WXMAC__) && wxCHECK_VERSION(3, 1, 0)
 	int const border = wxBORDER_NONE;
 #else
 	int const border = wxBORDER_SUNKEN;
