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