Chromium Code Reviews| 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/bubble/bubble_frame_view.h" | 5 #include "ui/views/bubble/bubble_frame_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ui/base/hit_test.h" | 9 #include "ui/base/hit_test.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| 11 #include "ui/gfx/path.h" | 11 #include "ui/gfx/path.h" |
| 12 #include "ui/gfx/screen.h" | 12 #include "ui/gfx/screen.h" |
| 13 #include "ui/gfx/skia_util.h" | 13 #include "ui/gfx/skia_util.h" |
| 14 #include "ui/native_theme/native_theme.h" | 14 #include "ui/native_theme/native_theme.h" |
| 15 #include "ui/resources/grit/ui_resources.h" | 15 #include "ui/resources/grit/ui_resources.h" |
| 16 #include "ui/views/bubble/bubble_border.h" | 16 #include "ui/views/bubble/bubble_border.h" |
| 17 #include "ui/views/controls/button/label_button.h" | 17 #include "ui/views/controls/button/label_button.h" |
| 18 #include "ui/views/controls/image_view.h" | 18 #include "ui/views/controls/image_view.h" |
| 19 #include "ui/views/widget/widget.h" | 19 #include "ui/views/widget/widget.h" |
| 20 #include "ui/views/widget/widget_delegate.h" | 20 #include "ui/views/widget/widget_delegate.h" |
| 21 #include "ui/views/window/client_view.h" | 21 #include "ui/views/window/client_view.h" |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 // Insets for the title bar views in pixels. | 25 // Insets for the title bar views in pixels. |
| 26 const int kTitleTopInset = 12; | 26 const int kTitleTopInset = 18; |
|
msw
2015/02/27 01:57:05
Don't change this value... the title wasn't too hi
xiaoling
2015/02/27 02:24:13
Was trying to make top margin to 20 px. Reverted.
| |
| 27 const int kTitleLeftInset = 19; | 27 const int kTitleLeftInset = 20; |
|
msw
2015/02/27 01:57:05
Don't bother changing this, just add 1px in the ic
xiaoling
2015/02/27 02:24:13
Done.
| |
| 28 const int kTitleBottomInset = 12; | 28 const int kTitleBottomInset = 7; |
|
msw
2015/02/27 01:57:05
This can't be right, it will affect all bubbles...
xiaoling
2015/02/27 02:24:13
Done.
| |
| 29 const int kTitleRightInset = 7; | 29 const int kTitleRightInset = 7; |
| 30 | 30 |
| 31 // The horizontal padding between the title and the icon. | 31 // The horizontal padding between the title and the icon. |
| 32 const int kTitleHorizontalPadding = 5; | 32 const int kTitleHorizontalPadding = 5; |
| 33 | 33 |
| 34 // Get the |vertical| or horizontal amount that |available_bounds| overflows | 34 // Get the |vertical| or horizontal amount that |available_bounds| overflows |
| 35 // |window_bounds|. | 35 // |window_bounds|. |
| 36 int GetOffScreenLength(const gfx::Rect& available_bounds, | 36 int GetOffScreenLength(const gfx::Rect& available_bounds, |
| 37 const gfx::Rect& window_bounds, | 37 const gfx::Rect& window_bounds, |
| 38 bool vertical) { | 38 bool vertical) { |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 421 if (titlebar_extra_view_ != NULL) | 421 if (titlebar_extra_view_ != NULL) |
| 422 title_bar_width += titlebar_extra_view_->GetPreferredSize().width(); | 422 title_bar_width += titlebar_extra_view_->GetPreferredSize().width(); |
| 423 gfx::Size size(client_size); | 423 gfx::Size size(client_size); |
| 424 size.SetToMax(gfx::Size(title_bar_width, 0)); | 424 size.SetToMax(gfx::Size(title_bar_width, 0)); |
| 425 const gfx::Insets insets(GetInsets()); | 425 const gfx::Insets insets(GetInsets()); |
| 426 size.Enlarge(insets.width(), insets.height()); | 426 size.Enlarge(insets.width(), insets.height()); |
| 427 return size; | 427 return size; |
| 428 } | 428 } |
| 429 | 429 |
| 430 } // namespace views | 430 } // namespace views |
| OLD | NEW |