feat: add optional animation parameter to BrowserWindow.setVibrancy (#35987)

adds optional animation parameter to BrowserWindow.setVibrancy
This commit is contained in:
Gellert Hegyi 2024-11-12 18:03:30 +01:00 committed by GitHub
parent a6390b539c
commit 7a79d4c96e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 66 additions and 19 deletions

View file

@ -810,9 +810,18 @@ void BaseWindow::SetAutoHideCursor(bool auto_hide) {
window_->SetAutoHideCursor(auto_hide);
}
void BaseWindow::SetVibrancy(v8::Isolate* isolate, v8::Local<v8::Value> value) {
void BaseWindow::SetVibrancy(v8::Isolate* isolate,
v8::Local<v8::Value> value,
gin_helper::Arguments* args) {
std::string type = gin::V8ToString(isolate, value);
window_->SetVibrancy(type);
gin_helper::Dictionary options;
int animation_duration_ms = 0;
if (args->GetNext(&options)) {
options.Get("animationDuration", &animation_duration_ms);
}
window_->SetVibrancy(type, animation_duration_ms);
}
void BaseWindow::SetBackgroundMaterial(const std::string& material_type) {