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

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

Issue 197823010: [DevTools] Add minimum size to WebInspector.View. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@splitdip2
Patch Set: 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) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 /** 147 /**
148 * @extends {WebInspector.Panel} 148 * @extends {WebInspector.Panel}
149 * @param {number=} defaultWidth 149 * @param {number=} defaultWidth
150 * @constructor 150 * @constructor
151 */ 151 */
152 WebInspector.PanelWithSidebarTree = function(name, defaultWidth) 152 WebInspector.PanelWithSidebarTree = function(name, defaultWidth)
153 { 153 {
154 WebInspector.Panel.call(this, name); 154 WebInspector.Panel.call(this, name);
155 155
156 this._panelSplitView = new WebInspector.SplitView(true, false, this._panelNa me + "PanelSplitViewState", defaultWidth || 200); 156 this._panelSplitView = new WebInspector.SplitView(true, false, this._panelNa me + "PanelSplitViewState", defaultWidth || 200);
157 this._panelSplitView.setSidebarElementConstraints(Preferences.minSidebarWidt h);
158 this._panelSplitView.show(this.element); 157 this._panelSplitView.show(this.element);
159 158
160 var sidebarElement = this._panelSplitView.sidebarElement(); 159 var sidebarView = new WebInspector.VBox();
161 sidebarElement.classList.add("sidebar"); 160 sidebarView.setMinimumSize(new Size(Preferences.minSidebarWidth, 25));
162 var sidebarTreeElement = sidebarElement.createChild("ol", "sidebar-tree"); 161 sidebarView.show(this._panelSplitView.sidebarElement());
162
163 this._sidebarElement = sidebarView.element;
164 this._sidebarElement.classList.add("sidebar");
165 var sidebarTreeElement = this._sidebarElement.createChild("ol", "sidebar-tre e");
163 this.sidebarTree = new TreeOutline(sidebarTreeElement); 166 this.sidebarTree = new TreeOutline(sidebarTreeElement);
164 } 167 }
165 168
166 WebInspector.PanelWithSidebarTree.prototype = { 169 WebInspector.PanelWithSidebarTree.prototype = {
167 /** 170 /**
168 * @return {!Element} 171 * @return {!Element}
169 */ 172 */
170 sidebarElement: function() 173 sidebarElement: function()
171 { 174 {
172 return this._panelSplitView.sidebarElement(); 175 return this._sidebarElement;
173 }, 176 },
174 177
175 /** 178 /**
176 * @return {!Element} element 179 * @return {!Element} element
177 */ 180 */
178 mainElement: function() 181 mainElement: function()
179 { 182 {
180 return this._panelSplitView.mainElement(); 183 return this._panelSplitView.mainElement();
181 }, 184 },
182 185
183 /** 186 /**
184 * @param {number=} minWidth
185 * @param {number=} minHeight
186 */
187 setMainElementConstraints: function(minWidth, minHeight)
188 {
189 this._panelSplitView.setMainElementConstraints(minWidth, minHeight);
190 },
191
192 /**
193 * @return {!Element} 187 * @return {!Element}
194 */ 188 */
195 defaultFocusedElement: function() 189 defaultFocusedElement: function()
196 { 190 {
197 return this.sidebarTree.element || this.element; 191 return this.sidebarTree.element || this.element;
198 }, 192 },
199 193
200 __proto__: WebInspector.Panel.prototype 194 __proto__: WebInspector.Panel.prototype
201 } 195 }
202 196
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 }, 248 },
255 249
256 /** 250 /**
257 * @return {!WebInspector.Panel} 251 * @return {!WebInspector.Panel}
258 */ 252 */
259 panel: function() 253 panel: function()
260 { 254 {
261 return /** @type {!WebInspector.Panel} */ (this._extension.instance()); 255 return /** @type {!WebInspector.Panel} */ (this._extension.instance());
262 } 256 }
263 } 257 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698