Jump to content
Sign in to follow this  
pyscripter

EdgeBrowser flicker

Recommended Posts

For years there have been rants about flicker in Vcl applications.   So when I tried to fast resize a form with an EdgeBrowser and saw the browser scrollbar jumping right and left, I assumed that it is Delphi's problem.  Then I tried the same with Edge and the result was the same.  Massive flicker when the scrollbar is visible!   Bravo Microsoft!  In fact Edge flickers even without scrollbars, whilst Delphi's EdgeBrowser doesn't.

 

By the way does anyone know how to Vcl style the EdgeBrowser scrollbar?

Edited by pyscripter

Share this post


Link to post
1 hour ago, pyscripter said:

By the way does anyone know how to Vcl style the EdgeBrowser scrollbar?

In case anyone has a use for it, here is how you can set the browser color scheme:

 

procedure TForm2.SetColorScheme(Dark: Boolean);
var
  Profile: ICoreWebView2Profile;
  Scheme: COREWEBVIEW2_PREFERRED_COLOR_SCHEME;
begin
  if Dark then
    Scheme := COREWEBVIEW2_PREFERRED_COLOR_SCHEME_DARK
  else
    Scheme := COREWEBVIEW2_PREFERRED_COLOR_SCHEME_LIGHT;
  (EdgeBrowser.DefaultInterface as ICoreWebView2_13).Get_Profile(Profile);
  Profile.Set_PreferredColorScheme(Scheme);
end;

function IsStyleDark: Boolean;
var
  LStyle: TCustomStyleServices;
  LColor: TColor;
begin
  Result := False;
  LStyle := TStyleManager.ActiveStyle;
  if Assigned(LStyle) then
  begin
    LColor := LStyle.GetSystemColor(clWindow);
    // Check if the background color is dark
    Result := (LColor and $FFFFFF) < $808080;
  end;
end;
                                             
  Form2.SetColorScheme(IsStyleDark);
  Form2.EdgeBrowser.NavigateToString(Html);                                             

 

Edited by pyscripter
  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×