diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-29 23:35:22 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-29 23:35:22 +0000 |
commit | 527082000a090423f4866d6b0f47d9b45e73f0ea (patch) | |
tree | a37e4527eea085402bcc2216cd915ee493344fdf /chrome/browser/gtk/browser_titlebar.cc | |
parent | 2164467ecfc61b98a1422bfa5e0d86b7d5439140 (diff) | |
download | chromium_src-527082000a090423f4866d6b0f47d9b45e73f0ea.zip chromium_src-527082000a090423f4866d6b0f47d9b45e73f0ea.tar.gz chromium_src-527082000a090423f4866d6b0f47d9b45e73f0ea.tar.bz2 |
Make tabstrip flush with top of titlebar when custom frame is enabled and browser is maximized.
TEST=maximize and enable custom frame
BUG=http://crbug.com/15431
Review URL: http://codereview.chromium.org/150072
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19551 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/browser_titlebar.cc')
-rw-r--r-- | chrome/browser/gtk/browser_titlebar.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/chrome/browser/gtk/browser_titlebar.cc b/chrome/browser/gtk/browser_titlebar.cc index 2efc2bf..222f249 100644 --- a/chrome/browser/gtk/browser_titlebar.cc +++ b/chrome/browser/gtk/browser_titlebar.cc @@ -61,7 +61,8 @@ GdkPixbuf* GetOTRAvatar() { BrowserTitlebar::BrowserTitlebar(BrowserWindowGtk* browser_window, GtkWindow* window) - : browser_window_(browser_window), window_(window) { + : browser_window_(browser_window), window_(window), + using_custom_frame_(false) { Init(); } @@ -146,16 +147,24 @@ CustomDrawButton* BrowserTitlebar::BuildTitlebarButton(int image, } void BrowserTitlebar::UpdateCustomFrame(bool use_custom_frame) { - if (use_custom_frame) { + using_custom_frame_ = use_custom_frame; + if (use_custom_frame) + gtk_widget_show(titlebar_buttons_box_); + else + gtk_widget_hide(titlebar_buttons_box_); + UpdateTitlebarAlignment(); +} + +void BrowserTitlebar::UpdateTitlebarAlignment() { + if (using_custom_frame_ && !browser_window_->IsMaximized()) { gtk_alignment_set_padding(GTK_ALIGNMENT(titlebar_alignment_), kTitlebarHeight, 0, 0, 0); - gtk_widget_show(titlebar_buttons_box_); } else { gtk_alignment_set_padding(GTK_ALIGNMENT(titlebar_alignment_), 0, 0, 0, 0); - gtk_widget_hide(titlebar_buttons_box_); } } +// static gboolean BrowserTitlebar::OnWindowStateChanged(GtkWindow* window, GdkEventWindowState* event, BrowserTitlebar* titlebar) { // Update the maximize/restore button. @@ -166,9 +175,11 @@ gboolean BrowserTitlebar::OnWindowStateChanged(GtkWindow* window, gtk_widget_hide(titlebar->restore_button_->widget()); gtk_widget_show(titlebar->maximize_button_->widget()); } + titlebar->UpdateTitlebarAlignment(); return FALSE; } +// static void BrowserTitlebar::OnButtonClicked(GtkWidget* button, BrowserTitlebar* titlebar) { if (titlebar->close_button_->widget() == button) { |