mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 21:19:24 +02:00
LCL-GTK2: Make TrayIcon more configurable based on libraries and features provided by a distro. Issue #40629, patch by dbannon.
(cherry picked from commit 425372ee74
)
This commit is contained in:
parent
e2bb8c8c67
commit
35b6751ce9
@ -456,11 +456,17 @@ end;
|
|||||||
|
|
||||||
function RegisterCustomTrayIcon: Boolean; alias : 'WSRegisterCustomTrayIcon';
|
function RegisterCustomTrayIcon: Boolean; alias : 'WSRegisterCustomTrayIcon';
|
||||||
begin
|
begin
|
||||||
if UnityAppIndicatorInit then
|
|
||||||
RegisterWSComponent(TCustomTrayIcon, TUnityWSCustomTrayIcon)
|
|
||||||
else
|
|
||||||
RegisterWSComponent(TCustomTrayIcon, TGtk2WSCustomTrayIcon);
|
|
||||||
Result := True;
|
Result := True;
|
||||||
|
case UnityWSCtrls.GlobalUseAppInd of
|
||||||
|
UseAppIndAuto : if UnityAppIndicatorInit then
|
||||||
|
RegisterWSComponent(TCustomTrayIcon, TUnityWSCustomTrayIcon)
|
||||||
|
else
|
||||||
|
RegisterWSComponent(TCustomTrayIcon, TGtk2WSCustomTrayIcon);
|
||||||
|
UseAppIndYes : if UnityAppIndicatorInit then
|
||||||
|
RegisterWSComponent(TCustomTrayIcon, TUnityWSCustomTrayIcon)
|
||||||
|
else Result := false;
|
||||||
|
UseAppIndNo : RegisterWSComponent(TCustomTrayIcon, TGtk2WSCustomTrayIcon);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//ExtDlgs
|
//ExtDlgs
|
||||||
|
@ -71,10 +71,16 @@ type
|
|||||||
class function GetPosition(const {%H-}ATrayIcon: TCustomTrayIcon): TPoint; override;
|
class function GetPosition(const {%H-}ATrayIcon: TCustomTrayIcon): TPoint; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ UnityAppIndicatorInit returns true if an AppIndicator library can be loaded }
|
type TUseAppIndInstruction = (UseAppIndYes, UseAppIndNo, UseAppIndAuto);
|
||||||
|
|
||||||
|
{ UnityAppIndicatorInit returns true if an AppIndicator library can be loaded }
|
||||||
function UnityAppIndicatorInit: Boolean;
|
function UnityAppIndicatorInit: Boolean;
|
||||||
|
|
||||||
|
var
|
||||||
|
// A Global used in RegisterCustomTrayIcon() and possibly set in higher level
|
||||||
|
// code to predetermine the SysTray model to use.
|
||||||
|
GlobalUseAppInd : TUseAppIndInstruction = UseAppIndAuto;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
const
|
const
|
||||||
|
Loading…
Reference in New Issue
Block a user