Переглянути джерело

ADD: Get icon theme name from Qt (fixes #1023)

Alexander Koblov 2 роки тому
батько
коміт
1991eb36e2
1 змінених файлів з 22 додано та 2 видалено
  1. 22 2
      src/platform/unix/uunixicontheme.pas

+ 22 - 2
src/platform/unix/uunixicontheme.pas

@@ -3,7 +3,7 @@
     -------------------------------------------------------------------------
     Some useful functions for Unix icon theme implementation
 
-    Copyright (C) 2009-2021  Alexander Koblov ([email protected])
+    Copyright (C) 2009-2023  Alexander Koblov ([email protected])
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -39,7 +39,23 @@ implementation
 
 uses
   Laz2_DOM, Laz2_XMLRead, DCClassesUtf8, uMyUnix, DCOSUtils, uOSUtils, uGio,
-  uSysFolders, uXdg;
+  uSysFolders, uXdg
+{$IF DEFINED(LCLQT5)}
+  , Qt5
+{$ELSEIF DEFINED(LCLQT6)}
+  , Qt6
+{$ENDIF}
+  ;
+
+{$IF DEFINED(LCLQT5) OR DEFINED(LCLQT6)}
+function GetQtIconTheme: String;
+var
+  AValue: WideString;
+begin
+  QIcon_themeName(@AValue);
+  Result:= UTF8Encode(AValue);
+end;
+{$ENDIF}
 
 function GetKdeIconTheme: String;
 var
@@ -192,7 +208,11 @@ begin
   Result:= EmptyStr;
   case DesktopEnv of
     DE_UNKNOWN:
+{$IF DEFINED(LCLQT5) OR DEFINED(LCLQT6)}
+      Result:= GetQtIconTheme;
+{$ELSE}
       Result:= DEFAULT_THEME_NAME;
+{$ENDIF}
     DE_KDE:
       Result:= GetKdeIconTheme;
     DE_GNOME: