how to change the background color of title bar?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

how to change the background color of title bar?

Postby darknoll » Sat Apr 25, 2020 10:40 pm

Code: Select all
class WindowDelegate : public CefWindowDelegate {
      public:

         explicit WindowDelegate(CefRefPtr<CefBrowserView> browser_view)
            : browser_view_(browser_view) {}

         void OnWindowCreated(CefRefPtr<CefWindow> window) OVERRIDE
         {
            // Add the browser view and show the window.
            window->AddChildView(browser_view_);
            window->CenterWindow(CefSize(800, 600));
            window->SetTitle("test");
            window->Show();

            // Give keyboard focus to the browser view.
            browser_view_->RequestFocus();
         }


I use the views framework, and i don't know how to change the background color of title bar(default is white)
darknoll
Newbie
 
Posts: 2
Joined: Sat Apr 25, 2020 10:36 pm

Re: how to change the background color of title bar?

Postby magreenblatt » Mon Apr 27, 2020 11:19 am

The title bar is rendered by the OS based on the user's theme colors. If you want to change the color you will need to custom render the title bar using OS API functions, or remove the title bar completely and create a replacement in your application.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 60 guests