mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
views: mac: Support dynamic resize of title bar height (see #3189)
This is intended for usage with frameless windows that show the standard window buttons, where resizing the title bar height changes the button offset. Returning a different value from CefWindowDelegate::GetTitlebarHeight and forcing a resize of the NSWindow's theme frame (see ViewsWindow::NudgeWindow) will update the title bar height. To test: 1. Run `cefclient --use-views --hide-frame --show-window-buttons --url=http://tests/window` 2. Enter a new value for title bar height and click the "Set Titlebar Height" button
This commit is contained in:
committed by
Marshall Greenblatt
parent
0a2c7a1070
commit
c83b3cda24
@@ -6,15 +6,18 @@
|
||||
#define CEF_LIBCEF_BROWSER_VIEWS_NATIVE_WIDGET_MAC_H_
|
||||
#pragma once
|
||||
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "include/internal/cef_ptr.h"
|
||||
|
||||
#include "ui/views/widget/native_widget_mac.h"
|
||||
|
||||
class CefWindow;
|
||||
class CefWindowDelegate;
|
||||
|
||||
class CefNativeWidgetMac : public views::NativeWidgetMac {
|
||||
public:
|
||||
CefNativeWidgetMac(views::internal::NativeWidgetDelegate* delegate,
|
||||
bool is_frameless,
|
||||
bool with_window_buttons,
|
||||
absl::optional<float> title_bar_height);
|
||||
CefRefPtr<CefWindow> window,
|
||||
CefWindowDelegate* window_delegate);
|
||||
~CefNativeWidgetMac() override = default;
|
||||
|
||||
CefNativeWidgetMac(const CefNativeWidgetMac&) = delete;
|
||||
@@ -29,9 +32,8 @@ class CefNativeWidgetMac : public views::NativeWidgetMac {
|
||||
float* titlebar_height) override;
|
||||
|
||||
private:
|
||||
const bool is_frameless_;
|
||||
const bool with_window_buttons_;
|
||||
const absl::optional<float> title_bar_height_;
|
||||
const CefRefPtr<CefWindow> window_;
|
||||
CefWindowDelegate* const window_delegate_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_VIEWS_NATIVE_WIDGET_MAC_H_
|
||||
|
Reference in New Issue
Block a user