mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-02 21:07:35 +01:00
LCL: Implement TTrayIcon on Unity for GTK2. Issue #29599, patch from Anthony Walter.
git-svn-id: trunk@51565 -
This commit is contained in:
parent
9fb950e45d
commit
e46e912fff
@ -120,7 +120,8 @@ uses
|
||||
Gtk2WSSpin,
|
||||
Gtk2WSStdCtrls,
|
||||
Gtk2WSPairSplitter,
|
||||
Gtk2WSPrivate;
|
||||
Gtk2WSPrivate,
|
||||
UnityWSCtrls;
|
||||
|
||||
// imglist
|
||||
function RegisterCustomImageList: Boolean; alias : 'WSRegisterCustomImageList';
|
||||
@ -460,7 +461,10 @@ end;
|
||||
|
||||
function RegisterCustomTrayIcon: Boolean; alias : 'WSRegisterCustomTrayIcon';
|
||||
begin
|
||||
RegisterWSComponent(TCustomTrayIcon, TGtk2WSCustomTrayIcon);
|
||||
if UnityAppIndicatorInit then
|
||||
RegisterWSComponent(TCustomTrayIcon, TUnityWSCustomTrayIcon)
|
||||
else
|
||||
RegisterWSComponent(TCustomTrayIcon, TGtk2WSCustomTrayIcon);
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
|
||||
@ -9,8 +9,8 @@ interface
|
||||
{$mode delphi}
|
||||
uses
|
||||
GLib2, Gtk2, Gdk2, Gdk2Pixbuf,
|
||||
Classes, SysUtils, Graphics,
|
||||
Controls, Forms, ExtCtrls, WSExtCtrls, LCLType;
|
||||
Classes, SysUtils, dynlibs,
|
||||
Graphics, Controls, Forms, ExtCtrls, WSExtCtrls, LCLType;
|
||||
|
||||
{ TUnityWSCustomTrayIcon is the class for tray icons on systems
|
||||
running the Unity desktop environment.
|
||||
@ -39,7 +39,7 @@ type
|
||||
class function Hide(const ATrayIcon: TCustomTrayIcon): Boolean; override;
|
||||
class function Show(const ATrayIcon: TCustomTrayIcon): Boolean; override;
|
||||
class procedure InternalUpdate(const ATrayIcon: TCustomTrayIcon); override;
|
||||
class function GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint; override;
|
||||
class function GetPosition(const {%H-}ATrayIcon: TCustomTrayIcon): TPoint; override;
|
||||
end;
|
||||
|
||||
{ UnityAppIndicatorInit returns true if appindicator libraries can be loaded }
|
||||
@ -253,8 +253,6 @@ var
|
||||
Result := Proc <> nil;
|
||||
end;
|
||||
|
||||
var
|
||||
S: string;
|
||||
begin
|
||||
Result := False;
|
||||
if Loaded then
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -7,7 +7,7 @@ unit LCL;
|
||||
interface
|
||||
|
||||
uses
|
||||
AllLCLIntfUnits, LazarusPackageIntf;
|
||||
UnityWSCtrls, AllLCLIntfUnits, LazarusPackageIntf;
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user