Page 1 of 1

devtools close button

Posted: Sun May 09, 2021 1:01 pm
by coater
In chrome "close" button exist on the upper right corner of devtools.
How to enable this in CEF4? Keen for your help, thank you!

Re: devtools close button

Posted: Sun May 09, 2021 1:45 pm
by salvadordf
You have to add a Delphi TButton (or any other control) that hides the devtools for yourself.

I did that in BriskBard with a TSpeedButton.

Re: devtools close button

Posted: Sun May 09, 2021 3:19 pm
by coater
Thank you for your help!
I found that a panel is also added to put the close button in the app.
chrome add it in devtools panel.
The later will be difficult to do : even I can draw a button But I cannot figure out the rect.

Re: devtools close button

Posted: Tue May 11, 2021 5:13 am
by coater
After searching "customize and control devtools" in google I find the follows:
https://chromium.googlesource.com/devtools/devtools-frontend/+/f1f00fa32ac4bb8470de40bc506e36d13a8babbd/front_end/main/main_strings.grdp

Code: Select all

chromium / devtools / devtools-frontend / f1f00fa32ac4bb8470de40bc506e36d13a8babbd / . / front_end / main / main_strings.grdp
<message name="IDS_DEVTOOLS_08e71f00acd63d0a546ba42f9e780ddc" desc="Title of item in main">
    Customize and control DevTools
 
https://chromium.googlesource.com/devtools/devtools-frontend/+/9f27b41d945b2e94033c095396e8886f571c5c86/front_end/Images/
https://docs.google.com/document/d/1EA--IokG6YW51y7unS8dIKUx6EtyjETT0uglmvIpfsg/edit#

it seems that new icons can be added.

How can we obtain the message "IDS_DEVTOOLS_08e71f00acd63d0a546ba42f9e780ddc" in cef4? Thank you!

Re: devtools close button

Posted: Tue May 11, 2021 4:45 pm
by salvadordf
I'm sorry but I've never seen a DevTools message or method called like that.

Re: devtools close button

Posted: Wed May 12, 2021 7:08 am
by coater
Thank you!
I add a close speedbutton from form. The weight of right of the topright devtools panel bar won't change basically when the form was resized .

I thought that I can use scanline to judge the position to put the button after form are resized, but that may be cause delay sometimes I think.