summarylogtreecommitdiffstats
path: root/0001-compatibility-with-stable-wxWidgets.patch
blob: 7b2508f80c07aaa595f9f4aa0207f363452d987c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From be61a443c87e97d7a1b8716428c7e3fedcc7a34c Mon Sep 17 00:00:00 2001
From: Jan Cholasta <jan@cholasta.net>
Date: Thu, 14 Apr 2022 14:15:13 +0200
Subject: [PATCH] compatibility with stable wxWidgets

---
 src/Graphics/Icons.cpp | 2 ++
 src/UI/SAuiTabArt.cpp  | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/Graphics/Icons.cpp b/src/Graphics/Icons.cpp
index 61d5475c..8c6e5c44 100644
--- a/src/Graphics/Icons.cpp
+++ b/src/Graphics/Icons.cpp
@@ -373,7 +373,9 @@ wxBitmap loadPNGIcon(const IconDef& icon, int size, Point2i padding)
 bool icons::loadIcons()
 {
 	// Check for dark mode
+#if wxCHECK_VERSION(3, 1, 0)
 	ui_icons_dark = wxSystemSettings::GetAppearance().IsDark();
+#endif
 
 	// Get slade.pk3
 	auto* res_archive = app::archiveManager().programResourceArchive();
diff --git a/src/UI/SAuiTabArt.cpp b/src/UI/SAuiTabArt.cpp
index 15aad09e..1fa29b73 100644
--- a/src/UI/SAuiTabArt.cpp
+++ b/src/UI/SAuiTabArt.cpp
@@ -550,7 +550,10 @@ void SAuiDockArt::DrawCaption(wxDC& dc, wxWindow* window, const wxString& text,
 	    }
 
 	    // Draw the icon centered vertically
-	    int xOffset = window->FromDIP(2);
+	    int xOffset = 2;
+#if wxCHECK_VERSION(3, 1, 0)
+	    xOffset = window->FromDIP(xOffset);
+#endif
 	    dc.DrawBitmap(pane.icon,
 	                  rect.x+xOffset, rect.y+(rect.height-pane.icon.GetHeight())/2,
 	                  true);
-- 
2.35.1