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

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

Issue 2485083003: views: add layout delegates (Closed)
Patch Set: fix msvc compile Created 4 years, 1 month 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/views_delegate.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_client_view.cc
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc
index ce9099fb3931760943a25b2c403845c99979f70e..c46942a5bf96a16f0bf98fdde31c6b6a670ea0cd 100644
--- a/ui/views/window/dialog_client_view.cc
+++ b/ui/views/window/dialog_client_view.cc
@@ -15,6 +15,7 @@
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/layout/layout_constants.h"
+#include "ui/views/views_delegate.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_delegate.h"
@@ -52,7 +53,11 @@ void LayoutButton(LabelButton* button,
row_bounds->right(),
row_bounds->y() + (row_bounds->height() - button_height) / 2,
size.width(), button_height);
- row_bounds->set_width(row_bounds->width() - kRelatedButtonHSpacing);
+ int spacing = ViewsDelegate::GetInstance()
+ ? ViewsDelegate::GetInstance()
+ ->GetDialogRelatedButtonHorizontalSpacing()
+ : kRelatedButtonHSpacing;
+ row_bounds->set_width(row_bounds->width() - spacing);
}
} // namespace
@@ -73,6 +78,9 @@ DialogClientView::DialogClientView(Widget* owner, View* contents_view)
// Doing this now ensures this accelerator will have lower priority than
// one set by the contents view.
AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE));
+
+ if (ViewsDelegate::GetInstance())
+ button_row_insets_ = ViewsDelegate::GetInstance()->GetDialogButtonInsets();
}
DialogClientView::~DialogClientView() {
« no previous file with comments | « ui/views/views_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698