mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: make SetWindowButtonVisibility work for customButtonsOnHover (#27073)
This commit is contained in:
@@ -845,6 +845,14 @@ void BaseWindow::SetVibrancy(v8::Isolate* isolate, v8::Local<v8::Value> value) {
|
||||
}
|
||||
|
||||
#if defined(OS_MAC)
|
||||
void BaseWindow::SetWindowButtonVisibility(bool visible) {
|
||||
window_->SetWindowButtonVisibility(visible);
|
||||
}
|
||||
|
||||
bool BaseWindow::GetWindowButtonVisibility() const {
|
||||
return window_->GetWindowButtonVisibility();
|
||||
}
|
||||
|
||||
void BaseWindow::SetTrafficLightPosition(const gfx::Point& position) {
|
||||
// For backward compatibility we treat (0, 0) as reseting to default.
|
||||
if (position.IsOrigin())
|
||||
@@ -898,13 +906,6 @@ void BaseWindow::AddTabbedWindow(NativeWindow* window,
|
||||
args->ThrowError("AddTabbedWindow cannot be called by a window on itself.");
|
||||
}
|
||||
|
||||
void BaseWindow::SetWindowButtonVisibility(bool visible,
|
||||
gin_helper::Arguments* args) {
|
||||
if (!window_->SetWindowButtonVisibility(visible)) {
|
||||
args->ThrowError("Not supported for this window");
|
||||
}
|
||||
}
|
||||
|
||||
void BaseWindow::SetAutoHideMenuBar(bool auto_hide) {
|
||||
window_->SetAutoHideMenuBar(auto_hide);
|
||||
}
|
||||
@@ -1243,6 +1244,8 @@ void BaseWindow::BuildPrototype(v8::Isolate* isolate,
|
||||
.SetMethod("addTabbedWindow", &BaseWindow::AddTabbedWindow)
|
||||
.SetMethod("setWindowButtonVisibility",
|
||||
&BaseWindow::SetWindowButtonVisibility)
|
||||
.SetMethod("_getWindowButtonVisibility",
|
||||
&BaseWindow::GetWindowButtonVisibility)
|
||||
.SetProperty("excludedFromShownWindowsMenu",
|
||||
&BaseWindow::IsExcludedFromShownWindowsMenu,
|
||||
&BaseWindow::SetExcludedFromShownWindowsMenu)
|
||||
|
||||
@@ -189,6 +189,8 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
|
||||
virtual void SetVibrancy(v8::Isolate* isolate, v8::Local<v8::Value> value);
|
||||
|
||||
#if defined(OS_MAC)
|
||||
void SetWindowButtonVisibility(bool visible);
|
||||
bool GetWindowButtonVisibility() const;
|
||||
void SetTrafficLightPosition(const gfx::Point& position);
|
||||
gfx::Point GetTrafficLightPosition() const;
|
||||
#endif
|
||||
@@ -202,7 +204,6 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
|
||||
void MoveTabToNewWindow();
|
||||
void ToggleTabBar();
|
||||
void AddTabbedWindow(NativeWindow* window, gin_helper::Arguments* args);
|
||||
void SetWindowButtonVisibility(bool visible, gin_helper::Arguments* args);
|
||||
void SetAutoHideMenuBar(bool auto_hide);
|
||||
bool IsMenuBarAutoHide();
|
||||
void SetMenuBarVisibility(bool visible);
|
||||
|
||||
Reference in New Issue
Block a user