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

Unified Diff: ui/views/layout/layout_provider.cc

Issue 2907873002: views: impose minimum width on non-Harmony snappables (Closed)
Patch Set: move into ui/views Created 3 years, 7 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 | « chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/layout/layout_provider.cc
diff --git a/ui/views/layout/layout_provider.cc b/ui/views/layout/layout_provider.cc
index af62c005255cbf51975f2d78b572af068c766cec..11412ca33f5a4560f8b9807add62831ba8d7f3ba 100644
--- a/ui/views/layout/layout_provider.cc
+++ b/ui/views/layout/layout_provider.cc
@@ -104,7 +104,13 @@ const TypographyProvider& LayoutProvider::GetTypographyProvider() const {
}
int LayoutProvider::GetSnappedDialogWidth(int min_width) const {
- return min_width;
+ // This is an arbitrary value, but it's a good arbitrary value. Some dialogs
+ // have very small widths for their contents views, which causes ugly
+ // title-wrapping where a two-word title is split across multiple lines or
+ // similar. To prevent that, forbid any snappable dialog from being narrower
+ // than this value. In principle it's possible to factor in the title width
+ // here, but it is not really worth the complexity.
+ return std::max(min_width, 320);
}
} // namespace views
« no previous file with comments | « chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698