}
}
-void SetSheetOffset(atom::NativeWindow* window, const double offset) {
- window->SetSheetOffset(offset);
-}
-
void ShowOpenDialog(const std::string& title,
const base::FilePath& default_path,
const file_dialog::Filters& filters,
dict.SetMethod("showMessageBox", &ShowMessageBox);
dict.SetMethod("showErrorBox", &atom::ShowErrorBox);
dict.SetMethod("showOpenDialog", &ShowOpenDialog);
- dict.SetMethod("setSheetOffset", &SetSheetOffset);
dict.SetMethod("showSaveDialog", &ShowSaveDialog);
}
return result;
}
+void Window::SetSheetOffset(double offset) {
+ window_->SetSheetOffset(offset);
+}
+
void Window::SetTitle(const std::string& title) {
window_->SetTitle(title);
}
.SetMethod("center", &Window::Center)
.SetMethod("setPosition", &Window::SetPosition)
.SetMethod("getPosition", &Window::GetPosition)
+ .SetMethod("setSheetOffset", &Window::SetSheetOffset)
.SetMethod("setTitle", &Window::SetTitle)
.SetMethod("getTitle", &Window::GetTitle)
.SetMethod("flashFrame", &Window::FlashFrame)
std::vector<int> GetMinimumSize();
void SetMaximumSize(int width, int height);
std::vector<int> GetMaximumSize();
+ void SetSheetOffset(double offset);
void SetResizable(bool resizable);
bool IsResizable();
void SetMovable(bool movable);
return WindowSizeToContentSize(GetSize());
}
-void NativeWindow::SetSheetOffset(const double offset) {
- sheet_offset_ = offset;
-}
-
-double NativeWindow::GetSheetOffset() {
- return sheet_offset_;
-}
-
void NativeWindow::SetSizeConstraints(
const extensions::SizeConstraints& window_constraints) {
extensions::SizeConstraints content_constraints;
return GetSizeConstraints().GetMaximumSize();
}
+void NativeWindow::SetSheetOffset(const double offset) {
+ sheet_offset_ = offset;
+}
+
+double NativeWindow::GetSheetOffset() {
+ return sheet_offset_;
+}
+
void NativeWindow::SetRepresentedFilename(const std::string& filename) {
}
**Note:** The title of web page can be different from the title of the native
window.
+### `win.setSheetOffset(offset)`
+
+Changes the attachment point for sheets on Mac OS X. By default, sheets are attached
+just below the window frame, but you may want to display them beneath a HTML-rendered
+toolbar. For example:
+
+```
+var toolbarRect = document.getElementById('toolbar').getBoundingClientRect();
+win.setSheetOffset(toolbarRect.height);
+```
+
### `win.flashFrame(flag)`
* `flag` Boolean
a `BrowserWindow` reference in the `browserWindow` parameter, or modals if no
window is provided.
-### `dialog.setSheetOffset(browserWindow, offset)`
-
-* `browserWindow` BrowserWindow (optional)
-
-Changes the attachment point for sheets on Mac OS X. By default, sheets are attached
-just below the window frame, but you may want to display them beneath a HTML-rendered
-toolbar. For example:
-```
-const {remote} = require('electron');
-const browserWindow = remote.getCurrentWindow();
-
-var toolbarRect = document.getElementById('toolbar').getBoundingClientRect();
-remote.dialog.setSheetOffset(browserWindow, toolbarRect.height);
-
-... show dialog ...
-```
+You can call `BrowserWindow.getCurrentWindow().setSheetOffset(offset)` to change
+the offset from the window frame where sheets are attached.
}
module.exports = {
- setSheetOffset: function (window, offset) {
- return binding.setSheetOffset(window, offset)
- },
-
showOpenDialog: function (...args) {
var prop, properties, value, wrappedCallback
checkAppInitialized()