LCL: Implement TTrayIcon on Unity for GTK2. Issue #29599, patch from Anthony Walter.

git-svn-id: trunk@51565 -
This commit is contained in:
juha 2016-02-10 11:51:57 +00:00
parent 9fb950e45d
commit e46e912fff
4 changed files with 430 additions and 424 deletions

View File

@ -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;

View File

@ -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

View File

@ -7,7 +7,7 @@ unit LCL;
interface
uses
AllLCLIntfUnits, LazarusPackageIntf;
UnityWSCtrls, AllLCLIntfUnits, LazarusPackageIntf;
implementation