Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1927)

Unified Diff: chrome/browser/gtk/browser_titlebar.cc

Issue 150072: Make tabstrip flush with top of titlebar when custom frame is enabled and bro... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gtk/browser_titlebar.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/browser_titlebar.cc
===================================================================
--- chrome/browser/gtk/browser_titlebar.cc (revision 19526)
+++ chrome/browser/gtk/browser_titlebar.cc (working copy)
@@ -61,7 +61,8 @@
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 @@
}
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 @@
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) {
« no previous file with comments | « chrome/browser/gtk/browser_titlebar.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698