From 18ea1f22c5bab7e12c3f90c5ad05b038412905c2 Mon Sep 17 00:00:00 2001 From: Crementif <26669564+Crementif@users.noreply.github.com> Date: Wed, 16 Jul 2025 20:54:11 +0200 Subject: [PATCH] Use modified wxWidgets 3.3.0 build for non-Windows platforms --- CMakeLists.txt | 6 +- .../fix-wxtextctrl-dark-mode-msw.patch | 82 ------------------- dependencies/vcpkg_overlay_ports_win/.gitkeep | 0 3 files changed, 3 insertions(+), 85 deletions(-) delete mode 100644 dependencies/vcpkg_overlay_ports/wxwidgets/fix-wxtextctrl-dark-mode-msw.patch create mode 100644 dependencies/vcpkg_overlay_ports_win/.gitkeep diff --git a/CMakeLists.txt b/CMakeLists.txt index 837d5ee6..d7c1fa90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,11 +37,11 @@ if (ENABLE_VCPKG) endif() if(UNIX AND NOT APPLE) - set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports_linux") + set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports_linux;${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports") elseif(APPLE) - set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports_mac") + set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports_mac;${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports") else() - set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports") + set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports_win;${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports") endif() set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Vcpkg toolchain file") diff --git a/dependencies/vcpkg_overlay_ports/wxwidgets/fix-wxtextctrl-dark-mode-msw.patch b/dependencies/vcpkg_overlay_ports/wxwidgets/fix-wxtextctrl-dark-mode-msw.patch deleted file mode 100644 index 8584baaa..00000000 --- a/dependencies/vcpkg_overlay_ports/wxwidgets/fix-wxtextctrl-dark-mode-msw.patch +++ /dev/null @@ -1,82 +0,0 @@ -diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp -index 3bdb2c5699bf..96225f19f849 100644 ---- a/src/msw/textctrl.cpp -+++ b/src/msw/textctrl.cpp -@@ -50,6 +50,7 @@ - #include - - #include "wx/msw/private.h" -+#include "wx/msw/private/darkmode.h" - #include "wx/msw/winundef.h" - - #include -@@ -473,9 +474,10 @@ bool wxTextCtrl::Create(wxWindow *parent, - if ( !MSWCreateText(value, pos, size) ) - return false; - --#if wxUSE_DRAG_AND_DROP && wxUSE_RICHEDIT -+#if wxUSE_RICHEDIT - if ( IsRich() ) - { -+#if wxUSE_DRAG_AND_DROP - // rich text controls have a default associated drop target which - // allows them to receive (rich) text dropped on them, which is nice, - // but prevents us from associating a user-defined drop target with -@@ -484,8 +486,16 @@ bool wxTextCtrl::Create(wxWindow *parent, - // to make it work, we set m_dropTarget to this special value initially - // and check for it in our SetDropTarget() - m_dropTarget = wxRICHTEXT_DEFAULT_DROPTARGET; -+#endif // wxUSE_DRAG_AND_DROP -+ -+ if ( wxMSWDarkMode::IsActive() ) -+ { -+ // We need to set the colours explicitly for rich text controls. -+ SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); -+ SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); -+ } - } --#endif // wxUSE_DRAG_AND_DROP && wxUSE_RICHEDIT -+#endif // wxUSE_RICHEDIT - - return true; - } -@@ -501,9 +511,6 @@ bool wxTextCtrl::MSWCreateText(const wxString& value, - const wxPoint& pos, - const wxSize& size) - { -- // translate wxWin style flags to MSW ones -- WXDWORD msStyle = MSWGetCreateWindowFlags(); -- - // do create the control - either an EDIT or RICHEDIT - wxString windowClass = wxT("EDIT"); - -@@ -624,7 +631,7 @@ bool wxTextCtrl::MSWCreateText(const wxString& value, - // implementation detail - m_updatesCount = -2; - -- if ( !MSWCreateControl(windowClass.t_str(), msStyle, pos, size, valueWin) ) -+ if ( !MSWCreateControl(windowClass.t_str(), valueWin, pos, size) ) - { - // There is one case in which window creation may realistically fail - // and this is when we create a plain EDIT control with too long text, -@@ -647,6 +654,20 @@ bool wxTextCtrl::MSWCreateText(const wxString& value, - #if wxUSE_RICHEDIT - if (IsRich()) - { -+ // RICHEDIT50W automatically adds WS_EX_CLIENTEDGE to its style for -+ // some reason and while this isn't very noticeable in light mode, it -+ // looks really bad in dark mode, so forcibly remove it unless it was -+ // explicitly requested. -+ if ( GetBorder() != wxBORDER_SUNKEN && wxMSWDarkMode::IsActive() ) -+ { -+ const auto origExStyle = ::GetWindowLongPtr(GetHwnd(), GWL_EXSTYLE); -+ if ( origExStyle & WS_EX_CLIENTEDGE ) -+ { -+ ::SetWindowLongPtr(GetHwnd(), GWL_EXSTYLE, -+ origExStyle & ~WS_EX_CLIENTEDGE); -+ } -+ } -+ - #if wxUSE_INKEDIT - if (IsInkEdit()) - { diff --git a/dependencies/vcpkg_overlay_ports_win/.gitkeep b/dependencies/vcpkg_overlay_ports_win/.gitkeep new file mode 100644 index 00000000..e69de29b