mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
feat: add BrowserWindow.isSnapped() (#46079)
* feat: add BrowserWindow.isSnapped() on Windows * docs: mark _Readonly_
This commit is contained in:
@@ -1091,6 +1091,10 @@ void BaseWindow::SetAppDetails(const gin_helper::Dictionary& options) {
|
||||
relaunch_command, relaunch_display_name,
|
||||
window_->GetAcceleratedWidget());
|
||||
}
|
||||
|
||||
bool BaseWindow::IsSnapped() const {
|
||||
return window_->IsSnapped();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
|
||||
@@ -1335,6 +1339,8 @@ void BaseWindow::BuildPrototype(v8::Isolate* isolate,
|
||||
.SetMethod("setIcon", &BaseWindow::SetIcon)
|
||||
#endif
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
.SetMethod("isSnapped", &BaseWindow::IsSnapped)
|
||||
.SetProperty("snapped", &BaseWindow::IsSnapped)
|
||||
.SetMethod("hookWindowMessage", &BaseWindow::HookWindowMessage)
|
||||
.SetMethod("isWindowMessageHooked", &BaseWindow::IsWindowMessageHooked)
|
||||
.SetMethod("unhookWindowMessage", &BaseWindow::UnhookWindowMessage)
|
||||
|
||||
@@ -252,6 +252,7 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
|
||||
bool SetThumbnailClip(const gfx::Rect& region);
|
||||
bool SetThumbnailToolTip(const std::string& tooltip);
|
||||
void SetAppDetails(const gin_helper::Dictionary& options);
|
||||
bool IsSnapped() const;
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
|
||||
|
||||
Reference in New Issue
Block a user