mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 21:20:46 +02:00
Qt: TQtSystemTrayIcon added ShowBaloonHint()
git-svn-id: trunk@21909 -
This commit is contained in:
parent
b8a7060466
commit
5e2b10ec3d
@ -430,6 +430,8 @@ type
|
|||||||
procedure setIcon(icon: QIconH);
|
procedure setIcon(icon: QIconH);
|
||||||
procedure setToolTip(tip: WideString);
|
procedure setToolTip(tip: WideString);
|
||||||
procedure signalActivated(AReason: QSystemTrayIconActivationReason); cdecl;
|
procedure signalActivated(AReason: QSystemTrayIconActivationReason); cdecl;
|
||||||
|
procedure showBaloonHint(const ATitle, AHint: String;
|
||||||
|
const AFlag: QSystemTrayIconMessageIcon; const ATimeOut: Integer);
|
||||||
procedure show;
|
procedure show;
|
||||||
procedure hide;
|
procedure hide;
|
||||||
end;
|
end;
|
||||||
@ -2899,6 +2901,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TQtSystemTrayIcon.showBaloonHint(const ATitle, AHint: String;
|
||||||
|
const AFlag: QSystemTrayIconMessageIcon; const ATimeOut: Integer);
|
||||||
|
var
|
||||||
|
WHint: WideString;
|
||||||
|
WTitle: WideString;
|
||||||
|
begin
|
||||||
|
WHint := GetUTF8String(AHint);
|
||||||
|
WTitle := GetUTF8String(ATitle);
|
||||||
|
QSystemTrayIcon_showMessage(Handle, @WTitle, @WHint, AFlag, ATimeOut);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TQtSystemTrayIcon.show;
|
procedure TQtSystemTrayIcon.show;
|
||||||
begin
|
begin
|
||||||
QSystemTrayIcon_show(handle);
|
QSystemTrayIcon_show(handle);
|
||||||
|
@ -189,6 +189,7 @@ type
|
|||||||
class function Hide(const ATrayIcon: TCustomTrayIcon): Boolean; override;
|
class function Hide(const ATrayIcon: TCustomTrayIcon): Boolean; override;
|
||||||
class function Show(const ATrayIcon: TCustomTrayIcon): Boolean; override;
|
class function Show(const ATrayIcon: TCustomTrayIcon): Boolean; override;
|
||||||
class procedure InternalUpdate(const ATrayIcon: TCustomTrayIcon); override;
|
class procedure InternalUpdate(const ATrayIcon: TCustomTrayIcon); override;
|
||||||
|
class function ShowBalloonHint(const ATrayIcon: TCustomTrayIcon): Boolean; override;
|
||||||
class function GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint; override;
|
class function GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -538,6 +539,22 @@ begin
|
|||||||
SystemTrayIcon.setContextMenu(QMenuH(TQtMenu(ATrayIcon.PopUpMenu.Handle).Widget));
|
SystemTrayIcon.setContextMenu(QMenuH(TQtMenu(ATrayIcon.PopUpMenu.Handle).Widget));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class function TQtWSCustomTrayIcon.ShowBalloonHint(
|
||||||
|
const ATrayIcon: TCustomTrayIcon): Boolean;
|
||||||
|
var
|
||||||
|
QtTrayIcon: TQtSystemTrayIcon;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
if (ATrayIcon.Handle = 0) then Exit;
|
||||||
|
QtTrayIcon := TQtSystemTrayIcon(ATrayIcon.Handle);
|
||||||
|
|
||||||
|
QtTrayIcon.showBaloonHint(ATrayIcon.BalloonTitle, ATrayIcon.BalloonHint,
|
||||||
|
QSystemTrayIconMessageIcon(Ord(ATrayIcon.BalloonFlags)),
|
||||||
|
ATrayIcon.BalloonTimeout);
|
||||||
|
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
|
||||||
class function TQtWSCustomTrayIcon.GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint;
|
class function TQtWSCustomTrayIcon.GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint;
|
||||||
begin
|
begin
|
||||||
Result := Point(0, 0);
|
Result := Point(0, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user