fix: make SetWindowButtonVisibility work for customButtonsOnHover (#27073)
This commit is contained in:
parent
5e7e0a4c7e
commit
c3091c3a70
9 changed files with 87 additions and 52 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue