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

Unified Diff: Source/devtools/front_end/TabbedPane.js

Issue 214663005: [DevTools] Add preferred size to WebInspector.View. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Two methods Created 6 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 | « Source/devtools/front_end/SplitView.js ('k') | Source/devtools/front_end/View.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/TabbedPane.js
diff --git a/Source/devtools/front_end/TabbedPane.js b/Source/devtools/front_end/TabbedPane.js
index 3a93bafe529048e3a3e2339f608ae8336149291b..5d344f106ad837495a909f1493aec62e04796378 100644
--- a/Source/devtools/front_end/TabbedPane.js
+++ b/Source/devtools/front_end/TabbedPane.js
@@ -83,7 +83,7 @@ WebInspector.TabbedPane.prototype = {
set verticalTabLayout(verticalTabLayout)
{
this._verticalTabLayout = verticalTabLayout;
- this.invalidateMinimumSize();
+ this.invalidateConstraints();
},
/**
@@ -376,20 +376,22 @@ WebInspector.TabbedPane.prototype = {
var effectiveTab = this._currentTab || this._tabsHistory[0];
if (effectiveTab)
this.selectTab(effectiveTab.id);
- this.invalidateMinimumSize();
+ this.invalidateConstraints();
},
/**
- * @return {!Size}
+ * @return {!Constraints}
*/
- calculateMinimumSize: function()
+ calculateConstraints: function()
{
- var size = WebInspector.VBox.prototype.calculateMinimumSize.call(this);
+ var constraints = WebInspector.VBox.prototype.calculateConstraints.call(this);
+ var minContentConstraints = new Constraints(new Size(0, 0), new Size(50, 50));
+ constraints = constraints.widthToMax(minContentConstraints).heightToMax(minContentConstraints);
if (this._verticalTabLayout)
- size.width += this._headerElement.offsetWidth;
+ constraints = constraints.addWidth(new Constraints(new Size(this._headerElement.offsetWidth, 0)));
else
- size.height += this._headerElement.offsetHeight;
- return size;
+ constraints = constraints.addHeight(new Constraints(new Size(0, this._headerElement.offsetHeight)));
+ return constraints;
},
_updateTabElements: function()
« no previous file with comments | « Source/devtools/front_end/SplitView.js ('k') | Source/devtools/front_end/View.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698