1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-06-12 22:07:39 +02:00

Fixed backwards compatibility issue in FMXTabbedBrowser demo

This commit is contained in:
salvadordf
2022-07-04 15:41:27 +02:00
parent 317e4eae16
commit 15cb66e1f1
2 changed files with 8 additions and 9 deletions

View File

@ -93,7 +93,7 @@ type
function GetParentForm : TCustomForm; function GetParentForm : TCustomForm;
function GetParentTab : TTabItem; function GetParentTab : TTabItem;
function GetFMXWindowParentRect : TRectF; function GetFMXWindowParentRect : TRect;
procedure CreateFMXWindowParent; procedure CreateFMXWindowParent;
public public
@ -140,18 +140,17 @@ begin
FMXWindowParent := nil; FMXWindowParent := nil;
end; end;
function TBrowserFrame.GetFMXWindowParentRect : TRectF; function TBrowserFrame.GetFMXWindowParentRect : TRect;
var var
TempRect : TRectF;
TempPoint : TPointF; TempPoint : TPointF;
TempScale : single; TempScale : single;
begin begin
TempScale := FMXChromium1.ScreenScale; TempScale := FMXChromium1.ScreenScale;
TempPoint := LocalToAbsolute(WindowParentLay.Position.Point); TempPoint := LocalToAbsolute(WindowParentLay.Position.Point);
Result.Left := TempPoint.x; Result.Left := round(TempPoint.x);
Result.Top := TempPoint.y; Result.Top := round(TempPoint.y);
Result.Right := TempPoint.x + (WindowParentLay.Width * TempScale); Result.Right := round(TempPoint.x + (WindowParentLay.Width * TempScale));
Result.Bottom := TempPoint.y + (WindowParentLay.Height * TempScale); Result.Bottom := round(TempPoint.y + (WindowParentLay.Height * TempScale));
end; end;
procedure TBrowserFrame.ReloadBtnClick(Sender: TObject); procedure TBrowserFrame.ReloadBtnClick(Sender: TObject);
@ -162,7 +161,7 @@ end;
procedure TBrowserFrame.ResizeBrowser; procedure TBrowserFrame.ResizeBrowser;
begin begin
if (FMXWindowParent <> nil) then if (FMXWindowParent <> nil) then
FMXWindowParent.SetBoundsF(GetFMXWindowParentRect); FMXWindowParent.SetBounds(GetFMXWindowParentRect);
end; end;
procedure TBrowserFrame.ShowBrowser; procedure TBrowserFrame.ShowBrowser;

View File

@ -2,7 +2,7 @@
"UpdateLazPackages" : [ "UpdateLazPackages" : [
{ {
"ForceNotify" : true, "ForceNotify" : true,
"InternalVersion" : 411, "InternalVersion" : 412,
"Name" : "cef4delphi_lazarus.lpk", "Name" : "cef4delphi_lazarus.lpk",
"Version" : "103.0.8.0" "Version" : "103.0.8.0"
} }