views: Use default theme background color for all controls (see #3671)

Add new CefViewDelegate::OnThemeChanged callback for optionally overriding
default theme colors when the current theme changes.
This commit is contained in:
Marshall Greenblatt
2024-03-22 19:51:00 -04:00
parent a13b6dc7f6
commit 19ba8b2b8d
43 changed files with 510 additions and 102 deletions

View File

@@ -21,7 +21,9 @@ namespace client {
// Implements a menu bar which is composed of CefMenuButtons positioned in a
// row with automatic switching between them via mouse/keyboard. All methods
// must be called on the browser process UI thread.
class ViewsMenuBar : public CefMenuButtonDelegate, public CefMenuModelDelegate {
class ViewsMenuBar : public CefMenuButtonDelegate,
public CefMenuModelDelegate,
public CefPanelDelegate {
public:
// Delegate methods will be called on the browser process UI thread.
class Delegate {
@@ -90,6 +92,9 @@ class ViewsMenuBar : public CefMenuButtonDelegate, public CefMenuModelDelegate {
bool is_rtl) override;
void MenuClosed(CefRefPtr<CefMenuModel> menu_model) override;
// CefViewDelegate methods:
void OnThemeChanged(CefRefPtr<CefView> view) override;
private:
// Creates the menu panel if it doesn't already exist.
void EnsureMenuPanel();