diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/widget/widget_gtk.cc | 7 | ||||
-rw-r--r-- | views/window/window_gtk.cc | 13 | ||||
-rw-r--r-- | views/window/window_gtk.h | 1 |
3 files changed, 8 insertions, 13 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index 876a130..01b6b87 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -231,7 +231,12 @@ void WidgetGtk::SetBounds(const gfx::Rect& bounds) { parent_widget->PositionChild(widget_, bounds.x(), bounds.y(), bounds.width(), bounds.height()); } else { - NOTIMPLEMENTED(); + GtkWindow* gtk_window = GTK_WINDOW(widget_); + // TODO: this may need to set an initial size if not showing. + // TODO: need to constrain based on screen size. + gtk_window_resize(gtk_window, bounds.width(), bounds.height()); + + gtk_window_move(gtk_window, bounds.x(), bounds.y()); } } diff --git a/views/window/window_gtk.cc b/views/window/window_gtk.cc index 30900df..3979831 100644 --- a/views/window/window_gtk.cc +++ b/views/window/window_gtk.cc @@ -41,19 +41,10 @@ gfx::Rect WindowGtk::GetNormalBounds() const { return GetBounds(); } -void WindowGtk::SetBounds(const gfx::Rect& bounds) { - GtkWindow* gtk_window = GetNativeWindow(); - // TODO: this may need to set an initial size if not showing. - // TODO: need to constrain based on screen size. - gtk_window_resize(gtk_window, bounds.width(), bounds.height()); - - gtk_window_move(gtk_window, bounds.x(), bounds.y()); -} - void WindowGtk::SetBounds(const gfx::Rect& bounds, gfx::NativeWindow other_window) { // TODO: need to deal with other_window. - SetBounds(bounds); + WidgetGtk::SetBounds(bounds); } void WindowGtk::Show() { @@ -242,7 +233,7 @@ void WindowGtk::Init(const gfx::Rect& bounds) { void WindowGtk::SetInitialBounds(const gfx::Rect& create_bounds) { gfx::Rect saved_bounds(create_bounds.ToGdkRectangle()); if (window_delegate_->GetSavedWindowBounds(&saved_bounds)) { - SetBounds(saved_bounds); + WidgetGtk::SetBounds(saved_bounds); } else { if (create_bounds.IsEmpty()) { SizeWindowToDefault(); diff --git a/views/window/window_gtk.h b/views/window/window_gtk.h index 05908f3..80ed1dd 100644 --- a/views/window/window_gtk.h +++ b/views/window/window_gtk.h @@ -27,7 +27,6 @@ class WindowGtk : public WidgetGtk, public Window { // Window overrides: virtual gfx::Rect GetBounds() const; virtual gfx::Rect GetNormalBounds() const; - virtual void SetBounds(const gfx::Rect& bounds); virtual void SetBounds(const gfx::Rect& bounds, gfx::NativeWindow other_window); virtual void Show(); |