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

Unified Diff: chrome/views/non_client_view.cc

Issue 21116: Support custom border widths. Allow user to resize the window (instead of do... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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/views/frame/aero_glass_non_client_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/views/non_client_view.cc
===================================================================
--- chrome/views/non_client_view.cc (revision 9229)
+++ chrome/views/non_client_view.cc (working copy)
@@ -13,46 +13,47 @@
int resize_border_thickness,
int resize_corner_size,
bool can_resize) {
- int component = HTNOWHERE;
+ // Tricky: In XP, native behavior is to return HTTOPLEFT and HTTOPRIGHT for
+ // a |resize_corner_size|-length strip of both the side and top borders, but
+ // only to return HTBOTTOMLEFT/HTBOTTOMRIGHT along the bottom border + corner
+ // (not the side border). Vista goes further and doesn't return these on any
+ // of the side borders. Here we copy the XP behavior.
+ int component;
if (point.x() < resize_border_thickness) {
- if (point.y() < resize_corner_size) {
+ if (point.y() < resize_corner_size)
component = HTTOPLEFT;
- } else if (point.y() >= (height() - resize_corner_size)) {
+ else if (point.y() >= (height() - resize_border_thickness))
component = HTBOTTOMLEFT;
- } else {
+ else
component = HTLEFT;
- }
- } else if (point.x() < resize_corner_size) {
- if (point.y() < top_resize_border_height) {
- component = HTTOPLEFT;
- } else if (point.y() >= (height() - resize_border_thickness)) {
- component = HTBOTTOMLEFT;
- }
} else if (point.x() >= (width() - resize_border_thickness)) {
- if (point.y() < resize_corner_size) {
+ if (point.y() < resize_corner_size)
component = HTTOPRIGHT;
- } else if (point.y() >= (height() - resize_corner_size)) {
+ else if (point.y() >= (height() - resize_border_thickness))
component = HTBOTTOMRIGHT;
- } else {
+ else
component = HTRIGHT;
- }
- } else if (point.x() >= (width() - resize_corner_size)) {
- if (point.y() < top_resize_border_height) {
+ } else if (point.y() < top_resize_border_height) {
+ if (point.x() < resize_corner_size)
+ component = HTTOPLEFT;
+ else if (point.x() >= (width() - resize_corner_size))
component = HTTOPRIGHT;
- } else if (point.y() >= (height() - resize_border_thickness)) {
+ else
+ component = HTTOP;
+ } else if (point.y() >= (height() - resize_border_thickness)) {
+ if (point.x() < resize_corner_size)
+ component = HTBOTTOMLEFT;
+ else if (point.x() >= (width() - resize_corner_size))
component = HTBOTTOMRIGHT;
- }
- } else if (point.y() < top_resize_border_height) {
- component = HTTOP;
- } else if (point.y() >= (height() - resize_border_thickness)) {
- component = HTBOTTOM;
+ else
+ component = HTBOTTOM;
+ } else {
+ return HTNOWHERE;
}
// If the window can't be resized, there are no resize boundaries, just
// window borders.
- if (component != HTNOWHERE)
- return can_resize ? component : HTBORDER;
- return HTNOWHERE;
+ return can_resize ? component : HTBORDER;
}
} // namespace views
« no previous file with comments | « chrome/browser/views/frame/aero_glass_non_client_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698