diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-08 12:58:40 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-08 12:58:40 +0000 |
commit | 077798d5b30c850896b40c901c190093dd8730e1 (patch) | |
tree | 3b58dde6c22b0c94c642f68d6e7977425ee7e7a5 | |
parent | 3c2fe4e986f41e271c2502dc64b0f47f213b7d58 (diff) | |
download | chromium_src-077798d5b30c850896b40c901c190093dd8730e1.zip chromium_src-077798d5b30c850896b40c901c190093dd8730e1.tar.gz chromium_src-077798d5b30c850896b40c901c190093dd8730e1.tar.bz2 |
Fix test_shell window sizing on Linux after adding the menu bar.
Review URL: http://codereview.chromium.org/17413
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7726 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/tools/test_shell/test_shell.h | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_gtk.cc | 15 |
2 files changed, 10 insertions, 7 deletions
diff --git a/webkit/tools/test_shell/test_shell.h b/webkit/tools/test_shell/test_shell.h index 5e6a8da..79ab497 100644 --- a/webkit/tools/test_shell/test_shell.h +++ b/webkit/tools/test_shell/test_shell.h @@ -333,7 +333,7 @@ private: #if defined(OS_LINUX) // The height of the non-rendering area of the main window, in pixels. - int toolbar_height_; + int top_chrome_height_; #endif }; diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc index 1bdf144..211a07bd 100644 --- a/webkit/tools/test_shell/test_shell_gtk.cc +++ b/webkit/tools/test_shell/test_shell_gtk.cc @@ -266,7 +266,9 @@ bool TestShell::Initialize(const std::wstring& startingURL) { GtkWidget* vbox = gtk_vbox_new(FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), CreateMenuBar(this), FALSE, FALSE, 0); + GtkWidget* menu_bar = CreateMenuBar(this); + + gtk_box_pack_start(GTK_BOX(vbox), menu_bar, FALSE, FALSE, 0); GtkWidget* toolbar = gtk_toolbar_new(); // Turn off the labels on the toolbar buttons. @@ -311,11 +313,11 @@ bool TestShell::Initialize(const std::wstring& startingURL) { gtk_container_add(GTK_CONTAINER(m_mainWnd), vbox); gtk_widget_show_all(m_mainWnd); - toolbar_height_ = toolbar->allocation.height + - gtk_box_get_spacing(GTK_BOX(vbox)); + top_chrome_height_ = toolbar->allocation.height + + menu_bar->allocation.height + 2 * gtk_box_get_spacing(GTK_BOX(vbox)); - // LoadURL will do a resize (which uses toolbar_height_), so make sure we - // don't call LoadURL until we've completed all of our GTK setup. + // LoadURL will do a resize (which uses top_chrome_height_), so make + // sure we don't call LoadURL until we've completed all of our GTK setup. if (!startingURL.empty()) LoadURL(startingURL.c_str()); @@ -337,7 +339,8 @@ void TestShell::TestFinished() { } void TestShell::SizeTo(int width, int height) { - gtk_window_resize(GTK_WINDOW(m_mainWnd), width, height + toolbar_height_); + gtk_window_resize(GTK_WINDOW(m_mainWnd), width, + height + top_chrome_height_); } static void AlarmHandler(int signatl) { |