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

Side by Side 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: saved main size 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 unified diff | Download patch
OLDNEW
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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 this.selectTab(effectiveTab.id); 378 this.selectTab(effectiveTab.id);
379 this.invalidateMinimumSize(); 379 this.invalidateMinimumSize();
380 }, 380 },
381 381
382 /** 382 /**
383 * @return {!Size} 383 * @return {!Size}
384 */ 384 */
385 calculateMinimumSize: function() 385 calculateMinimumSize: function()
386 { 386 {
387 var size = WebInspector.VBox.prototype.calculateMinimumSize.call(this); 387 var size = WebInspector.VBox.prototype.calculateMinimumSize.call(this);
388 var minContentSize = new Size(0, 0, 50, 50);
389 size = size.widthToMax(minContentSize).heightToMax(minContentSize);
388 if (this._verticalTabLayout) 390 if (this._verticalTabLayout)
389 size.width += this._headerElement.offsetWidth; 391 size = size.addWidth(new Size(this._headerElement.offsetWidth, 0));
390 else 392 else
391 size.height += this._headerElement.offsetHeight; 393 size = size.addHeight(new Size(0, this._headerElement.offsetHeight)) ;
392 return size; 394 return size;
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
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698