OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 { | 76 { |
77 this._shrinkableTabs = shrinkableTabs; | 77 this._shrinkableTabs = shrinkableTabs; |
78 }, | 78 }, |
79 | 79 |
80 /** | 80 /** |
81 * @type {boolean} verticalTabLayout | 81 * @type {boolean} verticalTabLayout |
82 */ | 82 */ |
83 set verticalTabLayout(verticalTabLayout) | 83 set verticalTabLayout(verticalTabLayout) |
84 { | 84 { |
85 this._verticalTabLayout = verticalTabLayout; | 85 this._verticalTabLayout = verticalTabLayout; |
86 this.invalidateMinimumSize(); | 86 this.invalidateConstraints(); |
87 }, | 87 }, |
88 | 88 |
89 /** | 89 /** |
90 * @type {boolean} closeableTabs | 90 * @type {boolean} closeableTabs |
91 */ | 91 */ |
92 set closeableTabs(closeableTabs) | 92 set closeableTabs(closeableTabs) |
93 { | 93 { |
94 this._closeableTabs = closeableTabs; | 94 this._closeableTabs = closeableTabs; |
95 }, | 95 }, |
96 | 96 |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 headerResized: function() | 369 headerResized: function() |
370 { | 370 { |
371 this._updateTabElements(); | 371 this._updateTabElements(); |
372 }, | 372 }, |
373 | 373 |
374 wasShown: function() | 374 wasShown: function() |
375 { | 375 { |
376 var effectiveTab = this._currentTab || this._tabsHistory[0]; | 376 var effectiveTab = this._currentTab || this._tabsHistory[0]; |
377 if (effectiveTab) | 377 if (effectiveTab) |
378 this.selectTab(effectiveTab.id); | 378 this.selectTab(effectiveTab.id); |
379 this.invalidateMinimumSize(); | 379 this.invalidateConstraints(); |
380 }, | 380 }, |
381 | 381 |
382 /** | 382 /** |
383 * @return {!Size} | 383 * @return {!Constraints} |
384 */ | 384 */ |
385 calculateMinimumSize: function() | 385 calculateConstraints: function() |
386 { | 386 { |
387 var size = WebInspector.VBox.prototype.calculateMinimumSize.call(this); | 387 var constraints = WebInspector.VBox.prototype.calculateConstraints.call(
this); |
| 388 var minContentConstraints = new Constraints(new Size(0, 0), new Size(50,
50)); |
| 389 constraints = constraints.widthToMax(minContentConstraints).heightToMax(
minContentConstraints); |
388 if (this._verticalTabLayout) | 390 if (this._verticalTabLayout) |
389 size.width += this._headerElement.offsetWidth; | 391 constraints = constraints.addWidth(new Constraints(new Size(this._he
aderElement.offsetWidth, 0))); |
390 else | 392 else |
391 size.height += this._headerElement.offsetHeight; | 393 constraints = constraints.addHeight(new Constraints(new Size(0, this
._headerElement.offsetHeight))); |
392 return size; | 394 return constraints; |
393 }, | 395 }, |
394 | 396 |
395 _updateTabElements: function() | 397 _updateTabElements: function() |
396 { | 398 { |
397 WebInspector.invokeOnceAfterBatchUpdate(this, this._innerUpdateTabElemen
ts); | 399 WebInspector.invokeOnceAfterBatchUpdate(this, this._innerUpdateTabElemen
ts); |
398 }, | 400 }, |
399 | 401 |
400 /** | 402 /** |
401 * @param {string} text | 403 * @param {string} text |
402 */ | 404 */ |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 { | 1130 { |
1129 if (this._views.contains(id)) | 1131 if (this._views.contains(id)) |
1130 return /** @type {!WebInspector.View} */ (this._views.get(id)); | 1132 return /** @type {!WebInspector.View} */ (this._views.get(id)); |
1131 var view = this._extensions[id] ? /** @type {!WebInspector.View} */ (thi
s._extensions[id].instance()) : null; | 1133 var view = this._extensions[id] ? /** @type {!WebInspector.View} */ (thi
s._extensions[id].instance()) : null; |
1132 this._views.put(id, view); | 1134 this._views.put(id, view); |
1133 if (this._viewCallback && view) | 1135 if (this._viewCallback && view) |
1134 this._viewCallback(id, view); | 1136 this._viewCallback(id, view); |
1135 return view; | 1137 return view; |
1136 } | 1138 } |
1137 } | 1139 } |
OLD | NEW |