Reorgnize how attributes work

This commit is contained in:
Cheng Zhao 2016-01-23 02:23:18 -08:00
parent ae7e96f181
commit d704b3f7ba
5 changed files with 55 additions and 78 deletions

View file

@ -116,23 +116,15 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) {
SetSizeConstraints(size_constraints);
}
#if defined(OS_WIN) || defined(USE_X11)
bool resizable;
if (options.Get(options::kResizable, &resizable)) {
SetResizable(resizable);
}
bool minimizable;
if (options.Get(options::kMinimizable, &minimizable)) {
SetMinimizable(minimizable);
}
bool closable;
if (options.Get(options::kClosable, &closable)) {
SetClosable(closable);
}
bool maximizable;
if (options.Get(options::kMaximizable, &maximizable)) {
SetMaximizable(maximizable);
}
#endif
bool movable;
if (options.Get(options::kMovable, &movable) && movable) {
SetMovable(movable);
}
bool top;
if (options.Get(options::kAlwaysOnTop, &top) && top) {
SetAlwaysOnTop(true);