diff options
author | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 08:19:05 +0000 |
---|---|---|
committer | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 08:19:05 +0000 |
commit | 9ea053e87d2141867ee3429d8917809fe2e33c80 (patch) | |
tree | 1e3131c3d6ed6bc867973089241546f8fa179a72 /views/controls | |
parent | 5643766f0fed86c472d22827c41e5b436a70e1e0 (diff) | |
download | chromium_src-9ea053e87d2141867ee3429d8917809fe2e33c80.zip chromium_src-9ea053e87d2141867ee3429d8917809fe2e33c80.tar.gz chromium_src-9ea053e87d2141867ee3429d8917809fe2e33c80.tar.bz2 |
Relayout content pref page properly upon sync status changes.
This fixes a layouting problem that resulted in the "Stop syncing this account"
button not being sized properly after setting up sync.
BUG=48807
TEST=Open options dialog in non-synced state, configure sync, check "Stop syncing this account" button after setup.
Review URL: http://codereview.chromium.org/2980005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52463 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
-rw-r--r-- | views/controls/button/checkbox.cc | 1 | ||||
-rw-r--r-- | views/controls/button/image_button.cc | 2 | ||||
-rw-r--r-- | views/controls/button/native_button.cc | 3 | ||||
-rw-r--r-- | views/controls/button/text_button.cc | 1 | ||||
-rw-r--r-- | views/controls/combobox/combobox.cc | 1 | ||||
-rw-r--r-- | views/controls/image_view.cc | 2 | ||||
-rw-r--r-- | views/controls/label.cc | 11 | ||||
-rw-r--r-- | views/controls/tabbed_pane/tabbed_pane.cc | 3 | ||||
-rw-r--r-- | views/controls/textfield/textfield.cc | 3 | ||||
-rw-r--r-- | views/controls/throbber.cc | 1 |
10 files changed, 27 insertions, 1 deletions
diff --git a/views/controls/button/checkbox.cc b/views/controls/button/checkbox.cc index 967d5eb..0899e58 100644 --- a/views/controls/button/checkbox.cc +++ b/views/controls/button/checkbox.cc @@ -35,6 +35,7 @@ Checkbox::~Checkbox() { void Checkbox::SetMultiLine(bool multiline) { label_->SetMultiLine(multiline); + PreferredSizeChanged(); } void Checkbox::SetChecked(bool checked) { diff --git a/views/controls/button/image_button.cc b/views/controls/button/image_button.cc index c9de83f..362b7abe 100644 --- a/views/controls/button/image_button.cc +++ b/views/controls/button/image_button.cc @@ -32,6 +32,7 @@ ImageButton::~ImageButton() { void ImageButton::SetImage(ButtonState aState, const SkBitmap* anImage) { images_[aState] = anImage ? *anImage : SkBitmap(); + PreferredSizeChanged(); } void ImageButton::SetBackground(SkColor color, @@ -154,6 +155,7 @@ void ToggleImageButton::SetImage(ButtonState state, const SkBitmap* image) { if (state_ == state) SchedulePaint(); } + PreferredSizeChanged(); } //////////////////////////////////////////////////////////////////////////////// diff --git a/views/controls/button/native_button.cc b/views/controls/button/native_button.cc index 5ff98e8..402244c 100644 --- a/views/controls/button/native_button.cc +++ b/views/controls/button/native_button.cc @@ -82,6 +82,7 @@ void NativeButton::SetLabel(const std::wstring& label) { // Update the accessible name whenever the label changes. SetAccessibleName(label); + PreferredSizeChanged(); } void NativeButton::SetIsDefault(bool is_default) { @@ -98,12 +99,14 @@ void NativeButton::SetNeedElevation(bool need_elevation) { need_elevation_ = need_elevation; if (native_wrapper_) native_wrapper_->UpdateLabel(); + PreferredSizeChanged(); } void NativeButton::SetAppearsAsDefault(bool appears_as_default) { is_default_ = appears_as_default; if (native_wrapper_) native_wrapper_->UpdateDefault(); + PreferredSizeChanged(); } void NativeButton::ButtonPressed() { diff --git a/views/controls/button/text_button.cc b/views/controls/button/text_button.cc index 158314c..16dae01 100644 --- a/views/controls/button/text_button.cc +++ b/views/controls/button/text_button.cc @@ -386,6 +386,7 @@ void TextButton::UpdateTextSize() { max_text_size_.SetSize(std::max(max_text_size_.width(), text_size_.width()), std::max(max_text_size_.height(), text_size_.height())); + PreferredSizeChanged(); } //////////////////////////////////////////////////////////////////////////////// diff --git a/views/controls/combobox/combobox.cc b/views/controls/combobox/combobox.cc index 594dbf3..e213bdc 100644 --- a/views/controls/combobox/combobox.cc +++ b/views/controls/combobox/combobox.cc @@ -33,6 +33,7 @@ void Combobox::ModelChanged() { selected_item_ = std::min(0, model_->GetItemCount()); if (native_wrapper_) native_wrapper_->UpdateFromModel(); + PreferredSizeChanged(); } void Combobox::SetSelectedItem(int index) { diff --git a/views/controls/image_view.cc b/views/controls/image_view.cc index bf6219b..4ef4ba0 100644 --- a/views/controls/image_view.cc +++ b/views/controls/image_view.cc @@ -21,6 +21,7 @@ ImageView::~ImageView() { void ImageView::SetImage(const SkBitmap& bm) { image_ = bm; + PreferredSizeChanged(); SchedulePaint(); } @@ -40,6 +41,7 @@ const SkBitmap& ImageView::GetImage() { void ImageView::SetImageSize(const gfx::Size& image_size) { image_size_set_ = true; image_size_ = image_size; + PreferredSizeChanged(); } bool ImageView::GetImageSize(gfx::Size* image_size) { diff --git a/views/controls/label.cc b/views/controls/label.cc index c842191..e2f5091 100644 --- a/views/controls/label.cc +++ b/views/controls/label.cc @@ -97,6 +97,7 @@ void Label::PaintBackground(gfx::Canvas* canvas) { void Label::SetFont(const gfx::Font& font) { font_ = font; text_size_valid_ = false; + PreferredSizeChanged(); SchedulePaint(); } @@ -105,6 +106,7 @@ void Label::SetText(const std::wstring& text) { url_set_ = false; text_size_valid_ = false; SetAccessibleName(text); + PreferredSizeChanged(); SchedulePaint(); } @@ -117,6 +119,7 @@ void Label::SetURL(const GURL& url) { text_ = UTF8ToWide(url_.spec()); url_set_ = true; text_size_valid_ = false; + PreferredSizeChanged(); SchedulePaint(); } @@ -142,6 +145,7 @@ void Label::SetMultiLine(bool multi_line) { if (multi_line != is_multi_line_) { is_multi_line_ = multi_line; text_size_valid_ = false; + PreferredSizeChanged(); SchedulePaint(); } } @@ -150,6 +154,7 @@ void Label::SetAllowCharacterBreak(bool allow_character_break) { if (allow_character_break != allow_character_break_) { allow_character_break_ = allow_character_break; text_size_valid_ = false; + PreferredSizeChanged(); SchedulePaint(); } } @@ -159,6 +164,7 @@ void Label::SetElideInMiddle(bool elide_in_middle) { if (elide_in_middle != elide_in_middle_) { elide_in_middle_ = elide_in_middle; text_size_valid_ = false; + PreferredSizeChanged(); SchedulePaint(); } } @@ -256,7 +262,10 @@ bool Label::GetAccessibleState(AccessibilityTypes::State* state) { void Label::SetHasFocusBorder(bool has_focus_border) { has_focus_border_ = has_focus_border; - text_size_valid_ &= !is_multi_line_; + if (is_multi_line_) { + text_size_valid_ = false; + PreferredSizeChanged(); + } } void Label::PaintText(gfx::Canvas* canvas, diff --git a/views/controls/tabbed_pane/tabbed_pane.cc b/views/controls/tabbed_pane/tabbed_pane.cc index 0207840..7bff98f 100644 --- a/views/controls/tabbed_pane/tabbed_pane.cc +++ b/views/controls/tabbed_pane/tabbed_pane.cc @@ -27,6 +27,7 @@ void TabbedPane::SetListener(Listener* listener) { void TabbedPane::AddTab(const std::wstring& title, View* contents) { native_tabbed_pane_->AddTab(title, contents); + PreferredSizeChanged(); } void TabbedPane::AddTabAtIndex(int index, @@ -36,6 +37,7 @@ void TabbedPane::AddTabAtIndex(int index, native_tabbed_pane_->AddTabAtIndex(index, title, contents, select_if_first_tab); contents->SetAccessibleName(title); + PreferredSizeChanged(); } int TabbedPane::GetSelectedTabIndex() { @@ -48,6 +50,7 @@ View* TabbedPane::GetSelectedTab() { View* TabbedPane::RemoveTabAtIndex(int index) { return native_tabbed_pane_->RemoveTabAtIndex(index); + PreferredSizeChanged(); } void TabbedPane::SelectTabAt(int index) { diff --git a/views/controls/textfield/textfield.cc b/views/controls/textfield/textfield.cc index cf54251..c98fcc6 100644 --- a/views/controls/textfield/textfield.cc +++ b/views/controls/textfield/textfield.cc @@ -163,16 +163,19 @@ void Textfield::SetFont(const gfx::Font& font) { font_ = font; if (native_wrapper_) native_wrapper_->UpdateFont(); + PreferredSizeChanged(); } void Textfield::SetHorizontalMargins(int left, int right) { if (native_wrapper_) native_wrapper_->SetHorizontalMargins(left, right); + PreferredSizeChanged(); } void Textfield::SetHeightInLines(int num_lines) { DCHECK(IsMultiLine()); num_lines_ = num_lines; + PreferredSizeChanged(); } void Textfield::RemoveBorder() { diff --git a/views/controls/throbber.cc b/views/controls/throbber.cc index 112f43b..ee49d06 100644 --- a/views/controls/throbber.cc +++ b/views/controls/throbber.cc @@ -57,6 +57,7 @@ void Throbber::SetFrames(SkBitmap* frames) { DCHECK(frames_->width() > 0 && frames_->height() > 0); DCHECK(frames_->width() % frames_->height() == 0); frame_count_ = frames_->width() / frames_->height(); + PreferredSizeChanged(); } void Throbber::Run() { |