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

This commit is contained in:
Alexander Koblov 2023-07-01 13:00:15 +03:00
commit 1991eb36e2

View file

@ -3,7 +3,7 @@
-------------------------------------------------------------------------
Some useful functions for Unix icon theme implementation
Copyright (C) 2009-2021 Alexander Koblov (alexx2000@mail.ru)
Copyright (C) 2009-2023 Alexander Koblov (alexx2000@mail.ru)
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: