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

Unified Diff: ui/views/controls/single_split_view.cc

Issue 12871013: DevTools: respect minimum width/height when resizing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 9 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/frame/browser_view.cc ('k') | ui/views/controls/single_split_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/single_split_view.cc
===================================================================
--- ui/views/controls/single_split_view.cc (revision 187863)
+++ ui/views/controls/single_split_view.cc (working copy)
@@ -171,13 +171,16 @@
drag_info_.initial_mouse_offset;
if (is_horizontal_ && base::i18n::IsRTL())
delta_offset *= -1;
- // Honor the minimum size when resizing.
+ // Honor the first child's minimum size when resizing.
gfx::Size min = child_at(0)->GetMinimumSize();
int new_size = std::max(GetPrimaryAxisSize(min.width(), min.height()),
drag_info_.initial_divider_offset + delta_offset);
- // And don't let the view get bigger than our width.
- new_size = std::min(GetPrimaryAxisSize() - kDividerSize, new_size);
+ // Honor the second child's minimum size, and don't let the view
+ // get bigger than our width.
+ min = child_at(1)->GetMinimumSize();
+ new_size = std::min(GetPrimaryAxisSize() - kDividerSize -
+ GetPrimaryAxisSize(min.width(), min.height()), new_size);
if (new_size != divider_offset_) {
set_divider_offset(new_size);
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | ui/views/controls/single_split_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698