Commit fb3a8094 authored by Weijia Wang's avatar Weijia Wang
Browse files

freefilesync: 13.9 -> 14.0

parent 44f5ad13
Loading
Loading
Loading
Loading
+25 −3
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
  fetchurl,
  fetchpatch,
  fetchDebianPatch,
  fetchFromGitHub,
  copyDesktopItems,
  pkg-config,
  wrapGAppsHook3,
@@ -17,9 +18,30 @@
  makeDesktopItem,
}:

let
  wxwidgets_3_3 = wxGTK32.overrideAttrs (
    finalAttrs: previousAttrs: {
      version = "3.3.0-unstable-2025-02-02";
      src = fetchFromGitHub {
        owner = "wxWidgets";
        repo = "wxWidgets";
        rev = "969c5a46b5c1da57836f721a4ce5df9feaa437f9";
        fetchSubmodules = true;
        hash = "sha256-ODPE896xc5RxdyfIzdPB5fsTeBm3O+asYJd99fuW6AY=";
      };
      patches = [
        ./wxcolorhook.patch
      ];
      configureFlags = lib.subtractLists [
        "--disable-compat28"
        "--enable-unicode"
      ] previousAttrs.configureFlags;
    }
  );
in
stdenv.mkDerivation (finalAttrs: {
  pname = "freefilesync";
  version = "13.9";
  version = "14.0";

  src = fetchurl {
    url = "https://freefilesync.org/download/FreeFileSync_${finalAttrs.version}_Source.zip";
@@ -28,7 +50,7 @@ stdenv.mkDerivation (finalAttrs: {
      rm -f $out
      tryDownload "$url"
    '';
    hash = "sha256-53UPGg02JZr15r99ntkpZKqB/DgPjkGTQyuMt703t6s=";
    hash = "sha256-qxt6fpJT0jKcSYJ+WVneks6PI18/wwSc5H84qICegag=";
  };

  sourceRoot = ".";
@@ -72,7 +94,7 @@ stdenv.mkDerivation (finalAttrs: {
    gtk3
    libssh2
    openssl
    wxGTK32
    wxwidgets_3_3
  ];

  env.NIX_CFLAGS_COMPILE = toString [
+50 −0
Original line number Diff line number Diff line
diff --git a/include/wx/settings.h b/include/wx/settings.h
index 3967b98b46..8d7f3d2870 100644
--- a/include/wx/settings.h
+++ b/include/wx/settings.h
@@ -13,6 +13,8 @@
 #include "wx/colour.h"
 #include "wx/font.h"
 
+#include <memory>
+
 class WXDLLIMPEXP_FWD_CORE wxWindow;
 
 // possible values for wxSystemSettings::GetFont() parameter
@@ -241,9 +243,28 @@ public:
 // include the declaration of the real platform-dependent class
 // ----------------------------------------------------------------------------
 
+struct wxColorHook
+{
+    virtual ~wxColorHook() {}
+    virtual wxColor getColor(wxSystemColour index) const = 0;
+};
+WXDLLIMPEXP_CORE inline std::unique_ptr<wxColorHook>& refGlobalColorHook()
+{
+    static std::unique_ptr<wxColorHook> globalColorHook;
+    return globalColorHook;
+}
+
 class WXDLLIMPEXP_CORE wxSystemSettings : public wxSystemSettingsNative
 {
 public:
+    static wxColour GetColour(wxSystemColour index)
+    {
+        if (refGlobalColorHook())
+			return refGlobalColorHook()->getColor(index);
+
+        return wxSystemSettingsNative::GetColour(index);
+    }
+
 #ifdef __WXUNIVERSAL__
     // in wxUniversal we want to use the theme standard colours instead of the
     // system ones, otherwise wxSystemSettings is just the same as
@@ -264,7 +285,6 @@ public:
 
     // Value
     static wxSystemScreenType ms_screen;
-
 };
 
 #endif