summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/browser_titlebar.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-30 00:20:18 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-30 00:20:18 +0000
commitc3c01eeaf88116a3f114a46ec2a900936be56bde (patch)
tree2f4c03d7a9c19405140dcaeada21c7c2a7bfe776 /chrome/browser/gtk/browser_titlebar.cc
parent7c6334b2b3201324bfc6efeefecfdf8003fbcb59 (diff)
downloadchromium_src-c3c01eeaf88116a3f114a46ec2a900936be56bde.zip
chromium_src-c3c01eeaf88116a3f114a46ec2a900936be56bde.tar.gz
chromium_src-c3c01eeaf88116a3f114a46ec2a900936be56bde.tar.bz2
GTK custom frame: Don't show the border when maximized. Enlarge the close button's clickable area when maximized.
BUG= http://crbug.com/14646 and http://crbug.com/15628 TEST=maximize, turn on custom frame. The top right most pixel on the screen should be clickable and should close the window. There should be no border around the web contents. Review URL: http://codereview.chromium.org/150078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19567 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/browser_titlebar.cc')
-rw-r--r--chrome/browser/gtk/browser_titlebar.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/gtk/browser_titlebar.cc b/chrome/browser/gtk/browser_titlebar.cc
index 222f249..86d4ba9 100644
--- a/chrome/browser/gtk/browser_titlebar.cc
+++ b/chrome/browser/gtk/browser_titlebar.cc
@@ -41,6 +41,11 @@ const int kOTRBottomSpacing = 2;
// 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 @@ void BrowserTitlebar::Init() {
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 @@ void BrowserTitlebar::UpdateTitlebarAlignment() {
} 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