Move "setSheetOffset" to the BrowserWindow

This commit is contained in:
Ben Gotow 2016-04-18 22:39:12 -07:00
parent 1976c271ec
commit 8f89cd2d59
7 changed files with 27 additions and 33 deletions

View file

@ -66,10 +66,6 @@ void ShowMessageBox(int type,
}
}
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,
@ -116,7 +112,6 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
dict.SetMethod("showMessageBox", &ShowMessageBox);
dict.SetMethod("showErrorBox", &atom::ShowErrorBox);
dict.SetMethod("showOpenDialog", &ShowOpenDialog);
dict.SetMethod("setSheetOffset", &SetSheetOffset);
dict.SetMethod("showSaveDialog", &ShowSaveDialog);
}

View file

@ -514,6 +514,10 @@ std::vector<int> Window::GetPosition() {
return result;
}
void Window::SetSheetOffset(double offset) {
window_->SetSheetOffset(offset);
}
void Window::SetTitle(const std::string& title) {
window_->SetTitle(title);
}
@ -763,6 +767,7 @@ void Window::BuildPrototype(v8::Isolate* isolate,
.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)

View file

@ -110,6 +110,7 @@ class Window : public mate::TrackableObject<Window>,
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);