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

Unified Diff: ui/views/window/dialog_frame_view.cc

Issue 11818044: Replace IDR_WEB_UI_CLOSE* with IDR_CLOSE_DIALOG*, cleanup, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 7 years, 11 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 | « ui/views/controls/button/label_button.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_frame_view.cc
diff --git a/ui/views/window/dialog_frame_view.cc b/ui/views/window/dialog_frame_view.cc
index 1a5c244dc988500f9cef3eea607c330d29a7b2d1..eed14d74b59b3d00c7d4a5ac3594a4869199f65d 100644
--- a/ui/views/window/dialog_frame_view.cc
+++ b/ui/views/window/dialog_frame_view.cc
@@ -51,12 +51,13 @@ DialogFrameView::DialogFrameView(const string16& title)
close_ = new LabelButton(this, string16());
close_->SetImage(CustomButton::STATE_NORMAL,
- *rb.GetImageNamed(IDR_CLOSE_BAR).ToImageSkia());
+ *rb.GetImageNamed(IDR_CLOSE_DIALOG).ToImageSkia());
close_->SetImage(CustomButton::STATE_HOVERED,
- *rb.GetImageNamed(IDR_CLOSE_BAR_H).ToImageSkia());
+ *rb.GetImageNamed(IDR_CLOSE_DIALOG_H).ToImageSkia());
close_->SetImage(CustomButton::STATE_PRESSED,
- *rb.GetImageNamed(IDR_CLOSE_BAR_P).ToImageSkia());
+ *rb.GetImageNamed(IDR_CLOSE_DIALOG_P).ToImageSkia());
close_->SetSize(close_->GetPreferredSize());
+ close_->set_border(NULL);
AddChildView(close_);
// Set the margins for the content view.
@@ -112,8 +113,11 @@ std::string DialogFrameView::GetClassName() const {
void DialogFrameView::Layout() {
gfx::Rect bounds = GetLocalBounds();
bounds.Inset(border()->GetInsets());
+ // Small additional insets yield the desired 10px visual close button insets.
+ bounds.Inset(0, 2, 1, 0);
close_->SetPosition(gfx::Point(bounds.right() - close_->width(), bounds.y()));
- bounds.Inset(gfx::Insets(kSpacing, 2 * kSpacing, 0, close_->width()));
+ // Small additional insets yield the desired 20px visual title label insets.
+ bounds.Inset(2 * kSpacing - 1, kSpacing, close_->width(), 0);
bounds.set_height(title_->font().GetHeight());
title_->SetBoundsRect(bounds);
}
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698