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

Unified Diff: chrome/browser/ui/panels/panel_resize_controller.cc

Issue 10260001: Remove panel size limit when user resizes it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 8 years, 8 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/panels/panel_resize_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel_resize_controller.cc
diff --git a/chrome/browser/ui/panels/panel_resize_controller.cc b/chrome/browser/ui/panels/panel_resize_controller.cc
index 2c0ee25fc741dd844923d434e0e258c92afa1ad3..92da0a9cde28c5fbf142910e2ea0ae29c0fc1259 100644
--- a/chrome/browser/ui/panels/panel_resize_controller.cc
+++ b/chrome/browser/ui/panels/panel_resize_controller.cc
@@ -88,10 +88,22 @@ void PanelResizeController::Resize(const gfx::Point& mouse_location) {
mouse_location_at_start_.y() - mouse_location.y(), 0));
}
- // Give the panel a chance to adjust the bounds before setting them.
- gfx::Size size = bounds.size();
- resizing_panel_->ClampSize(&size);
- bounds.set_size(size);
+ // Update the max size of the panel so it's never smaller then the actual
+ // panel's size. Note that even if the user resizes the panel smaller later,
+ // the increased max size will still be in effect. Since it's not possible
+ // currently to switch the panel back to autosizing from user-resizable, it
+ // should not be a problem.
+ gfx::Size max_panel_size = resizing_panel_->max_size();
+ if (max_panel_size.width() < bounds.width())
+ max_panel_size.set_width(bounds.width());
+ if (max_panel_size.height() < bounds.height())
+ max_panel_size.set_height(bounds.height());
+
+ resizing_panel_->SetSizeRange(resizing_panel_->min_size(), max_panel_size);
+
+ // This effectively only clamps using the min size, since the max_size was
+ // updated above.
+ bounds.set_size(resizing_panel_->ClampSize(bounds.size()));
if (ResizingLeft(sides_resized_)) {
bounds.set_x(bounds_at_start_.x() -
« no previous file with comments | « chrome/browser/ui/panels/panel_resize_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698