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

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

Issue 197823010: [DevTools] Add minimum size to WebInspector.View. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@splitdip2
Patch Set: rebase 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 this._workspace = workspaceForTest || WebInspector.workspace; 65 this._workspace = workspaceForTest || WebInspector.workspace;
66 66
67 var helpSection = WebInspector.shortcutsScreen.section(WebInspector.UIString ("Sources Panel")); 67 var helpSection = WebInspector.shortcutsScreen.section(WebInspector.UIString ("Sources Panel"));
68 this.debugToolbar = this._createDebugToolbar(); 68 this.debugToolbar = this._createDebugToolbar();
69 this._debugToolbarDrawer = this._createDebugToolbarDrawer(); 69 this._debugToolbarDrawer = this._createDebugToolbarDrawer();
70 this.threadsToolbar = new WebInspector.ThreadsToolbar(); 70 this.threadsToolbar = new WebInspector.ThreadsToolbar();
71 71
72 const initialDebugSidebarWidth = 225; 72 const initialDebugSidebarWidth = 225;
73 this._splitView = new WebInspector.SplitView(true, true, "sourcesPanelSplitV iewState", initialDebugSidebarWidth); 73 this._splitView = new WebInspector.SplitView(true, true, "sourcesPanelSplitV iewState", initialDebugSidebarWidth);
74 this._splitView.enableShowModeSaving(); 74 this._splitView.enableShowModeSaving();
75 this._splitView.setMainElementConstraints(200, 25);
76 this._splitView.setSidebarElementConstraints(WebInspector.SourcesPanel.minTo olbarWidth, 25);
77
78 this._splitView.show(this.element); 75 this._splitView.show(this.element);
79 76
80 // Create scripts navigator 77 // Create scripts navigator
81 const initialNavigatorWidth = 225; 78 const initialNavigatorWidth = 225;
82 this.editorView = new WebInspector.SplitView(true, false, "sourcesPanelNavig atorSplitViewState", initialNavigatorWidth); 79 this.editorView = new WebInspector.SplitView(true, false, "sourcesPanelNavig atorSplitViewState", initialNavigatorWidth);
83 this.editorView.enableShowModeSaving(); 80 this.editorView.enableShowModeSaving();
84 this.editorView.element.id = "scripts-editor-split-view"; 81 this.editorView.element.id = "scripts-editor-split-view";
85 this.editorView.element.tabIndex = 0; 82 this.editorView.element.tabIndex = 0;
86
87 this.editorView.setSidebarElementConstraints(Preferences.minSidebarWidth);
88 this.editorView.setMainElementConstraints(50, 50);
89 this.editorView.show(this._splitView.mainElement()); 83 this.editorView.show(this._splitView.mainElement());
90 84
91 this._navigator = new WebInspector.SourcesNavigator(this._workspace); 85 this._navigator = new WebInspector.SourcesNavigator(this._workspace);
86 this._navigator.view.setMinimumSize(Preferences.minSidebarWidth, 25);
92 this._navigator.view.show(this.editorView.sidebarElement()); 87 this._navigator.view.show(this.editorView.sidebarElement());
93 this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.Source Selected, this._sourceSelected, this); 88 this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.Source Selected, this._sourceSelected, this);
94 this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.Source Renamed, this._sourceRenamed, this); 89 this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.Source Renamed, this._sourceRenamed, this);
95 90
96 this._sourcesEditor = new WebInspector.SourcesEditor(this._workspace, this); 91 this._sourcesEditor = new WebInspector.SourcesEditor(this._workspace, this);
97 this._sourcesEditor.addEventListener(WebInspector.SourcesEditor.Events.Edito rSelected, this._editorSelected.bind(this)); 92 this._sourcesEditor.addEventListener(WebInspector.SourcesEditor.Events.Edito rSelected, this._editorSelected.bind(this));
98 this._sourcesEditor.addEventListener(WebInspector.SourcesEditor.Events.Edito rClosed, this._editorClosed.bind(this)); 93 this._sourcesEditor.addEventListener(WebInspector.SourcesEditor.Events.Edito rClosed, this._editorClosed.bind(this));
99 this._sourcesEditor.registerShortcuts(this.registerShortcuts.bind(this)); 94 this._sourcesEditor.registerShortcuts(this.registerShortcuts.bind(this));
100 95
101 this._drawerEditorView = new WebInspector.SourcesPanel.DrawerEditorView(); 96 this._drawerEditorView = new WebInspector.SourcesPanel.DrawerEditorView();
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 if (!vertically) 988 if (!vertically)
994 this._splitView.uninstallResizer(this._sourcesEditor.statusBarContai nerElement()); 989 this._splitView.uninstallResizer(this._sourcesEditor.statusBarContai nerElement());
995 else 990 else
996 this._splitView.installResizer(this._sourcesEditor.statusBarContaine rElement()); 991 this._splitView.installResizer(this._sourcesEditor.statusBarContaine rElement());
997 992
998 // Create vertical box with stack. 993 // Create vertical box with stack.
999 var vbox = new WebInspector.VBox(); 994 var vbox = new WebInspector.VBox();
1000 vbox.element.appendChild(this._debugToolbarDrawer); 995 vbox.element.appendChild(this._debugToolbarDrawer);
1001 vbox.element.appendChild(this.debugToolbar); 996 vbox.element.appendChild(this.debugToolbar);
1002 vbox.element.appendChild(this.threadsToolbar.element); 997 vbox.element.appendChild(this.threadsToolbar.element);
998 vbox.setMinimumSize(WebInspector.SourcesPanel.minToolbarWidth, 25);
1003 var sidebarPaneStack = new WebInspector.SidebarPaneStack(); 999 var sidebarPaneStack = new WebInspector.SidebarPaneStack();
1004 sidebarPaneStack.element.classList.add("flex-auto"); 1000 sidebarPaneStack.element.classList.add("flex-auto");
1005 sidebarPaneStack.show(vbox.element); 1001 sidebarPaneStack.show(vbox.element);
1006 1002
1007 if (!vertically) { 1003 if (!vertically) {
1008 // Populate the only stack. 1004 // Populate the only stack.
1009 for (var pane in this.sidebarPanes) 1005 for (var pane in this.sidebarPanes)
1010 sidebarPaneStack.addPane(this.sidebarPanes[pane]); 1006 sidebarPaneStack.addPane(this.sidebarPanes[pane]);
1011 this._extensionSidebarPanesContainer = sidebarPaneStack; 1007 this._extensionSidebarPanesContainer = sidebarPaneStack;
1012 1008
1013 this.sidebarPaneView = vbox; 1009 this.sidebarPaneView = vbox;
1014 } else { 1010 } else {
1015 var splitView = new WebInspector.SplitView(true, true, "sourcesPanel DebuggerSidebarSplitViewState", 0.5); 1011 var splitView = new WebInspector.SplitView(true, true, "sourcesPanel DebuggerSidebarSplitViewState", 0.5);
1016 splitView.setMainElementConstraints(WebInspector.SourcesPanel.minToo lbarWidth, 25);
1017 vbox.show(splitView.mainElement()); 1012 vbox.show(splitView.mainElement());
1018 1013
1019 // Populate the left stack. 1014 // Populate the left stack.
1020 sidebarPaneStack.addPane(this.sidebarPanes.callstack); 1015 sidebarPaneStack.addPane(this.sidebarPanes.callstack);
1021 sidebarPaneStack.addPane(this.sidebarPanes.jsBreakpoints); 1016 sidebarPaneStack.addPane(this.sidebarPanes.jsBreakpoints);
1022 sidebarPaneStack.addPane(this.sidebarPanes.domBreakpoints); 1017 sidebarPaneStack.addPane(this.sidebarPanes.domBreakpoints);
1023 sidebarPaneStack.addPane(this.sidebarPanes.xhrBreakpoints); 1018 sidebarPaneStack.addPane(this.sidebarPanes.xhrBreakpoints);
1024 sidebarPaneStack.addPane(this.sidebarPanes.eventListenerBreakpoints) ; 1019 sidebarPaneStack.addPane(this.sidebarPanes.eventListenerBreakpoints) ;
1025 if (this.sidebarPanes.workerList) 1020 if (this.sidebarPanes.workerList)
1026 sidebarPaneStack.addPane(this.sidebarPanes.workerList); 1021 sidebarPaneStack.addPane(this.sidebarPanes.workerList);
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 WebInspector.SourcesPanel.UILocationRevealer.prototype = { 1153 WebInspector.SourcesPanel.UILocationRevealer.prototype = {
1159 /** 1154 /**
1160 * @param {!Object} uiLocation 1155 * @param {!Object} uiLocation
1161 */ 1156 */
1162 reveal: function(uiLocation) 1157 reveal: function(uiLocation)
1163 { 1158 {
1164 if (uiLocation instanceof WebInspector.UILocation) 1159 if (uiLocation instanceof WebInspector.UILocation)
1165 /** @type {!WebInspector.SourcesPanel} */ (WebInspector.inspectorVie w.panel("sources")).showUILocation(uiLocation); 1160 /** @type {!WebInspector.SourcesPanel} */ (WebInspector.inspectorVie w.panel("sources")).showUILocation(uiLocation);
1166 } 1161 }
1167 } 1162 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698