Implement size and position APIs with bounds API

This commit is contained in:
Cheng Zhao 2015-05-04 12:43:40 +08:00
parent 7142cae041
commit 0d4d2080ca
6 changed files with 23 additions and 65 deletions

View file

@ -237,6 +237,22 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) {
Show();
}
void NativeWindow::SetSize(const gfx::Size& size) {
SetBounds(gfx::Rect(GetPosition(), size));
}
gfx::Size NativeWindow::GetSize() {
return GetBounds().size();
}
void NativeWindow::SetPosition(const gfx::Point& position) {
SetBounds(gfx::Rect(position, GetSize()));
}
gfx::Point NativeWindow::GetPosition() {
return GetBounds().origin();
}
void NativeWindow::SetRepresentedFilename(const std::string& filename) {
}