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

Unified Diff: ui/views/examples/dialog_example.cc

Issue 2706423002: Use GridLayout for DialogClientView's button row. (Closed)
Patch Set: Add a juicy test Created 3 years, 10 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 | « no previous file | ui/views/window/dialog_client_view.h » ('j') | ui/views/window/dialog_client_view.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/examples/dialog_example.cc
diff --git a/ui/views/examples/dialog_example.cc b/ui/views/examples/dialog_example.cc
index 637c6dafabb1957002431d3e709998ed9e4c4af4..d9af9a4db6959db528a3e1dfb5d8e30ad97e5815 100644
--- a/ui/views/examples/dialog_example.cc
+++ b/ui/views/examples/dialog_example.cc
@@ -245,6 +245,10 @@ void DialogExample::ResizeDialog() {
// Q: Do we need NonClientFrameView::GetWindowBoundsForClientBounds() here?
// A: When DialogCientView properly feeds back sizes, we do not.
widget->SetBoundsConstrained(preferred_bounds);
+
+ // For user-resizable dialogs, ensure the window manager enforces any new
+ // minimum size.
+ widget->OnSizeConstraintsChanged();
}
void DialogExample::ButtonPressed(Button* sender, const ui::Event& event) {
@@ -266,6 +270,7 @@ void DialogExample::ButtonPressed(Button* sender, const ui::Event& event) {
DialogDelegate::CreateDialogWidget(
dialog, container()->GetWidget()->GetNativeWindow(), parent);
+ ResizeDialog();
Peter Kasting 2017/02/25 06:04:07 I'm vaguely surprised this is necessary, and doesn
tapted 2017/02/27 10:04:19 Well this was fun to trace :/. It boils down to a
}
last_dialog_->GetWidget()->Show();
return;
« no previous file with comments | « no previous file | ui/views/window/dialog_client_view.h » ('j') | ui/views/window/dialog_client_view.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698