diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-09 02:32:42 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-09 02:32:42 +0000 |
commit | 0cde55895ade17764ae100c28e9bd7112458333b (patch) | |
tree | 29964641ee4514a93163b2a804207e5493052578 /views/controls | |
parent | d5c409747ee1f24ee1eae50d4869922c38cf5a12 (diff) | |
download | chromium_src-0cde55895ade17764ae100c28e9bd7112458333b.zip chromium_src-0cde55895ade17764ae100c28e9bd7112458333b.tar.gz chromium_src-0cde55895ade17764ae100c28e9bd7112458333b.tar.bz2 |
It turns out I had the sense of the GetLocalBounds bool wrong everywhere, so invert everything.
This fixes the painting bugs in the omnibox and bookmark bar, and probably countless other glitches in rendering.
BUG=none
TEST=omnibox popup should render properly
TBR=sky
Review URL: http://codereview.chromium.org/6462022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74231 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
-rw-r--r-- | views/controls/button/button_dropdown.cc | 2 | ||||
-rw-r--r-- | views/controls/button/checkbox.cc | 2 | ||||
-rw-r--r-- | views/controls/button/menu_button.cc | 2 | ||||
-rw-r--r-- | views/controls/label_unittest.cc | 6 | ||||
-rw-r--r-- | views/controls/native/native_view_host.cc | 2 | ||||
-rw-r--r-- | views/controls/scroll_view.cc | 2 | ||||
-rw-r--r-- | views/controls/scrollbar/native_scroll_bar_gtk.cc | 2 | ||||
-rw-r--r-- | views/controls/scrollbar/native_scroll_bar_win.cc | 2 | ||||
-rw-r--r-- | views/controls/slider/slider.cc | 2 | ||||
-rw-r--r-- | views/controls/tabbed_pane/native_tabbed_pane_win.cc | 4 | ||||
-rw-r--r-- | views/controls/textfield/textfield.cc | 2 |
11 files changed, 14 insertions, 14 deletions
diff --git a/views/controls/button/button_dropdown.cc b/views/controls/button/button_dropdown.cc index 8d3ce74..16f424f 100644 --- a/views/controls/button/button_dropdown.cc +++ b/views/controls/button/button_dropdown.cc @@ -129,7 +129,7 @@ bool ButtonDropDown::ShouldEnterPushedState(const MouseEvent& e) { void ButtonDropDown::ShowDropDownMenu(gfx::NativeView window) { if (model_) { - gfx::Rect lb = GetContentsBounds(); + gfx::Rect lb = GetLocalBounds(); // Both the menu position and the menu anchor type change if the UI layout // is right-to-left. diff --git a/views/controls/button/checkbox.cc b/views/controls/button/checkbox.cc index 36825b9..b89058f 100644 --- a/views/controls/button/checkbox.cc +++ b/views/controls/button/checkbox.cc @@ -127,7 +127,7 @@ View* Checkbox::GetViewForPoint(const gfx::Point& point) { View* Checkbox::GetViewForPoint(const gfx::Point& point, bool can_create_floating) { - return GetContentsBounds().Contains(point) ? this : NULL; + return GetLocalBounds().Contains(point) ? this : NULL; } void Checkbox::OnMouseEntered(const MouseEvent& e) { diff --git a/views/controls/button/menu_button.cc b/views/controls/button/menu_button.cc index ae34749..5d08fa0 100644 --- a/views/controls/button/menu_button.cc +++ b/views/controls/button/menu_button.cc @@ -126,7 +126,7 @@ bool MenuButton::Activate() { // after the menu closes. PaintNow(); if (menu_delegate_) { - gfx::Rect lb = GetContentsBounds(); + gfx::Rect lb = GetLocalBounds(); // The position of the menu depends on whether or not the locale is // right-to-left. diff --git a/views/controls/label_unittest.cc b/views/controls/label_unittest.cc index d556512..6d2ba91 100644 --- a/views/controls/label_unittest.cc +++ b/views/controls/label_unittest.cc @@ -208,12 +208,12 @@ TEST(LabelTest, MultiLineSizing) { // SizeToFit with unlimited width. label.SizeToFit(0); - int required_width = label.GetContentsBounds().width(); + int required_width = label.GetLocalBounds().width(); EXPECT_GT(required_width, kMinTextDimension); // SizeToFit with limited width. label.SizeToFit(required_width - 1); - int constrained_width = label.GetContentsBounds().width(); + int constrained_width = label.GetLocalBounds().width(); #if defined(OS_WIN) // Canvas::SizeStringInt (in app/gfx/canvas_linux.cc) // has to be fixed to return the size that fits to given width/height. @@ -223,7 +223,7 @@ TEST(LabelTest, MultiLineSizing) { // Change the width back to the desire width. label.SizeToFit(required_width); - EXPECT_EQ(required_width, label.GetContentsBounds().width()); + EXPECT_EQ(required_width, label.GetLocalBounds().width()); // General tests for GetHeightForWidth. int required_height = label.GetHeightForWidth(required_width); diff --git a/views/controls/native/native_view_host.cc b/views/controls/native/native_view_host.cc index 2ccd207..b443ac9 100644 --- a/views/controls/native/native_view_host.cc +++ b/views/controls/native/native_view_host.cc @@ -121,7 +121,7 @@ void NativeViewHost::Layout() { gfx::Insets insets = GetInsets(); gfx::Point top_left(insets.left(), insets.top()); ConvertPointToWidget(this, &top_left); - gfx::Rect local_bounds = GetLocalBounds(); + gfx::Rect local_bounds = GetContentsBounds(); native_wrapper_->ShowWidget(top_left.x(), top_left.y(), local_bounds.width(), local_bounds.height()); diff --git a/views/controls/scroll_view.cc b/views/controls/scroll_view.cc index ecaf3e2..79183da 100644 --- a/views/controls/scroll_view.cc +++ b/views/controls/scroll_view.cc @@ -147,7 +147,7 @@ void ScrollView::Layout() { // override this default behavior, the inner view has to calculate the // available space, used ComputeScrollBarsVisibility() to use the same // calculation that is done here and sets its bound to fit within. - gfx::Rect viewport_bounds = GetContentsBounds(); + gfx::Rect viewport_bounds = GetLocalBounds(); // Realign it to 0 so it can be used as-is for SetBounds(). viewport_bounds.set_origin(gfx::Point(0, 0)); // viewport_size is the total client space available. diff --git a/views/controls/scrollbar/native_scroll_bar_gtk.cc b/views/controls/scrollbar/native_scroll_bar_gtk.cc index 4a57779a..73bb109 100644 --- a/views/controls/scrollbar/native_scroll_bar_gtk.cc +++ b/views/controls/scrollbar/native_scroll_bar_gtk.cc @@ -28,7 +28,7 @@ NativeScrollBarGtk::~NativeScrollBarGtk() { // NativeScrollBarGtk, View overrides: void NativeScrollBarGtk::Layout() { - SetBoundsRect(native_scroll_bar_->GetContentsBounds()); + SetBoundsRect(native_scroll_bar_->GetLocalBounds()); NativeControlGtk::Layout(); } diff --git a/views/controls/scrollbar/native_scroll_bar_win.cc b/views/controls/scrollbar/native_scroll_bar_win.cc index 70cf432..44d8bf6 100644 --- a/views/controls/scrollbar/native_scroll_bar_win.cc +++ b/views/controls/scrollbar/native_scroll_bar_win.cc @@ -216,7 +216,7 @@ NativeScrollBarWin::~NativeScrollBarWin() { // NativeScrollBarWin, View overrides: void NativeScrollBarWin::Layout() { - SetBoundsRect(native_scroll_bar_->GetContentsBounds()); + SetBoundsRect(native_scroll_bar_->GetLocalBounds()); NativeControlWin::Layout(); } diff --git a/views/controls/slider/slider.cc b/views/controls/slider/slider.cc index 66615fd..e4a3a76 100644 --- a/views/controls/slider/slider.cc +++ b/views/controls/slider/slider.cc @@ -57,7 +57,7 @@ void Slider::SetValue(double value) { void Slider::Layout() { if (native_wrapper_) { - native_wrapper_->GetView()->SetBoundsRect(GetContentsBounds()); + native_wrapper_->GetView()->SetBoundsRect(GetLocalBounds()); native_wrapper_->GetView()->Layout(); } } diff --git a/views/controls/tabbed_pane/native_tabbed_pane_win.cc b/views/controls/tabbed_pane/native_tabbed_pane_win.cc index 1b64f61..c727437 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_win.cc +++ b/views/controls/tabbed_pane/native_tabbed_pane_win.cc @@ -57,7 +57,7 @@ class TabLayout : public LayoutManager { View* child = host->GetChildViewAt(i); // The child might not have been laid out yet. if (child == page) - child->SetBoundsRect(host->GetLocalBounds()); + child->SetBoundsRect(host->GetContentsBounds()); child->SetVisible(child == page); } @@ -72,7 +72,7 @@ class TabLayout : public LayoutManager { private: // LayoutManager overrides: virtual void Layout(View* host) { - gfx::Rect bounds(host->GetLocalBounds()); + gfx::Rect bounds(host->GetContentsBounds()); for (int i = 0; i < host->GetChildViewCount(); ++i) { View* child = host->GetChildViewAt(i); // We only layout visible children, since it may be expensive. diff --git a/views/controls/textfield/textfield.cc b/views/controls/textfield/textfield.cc index 09ac2f7..1b4461c 100644 --- a/views/controls/textfield/textfield.cc +++ b/views/controls/textfield/textfield.cc @@ -284,7 +284,7 @@ size_t Textfield::GetCursorPosition() const { void Textfield::Layout() { if (native_wrapper_) { - native_wrapper_->GetView()->SetBoundsRect(GetContentsBounds()); + native_wrapper_->GetView()->SetBoundsRect(GetLocalBounds()); native_wrapper_->GetView()->Layout(); } } |