mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2024-11-15 07:45:56 +01:00
Fixed a size issue in SimpleFMXBrowser with a high DPI screen
This commit is contained in:
parent
25edba76e8
commit
3fef420fff
@ -78,6 +78,13 @@ object SimpleFMXBrowserFrm: TSimpleFMXBrowserFrm
|
||||
Left = 40
|
||||
Top = 192
|
||||
end
|
||||
object BrowserLay: TLayout
|
||||
Align = Client
|
||||
Size.Width = 1000.000000000000000000
|
||||
Size.Height = 565.000000000000000000
|
||||
Size.PlatformDefault = False
|
||||
TabOrder = 6
|
||||
end
|
||||
object FMXChromium1: TFMXChromium
|
||||
OnBeforeContextMenu = FMXChromium1BeforeContextMenu
|
||||
OnContextMenuCommand = FMXChromium1ContextMenuCommand
|
||||
|
@ -66,6 +66,7 @@ type
|
||||
Layout1: TLayout;
|
||||
GoBtn: TButton;
|
||||
SnapShotBtn: TButton;
|
||||
BrowserLay: TLayout;
|
||||
|
||||
procedure GoBtnClick(Sender: TObject);
|
||||
procedure Timer1Timer(Sender: TObject);
|
||||
@ -377,6 +378,7 @@ begin
|
||||
begin
|
||||
FClosing := True;
|
||||
Visible := False;
|
||||
|
||||
FMXChromium1.CloseBrowser(True);
|
||||
end;
|
||||
end;
|
||||
@ -403,10 +405,10 @@ var
|
||||
TempScale : single;
|
||||
begin
|
||||
TempScale := FMXChromium1.ScreenScale;
|
||||
Result.Left := 0;
|
||||
Result.Top := round(AddressPnl.Height * TempScale);
|
||||
Result.Right := round(ClientWidth * TempScale) - 1;
|
||||
Result.Bottom := round(ClientHeight * TempScale) - 1;
|
||||
Result.Left := round(BrowserLay.Position.x);
|
||||
Result.Top := round(BrowserLay.Position.y);
|
||||
Result.Right := Result.Left + round(BrowserLay.Width * TempScale);
|
||||
Result.Bottom := Result.Top + round(BrowserLay.Height * TempScale);
|
||||
end;
|
||||
|
||||
procedure TSimpleFMXBrowserFrm.ResizeChild;
|
||||
@ -473,7 +475,9 @@ begin
|
||||
TempRect.Bottom := round(TempClientRect.Bottom);
|
||||
|
||||
FMXChromium1.DefaultUrl := AddressEdt.Text;
|
||||
if not(FMXChromium1.CreateBrowser(TempHandle, TempRect)) then Timer1.Enabled := True;
|
||||
|
||||
if not(FMXChromium1.CreateBrowser(TempHandle, TempRect)) then
|
||||
Timer1.Enabled := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -487,7 +491,9 @@ var
|
||||
PositionChanged: Boolean;
|
||||
begin
|
||||
PositionChanged := (ALeft <> Left) or (ATop <> Top);
|
||||
|
||||
inherited SetBounds(ALeft, ATop, AWidth, AHeight);
|
||||
|
||||
if PositionChanged then
|
||||
NotifyMoveOrResizeStarted;
|
||||
end;
|
||||
|
@ -2,7 +2,7 @@
|
||||
"UpdateLazPackages" : [
|
||||
{
|
||||
"ForceNotify" : true,
|
||||
"InternalVersion" : 338,
|
||||
"InternalVersion" : 339,
|
||||
"Name" : "cef4delphi_lazarus.lpk",
|
||||
"Version" : "96.0.16.0"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user