mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: make trafficLightPosition work for customButtonOnHover (#26789)
This commit is contained in:
@@ -842,11 +842,16 @@ void BaseWindow::SetVibrancy(v8::Isolate* isolate, v8::Local<v8::Value> value) {
|
||||
|
||||
#if defined(OS_MAC)
|
||||
void BaseWindow::SetTrafficLightPosition(const gfx::Point& position) {
|
||||
window_->SetTrafficLightPosition(position);
|
||||
// For backward compatibility we treat (0, 0) as reseting to default.
|
||||
if (position.IsOrigin())
|
||||
window_->SetTrafficLightPosition(base::nullopt);
|
||||
else
|
||||
window_->SetTrafficLightPosition(position);
|
||||
}
|
||||
|
||||
gfx::Point BaseWindow::GetTrafficLightPosition() const {
|
||||
return window_->GetTrafficLightPosition();
|
||||
// For backward compatibility we treat default value as (0, 0).
|
||||
return window_->GetTrafficLightPosition().value_or(gfx::Point());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user