lcl: less hints

git-svn-id: trunk@51807 -
This commit is contained in:
mattias 2016-03-02 15:47:29 +00:00
parent 5e30a09527
commit a91592bbb9
2 changed files with 16 additions and 14 deletions

View File

@ -2059,7 +2059,7 @@ var
(csDesigning in AWinControl.ComponentState) then
exit;
MessI.Msg := CheckMouseButtonDownUp(TLCLIntfHandle(widget), AWinControl, LastMouse, EventXY, MouseButton, True);
MessI.Msg := CheckMouseButtonDownUp({%H-}TLCLIntfHandle(widget), AWinControl, LastMouse, EventXY, MouseButton, True);
MessI.Keys := MessI.Keys or BtnKey;
case LastMouse.ClickCount of
2: MessI.Keys := MessI.Keys or MK_DOUBLECLICK;
@ -2225,9 +2225,11 @@ var
MappedXY: TPoint;
EventXY: TPoint;
function CheckMouseButtonUp(MouseButton, BtnKey: longint): boolean;
function CheckMouseButtonUp(MouseButton, MsgID: longint): boolean;
begin
MessI.Msg := CheckMouseButtonDownUp(TLCLIntfHandle(widget), AWinControl, LastMouse, EventXY, MouseButton, False);
if MsgID=0 then ;
MessI.Msg := CheckMouseButtonDownUp({%H-}TLCLIntfHandle(widget),
AWinControl, LastMouse, EventXY, MouseButton, False);
Result := True;
end;

View File

@ -8,7 +8,7 @@ interface
{$mode delphi}
uses
GLib2, Gtk2, Gdk2, Gdk2Pixbuf,
GLib2, Gtk2, Gdk2Pixbuf,
Classes, SysUtils, dynlibs,
Graphics, Controls, Forms, ExtCtrls, WSExtCtrls, LCLType;
@ -51,14 +51,14 @@ implementation
const
libappindicator = 'libappindicator.so.1';
const
{const
APP_INDICATOR_SIGNAL_NEW_ICON = 'new-icon';
APP_INDICATOR_SIGNAL_NEW_ATTENTION_ICON = 'new-attention-icon';
APP_INDICATOR_SIGNAL_NEW_STATUS = 'new-status';
APP_INDICATOR_SIGNAL_NEW_LABEL = 'new-label';
APP_INDICATOR_SIGNAL_CONNECTION_CHANGED = 'connection-changed';
APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH = 'new-icon-theme-path';
}
type
TAppIndicatorCategory = (
APP_INDICATOR_CATEGORY_APPLICATION_STATUS,
@ -137,14 +137,14 @@ begin
inherited Create;
FTrayIcon := TrayIcon;
FName := 'app-' + IntToHex(IntPtr(Application), SizeOf(IntPtr) * 2);
NewIcon := Pointer(FTrayIcon.Icon.Handle);
NewIcon := {%H-}Pointer(FTrayIcon.Icon.Handle);
if NewIcon = nil then
NewIcon := Pointer(Application.Icon.Handle);
NewIcon := {%H-}Pointer(Application.Icon.Handle);
if NewIcon <> GlobalIcon then
begin
GlobalIcon := NewIcon;
ForceDirectories(IconThemePath);
FIconName := FName + '-' + IntToHex(IntPtr(GlobalIcon), SizeOf(GlobalIcon) * 2);
FIconName := FName + '-' + IntToHex({%H-}IntPtr(GlobalIcon), SizeOf(GlobalIcon) * 2);
if FileExists(GlobalIconPath) then
DeleteFile(GlobalIconPath);
GlobalIconPath := IconThemePath + FIconName + '.' + IconType;
@ -153,7 +153,7 @@ begin
app_indicator_set_icon(GlobalAppIndicator, PChar(FIconName));
end
else
FIconName := FName + '-' + IntToHex(IntPtr(GlobalIcon), SizeOf(GlobalIcon) * 2);
FIconName := FName + '-' + IntToHex({%H-}IntPtr(GlobalIcon), SizeOf(GlobalIcon) * 2);
{ Only the first created AppIndicator is functional }
if GlobalAppIndicator = nil then
{ It seems that icons can only come from files :( }
@ -173,13 +173,13 @@ procedure TUnityTrayIconHandle.Update;
var
NewIcon: Pointer;
begin
NewIcon := Pointer(FTrayIcon.Icon.Handle);
NewIcon := {%H-}Pointer(FTrayIcon.Icon.Handle);
if NewIcon = nil then
NewIcon := Pointer(Application.Icon.Handle);
NewIcon := {%H-}Pointer(Application.Icon.Handle);
if NewIcon <> GlobalIcon then
begin
GlobalIcon := NewIcon;
FIconName := FName + '-' + IntToHex(IntPtr(GlobalIcon), SizeOf(GlobalIcon) * 2);
FIconName := FName + '-' + IntToHex({%H-}IntPtr(GlobalIcon), SizeOf(GlobalIcon) * 2);
ForceDirectories(IconThemePath);
if FileExists(GlobalIconPath) then
DeleteFile(GlobalIconPath);
@ -190,7 +190,7 @@ begin
end;
{ It seems to me you can only set the menu once for an AppIndicator }
if (app_indicator_get_menu(GlobalAppIndicator) = nil) and (FTrayIcon.PopUpMenu <> nil) then
app_indicator_set_menu(GlobalAppIndicator, PGtkMenu(FTrayIcon.PopUpMenu.Handle));
app_indicator_set_menu(GlobalAppIndicator, {%H-}PGtkMenu(FTrayIcon.PopUpMenu.Handle));
app_indicator_set_status(GlobalAppIndicator, APP_INDICATOR_STATUS_ACTIVE);
end;