| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/window/custom_frame_view.h" | 5 #include "ui/views/window/custom_frame_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "ui/views/widget/native_widget_win.h" | 31 #include "ui/views/widget/native_widget_win.h" |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 namespace views { | 34 namespace views { |
| 35 | 35 |
| 36 namespace { | 36 namespace { |
| 37 | 37 |
| 38 // The frame border is only visible in restored mode and is hardcoded to 4 px on | 38 // The frame border is only visible in restored mode and is hardcoded to 4 px on |
| 39 // each side regardless of the system window border size. | 39 // each side regardless of the system window border size. |
| 40 const int kFrameBorderThickness = 4; | 40 const int kFrameBorderThickness = 4; |
| 41 // Various edges of the frame border have a 1 px shadow along their edges; in a | |
| 42 // few cases we shift elements based on this amount for visual appeal. | |
| 43 const int kFrameShadowThickness = 1; | |
| 44 // While resize areas on Windows are normally the same size as the window | |
| 45 // borders, our top area is shrunk by 1 px to make it easier to move the window | |
| 46 // around with our thinner top grabbable strip. (Incidentally, our side and | |
| 47 // bottom resize areas don't match the frame border thickness either -- they | |
| 48 // span the whole nonclient area, so there's no "dead zone" for the mouse.) | |
| 49 const int kTopResizeAdjust = 1; | |
| 50 // In the window corners, the resize areas don't actually expand bigger, but the | 41 // In the window corners, the resize areas don't actually expand bigger, but the |
| 51 // 16 px at the end of each edge triggers diagonal resizing. | 42 // 16 px at the end of each edge triggers diagonal resizing. |
| 52 const int kResizeAreaCornerSize = 16; | 43 const int kResizeAreaCornerSize = 16; |
| 53 // The titlebar never shrinks too short to show the caption button plus some | 44 // The titlebar never shrinks too short to show the caption button plus some |
| 54 // padding below it. | 45 // padding below it. |
| 55 const int kCaptionButtonHeightWithPadding = 19; | 46 const int kCaptionButtonHeightWithPadding = 19; |
| 56 // The titlebar has a 2 px 3D edge along the top and bottom. | 47 // The titlebar has a 2 px 3D edge along the top and bottom. |
| 57 const int kTitlebarTopAndBottomEdgeThickness = 2; | 48 const int kTitlebarTopAndBottomEdgeThickness = 2; |
| 58 // The icon is inset 2 px from the left frame border. | 49 // The icon is inset 2 px from the left frame border. |
| 59 const int kIconLeftSpacing = 2; | 50 const int kIconLeftSpacing = 2; |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 rb.GetImageNamed(normal_image_id).ToImageSkia()); | 555 rb.GetImageNamed(normal_image_id).ToImageSkia()); |
| 565 button->SetImage(CustomButton::STATE_HOVERED, | 556 button->SetImage(CustomButton::STATE_HOVERED, |
| 566 rb.GetImageNamed(hot_image_id).ToImageSkia()); | 557 rb.GetImageNamed(hot_image_id).ToImageSkia()); |
| 567 button->SetImage(CustomButton::STATE_PRESSED, | 558 button->SetImage(CustomButton::STATE_PRESSED, |
| 568 rb.GetImageNamed(pushed_image_id).ToImageSkia()); | 559 rb.GetImageNamed(pushed_image_id).ToImageSkia()); |
| 569 AddChildView(button); | 560 AddChildView(button); |
| 570 return button; | 561 return button; |
| 571 } | 562 } |
| 572 | 563 |
| 573 } // namespace views | 564 } // namespace views |
| OLD | NEW |