feat: view.getVisible() (#45409)

* feat: view.getVisible()

Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>

* test: visible apis

Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>

* docs: clarify getVisible

Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
This commit is contained in:
trop[bot] 2025-02-05 15:50:00 -05:00 committed by GitHub
parent a07de0099c
commit f40fc49461
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 26 additions and 1 deletions

View file

@ -387,6 +387,10 @@ void View::SetVisible(bool visible) {
view_->SetVisible(visible);
}
bool View::GetVisible() const {
return view_ ? view_->GetVisible() : false;
}
void View::OnViewBoundsChanged(views::View* observed_view) {
ApplyBorderRadius();
Emit("bounds-changed");
@ -445,7 +449,8 @@ void View::BuildPrototype(v8::Isolate* isolate,
.SetMethod("setBackgroundColor", &View::SetBackgroundColor)
.SetMethod("setBorderRadius", &View::SetBorderRadius)
.SetMethod("setLayout", &View::SetLayout)
.SetMethod("setVisible", &View::SetVisible);
.SetMethod("setVisible", &View::SetVisible)
.SetMethod("getVisible", &View::GetVisible);
}
} // namespace electron::api