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

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

Issue 150078: GTK custom frame: Don't show the border when maximized. Enlarge the close but... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: now with bidi support 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') | chrome/browser/gtk/browser_window_gtk.cc » ('j') | 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 19551)
+++ chrome/browser/gtk/browser_titlebar.cc (working copy)
@@ -41,6 +41,11 @@
// it on the left, and between it and the tabstrip on the right).
const int kOTRSideSpacing = 2;
+// The thickness of the custom frame border; we need it here to enlarge the
+// close button whent the custom frame border isn't showing but the custom
+// titlebar is showing.
+const int kFrameBorderThickness = 4;
+
gboolean OnMouseMoveEvent(GtkWidget* widget, GdkEventMotion* event,
BrowserWindowGtk* browser_window) {
// Reset to the default mouse cursor.
@@ -124,6 +129,10 @@
IDR_MINIMIZE_H, buttons_hbox,
IDS_XPFRAME_MINIMIZE_TOOLTIP));
+ GtkRequisition req;
+ gtk_widget_size_request(close_button_->widget(), &req);
+ close_button_default_width_ = req.width;
+
gtk_box_pack_end(GTK_BOX(container_), titlebar_buttons_box_, FALSE,
FALSE, 0);
@@ -162,6 +171,11 @@
} else {
gtk_alignment_set_padding(GTK_ALIGNMENT(titlebar_alignment_), 0, 0, 0, 0);
}
+
+ int close_button_width = close_button_default_width_;
+ if (using_custom_frame_ && browser_window_->IsMaximized())
+ close_button_width += kFrameBorderThickness;
+ gtk_widget_set_size_request(close_button_->widget(), close_button_width, -1);
}
// static
« no previous file with comments | « chrome/browser/gtk/browser_titlebar.h ('k') | chrome/browser/gtk/browser_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698