You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-09-30 21:28:55 +02:00
Added transparency test code to SimpleOSRBrowser in QT
This commit is contained in:
@@ -12,6 +12,11 @@ uses
|
||||
{$IFDEF LCLQT6}qt6,{$ENDIF}
|
||||
uCEFBufferPanel, uCEFChromium, uCEFInterfaces, uCEFTypes;
|
||||
|
||||
const
|
||||
// Set this constant to True and load "file:///<path-to-CEF4Delphi>/bin/transparency.html" to test a
|
||||
// transparent browser.
|
||||
TRANSPARENT_BROWSER = True;
|
||||
|
||||
type
|
||||
|
||||
{ TMainForm }
|
||||
@@ -219,6 +224,13 @@ begin
|
||||
GlobalCEFApp.DisableZygote := True;
|
||||
GlobalCEFApp.WindowlessRenderingEnabled := True;
|
||||
GlobalCEFApp.OnContextInitialized := @GlobalCEFApp_OnContextInitialized;
|
||||
|
||||
// If you need transparency leave the GlobalCEFApp.BackgroundColor property
|
||||
// with the default value or set the alpha channel to 0
|
||||
if TRANSPARENT_BROWSER then
|
||||
GlobalCEFApp.BackgroundColor := CefColorSetARGB($00, $00, $00, $00)
|
||||
else
|
||||
GlobalCEFApp.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF);
|
||||
end;
|
||||
|
||||
function StartMainProcess: boolean;
|
||||
@@ -614,8 +626,13 @@ begin
|
||||
|
||||
UpdatePanelOffset;
|
||||
|
||||
// opaque white background color
|
||||
// If you need transparency leave the Chromium1.Options.BackgroundColor property
|
||||
// with the default value or set the alpha channel to 0
|
||||
if TRANSPARENT_BROWSER then
|
||||
Chromium1.Options.BackgroundColor := CefColorSetARGB($00, $00, $00, $00)
|
||||
else
|
||||
Chromium1.Options.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF);
|
||||
|
||||
Chromium1.DefaultURL := UTF8Decode(AddressCb.Text);
|
||||
|
||||
Chromium1.CreateBrowser;
|
||||
|
@@ -12,6 +12,11 @@ uses
|
||||
{$IFDEF LCLQT6}qt6,{$ENDIF}
|
||||
uCEFBufferPanel, uCEFChromium, uCEFInterfaces, uCEFTypes;
|
||||
|
||||
const
|
||||
// Set this constant to True and load "file:///<path-to-CEF4Delphi>/bin/transparency.html" to test a
|
||||
// transparent browser.
|
||||
TRANSPARENT_BROWSER = True;
|
||||
|
||||
type
|
||||
|
||||
{ TMainForm }
|
||||
@@ -219,6 +224,13 @@ begin
|
||||
GlobalCEFApp.SetCurrentDir := True;
|
||||
GlobalCEFApp.DisableZygote := True;
|
||||
GlobalCEFApp.OnContextInitialized := @GlobalCEFApp_OnContextInitialized;
|
||||
|
||||
// If you need transparency leave the GlobalCEFApp.BackgroundColor property
|
||||
// with the default value or set the alpha channel to 0
|
||||
if TRANSPARENT_BROWSER then
|
||||
GlobalCEFApp.BackgroundColor := CefColorSetARGB($00, $00, $00, $00)
|
||||
else
|
||||
GlobalCEFApp.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF);
|
||||
end;
|
||||
|
||||
function StartMainProcess: boolean;
|
||||
@@ -614,8 +626,13 @@ begin
|
||||
|
||||
UpdatePanelOffset;
|
||||
|
||||
// opaque white background color
|
||||
// If you need transparency leave the Chromium1.Options.BackgroundColor property
|
||||
// with the default value or set the alpha channel to 0
|
||||
if TRANSPARENT_BROWSER then
|
||||
Chromium1.Options.BackgroundColor := CefColorSetARGB($00, $00, $00, $00)
|
||||
else
|
||||
Chromium1.Options.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF);
|
||||
|
||||
Chromium1.DefaultURL := UTF8Decode(AddressCb.Text);
|
||||
|
||||
Chromium1.CreateBrowser;
|
||||
|
@@ -2,7 +2,7 @@
|
||||
"UpdateLazPackages" : [
|
||||
{
|
||||
"ForceNotify" : true,
|
||||
"InternalVersion" : 791,
|
||||
"InternalVersion" : 792,
|
||||
"Name" : "cef4delphi_lazarus.lpk",
|
||||
"Version" : "140.1.14"
|
||||
}
|
||||
|
Reference in New Issue
Block a user