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

Side by Side Diff: Source/devtools/front_end/TabbedPane.js

Issue 197823010: [DevTools] Add minimum size to WebInspector.View. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@splitdip2
Patch Set: width/height -> right/bottom 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }, 87 },
87 88
88 /** 89 /**
89 * @type {boolean} closeableTabs 90 * @type {boolean} closeableTabs
90 */ 91 */
91 set closeableTabs(closeableTabs) 92 set closeableTabs(closeableTabs)
92 { 93 {
93 this._closeableTabs = closeableTabs; 94 this._closeableTabs = closeableTabs;
94 }, 95 },
95 96
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 { 280 {
280 var tab = this._tabsById[id]; 281 var tab = this._tabsById[id];
281 if (!tab) 282 if (!tab)
282 return; 283 return;
283 if (this._currentTab && this._currentTab.id === id) 284 if (this._currentTab && this._currentTab.id === id)
284 return; 285 return;
285 286
286 this._hideCurrentTab(); 287 this._hideCurrentTab();
287 this._showTab(tab); 288 this._showTab(tab);
288 this._currentTab = tab; 289 this._currentTab = tab;
289 290
290 this._tabsHistory.splice(this._tabsHistory.indexOf(tab), 1); 291 this._tabsHistory.splice(this._tabsHistory.indexOf(tab), 1);
291 this._tabsHistory.splice(0, 0, tab); 292 this._tabsHistory.splice(0, 0, tab);
292 293
293 this._updateTabElements(); 294 this._updateTabElements();
294 295
295 var eventData = { tabId: id, view: tab.view, isUserGesture: userGesture }; 296 var eventData = { tabId: id, view: tab.view, isUserGesture: userGesture };
296 this.dispatchEventToListeners(WebInspector.TabbedPane.EventTypes.TabSele cted, eventData); 297 this.dispatchEventToListeners(WebInspector.TabbedPane.EventTypes.TabSele cted, eventData);
297 }, 298 },
298 299
299 /** 300 /**
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 headerResized: function() 369 headerResized: function()
369 { 370 {
370 this._updateTabElements(); 371 this._updateTabElements();
371 }, 372 },
372 373
373 wasShown: function() 374 wasShown: function()
374 { 375 {
375 var effectiveTab = this._currentTab || this._tabsHistory[0]; 376 var effectiveTab = this._currentTab || this._tabsHistory[0];
376 if (effectiveTab) 377 if (effectiveTab)
377 this.selectTab(effectiveTab.id); 378 this.selectTab(effectiveTab.id);
379 this.invalidateMinimumSize();
380 },
381
382 /**
383 * @return {!Size}
384 */
385 calculateMinimumSize: function()
386 {
387 var size = WebInspector.VBox.prototype.calculateMinimumSize.call(this);
388 if (this._verticalTabLayout)
389 size.width += this._headerElement.offsetWidth;
390 else
391 size.height += this._headerElement.offsetHeight;
392 return size;
378 }, 393 },
379 394
380 _updateTabElements: function() 395 _updateTabElements: function()
381 { 396 {
382 WebInspector.invokeOnceAfterBatchUpdate(this, this._innerUpdateTabElemen ts); 397 WebInspector.invokeOnceAfterBatchUpdate(this, this._innerUpdateTabElemen ts);
383 }, 398 },
384 399
385 /** 400 /**
386 * @param {string} text 401 * @param {string} text
387 */ 402 */
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 { 1146 {
1132 if (this._views.contains(id)) 1147 if (this._views.contains(id))
1133 return /** @type {!WebInspector.View} */ (this._views.get(id)); 1148 return /** @type {!WebInspector.View} */ (this._views.get(id));
1134 var view = this._extensions[id] ? /** @type {!WebInspector.View} */ (thi s._extensions[id].instance()) : null; 1149 var view = this._extensions[id] ? /** @type {!WebInspector.View} */ (thi s._extensions[id].instance()) : null;
1135 this._views.put(id, view); 1150 this._views.put(id, view);
1136 if (this._viewCallback && view) 1151 if (this._viewCallback && view)
1137 this._viewCallback(id, view); 1152 this._viewCallback(id, view);
1138 return view; 1153 return view;
1139 } 1154 }
1140 } 1155 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698