Skip to content

Commit

Permalink
DevTools: Make timeline memory pane resizable with its header.
Browse files Browse the repository at this point in the history
Review URL: https://codereview.chromium.org/1675333003

Cr-Commit-Position: refs/heads/master@{#374475}
  • Loading branch information
a1ph authored and Commit bot committed Feb 9, 2016
1 parent dd95126 commit 778934e
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 4 deletions.
11 changes: 10 additions & 1 deletion front_end/timeline/CountersGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ WebInspector.CountersGraph = function(delegate, model, filters)

// Create selectors
this._infoWidget = new WebInspector.HBox();
this._infoWidget.element.classList.add("memory-counter-selector-swatches");
this._infoWidget.element.classList.add("memory-counter-selector-swatches", "timeline-toolbar-resizer");
this._infoWidget.show(this.element);

this._graphsContainer = new WebInspector.VBox();
Expand Down Expand Up @@ -132,6 +132,15 @@ WebInspector.CountersGraph.prototype = {
this.refresh();
},

/**
* @override
* @return {?Element}
*/
resizerElement: function()
{
return this._infoWidget.element;
},

_resize: function()
{
var parentElement = this._canvas.parentElement;
Expand Down
9 changes: 9 additions & 0 deletions front_end/timeline/TimelineFlameChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,15 @@ WebInspector.TimelineFlameChartView.prototype = {
WebInspector.BlackboxSupport.removeChangeListener(this.refreshRecords, this);
},

/**
* @override
* @return {?Element}
*/
resizerElement: function()
{
return null;
},

/**
* @override
* @param {number} windowStartTime
Expand Down
21 changes: 20 additions & 1 deletion front_end/timeline/TimelinePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,12 @@ WebInspector.TimelinePanel.prototype = {
{
modeView.setWindowTimes(this.windowStartTime(), this.windowEndTime());
modeView.refreshRecords();
this._stackView.appendView(modeView.view(), "timelinePanelTimelineStackSplitViewState", undefined, 112);
var splitWidget = this._stackView.appendView(modeView.view(), "timelinePanelTimelineStackSplitViewState", undefined, 112);
var resizer = modeView.resizerElement();
if (splitWidget && resizer) {
splitWidget.hideDefaultResizer();
splitWidget.installResizer(resizer);
}
this._currentViews.push(modeView);
},

Expand Down Expand Up @@ -1261,6 +1266,15 @@ WebInspector.TimelineTreeModeView.prototype = {
{
},

/**
* @override
* @return {?Element}
*/
resizerElement: function()
{
return null;
},

/**
* @override
*/
Expand Down Expand Up @@ -1543,6 +1557,11 @@ WebInspector.TimelineModeView.prototype = {

dispose: function() {},

/**
* @return {?Element}
*/
resizerElement: function() {},

reset: function() {},

refreshRecords: function() {},
Expand Down
6 changes: 6 additions & 0 deletions front_end/timeline/timelinePanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@
min-height: 100%;
}

.timeline-toolbar-resizer {
background-image: url(Images/toolbarResizerVertical.png);
background-repeat: no-repeat;
background-position: right center, center;
}

.memory-graph-label {
position: absolute;
right: 0;
Expand Down
5 changes: 3 additions & 2 deletions front_end/ui/StackView.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ WebInspector.StackView.prototype = {
* @param {string=} sidebarSizeSettingName
* @param {number=} defaultSidebarWidth
* @param {number=} defaultSidebarHeight
* @return {!WebInspector.SplitWidget}
* @return {?WebInspector.SplitWidget}
*/
appendView: function(view, sidebarSizeSettingName, defaultSidebarWidth, defaultSidebarHeight)
{
Expand All @@ -59,8 +59,9 @@ WebInspector.StackView.prototype = {
this._currentSplitWidget.showBoth();
}

var lastSplitWidget = this._currentSplitWidget;
this._currentSplitWidget = splitWidget;
return splitWidget;
return lastSplitWidget;
},

detachChildWidgets: function()
Expand Down

0 comments on commit 778934e

Please sign in to comment.