mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 02:59:41 +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 setToolTip(tip: WideString);
|
||||
procedure signalActivated(AReason: QSystemTrayIconActivationReason); cdecl;
|
||||
procedure showBaloonHint(const ATitle, AHint: String;
|
||||
const AFlag: QSystemTrayIconMessageIcon; const ATimeOut: Integer);
|
||||
procedure show;
|
||||
procedure hide;
|
||||
end;
|
||||
@ -2899,6 +2901,17 @@ begin
|
||||
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;
|
||||
begin
|
||||
QSystemTrayIcon_show(handle);
|
||||
|
@ -189,6 +189,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 ShowBalloonHint(const ATrayIcon: TCustomTrayIcon): Boolean; override;
|
||||
class function GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint; override;
|
||||
end;
|
||||
|
||||
@ -538,6 +539,22 @@ begin
|
||||
SystemTrayIcon.setContextMenu(QMenuH(TQtMenu(ATrayIcon.PopUpMenu.Handle).Widget));
|
||||
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;
|
||||
begin
|
||||
Result := Point(0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user