OLD | NEW |
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 this._workspace = workspaceForTest || WebInspector.workspace; | 66 this._workspace = workspaceForTest || WebInspector.workspace; |
67 | 67 |
68 var helpSection = WebInspector.shortcutsScreen.section(WebInspector.UIString
("Sources Panel")); | 68 var helpSection = WebInspector.shortcutsScreen.section(WebInspector.UIString
("Sources Panel")); |
69 this.debugToolbar = this._createDebugToolbar(); | 69 this.debugToolbar = this._createDebugToolbar(); |
70 this._debugToolbarDrawer = this._createDebugToolbarDrawer(); | 70 this._debugToolbarDrawer = this._createDebugToolbarDrawer(); |
71 this.threadsToolbar = new WebInspector.ThreadsToolbar(); | 71 this.threadsToolbar = new WebInspector.ThreadsToolbar(); |
72 | 72 |
73 const initialDebugSidebarWidth = 225; | 73 const initialDebugSidebarWidth = 225; |
74 this._splitView = new WebInspector.SplitView(true, true, "sourcesPanelSplitV
iewState", initialDebugSidebarWidth); | 74 this._splitView = new WebInspector.SplitView(true, true, "sourcesPanelSplitV
iewState", initialDebugSidebarWidth); |
75 this._splitView.enableShowModeSaving(); | 75 this._splitView.enableShowModeSaving(); |
76 this._splitView.setMainElementConstraints(200, 25); | |
77 this._splitView.setSidebarElementConstraints(WebInspector.SourcesPanel.minTo
olbarWidth, 25); | |
78 | |
79 this._splitView.show(this.element); | 76 this._splitView.show(this.element); |
80 | 77 |
81 // Create scripts navigator | 78 // Create scripts navigator |
82 const initialNavigatorWidth = 225; | 79 const initialNavigatorWidth = 225; |
83 this.editorView = new WebInspector.SplitView(true, false, "sourcesPanelNavig
atorSplitViewState", initialNavigatorWidth); | 80 this.editorView = new WebInspector.SplitView(true, false, "sourcesPanelNavig
atorSplitViewState", initialNavigatorWidth); |
84 this.editorView.enableShowModeSaving(); | 81 this.editorView.enableShowModeSaving(); |
85 this.editorView.element.id = "scripts-editor-split-view"; | 82 this.editorView.element.id = "scripts-editor-split-view"; |
86 this.editorView.element.tabIndex = 0; | 83 this.editorView.element.tabIndex = 0; |
87 | |
88 this.editorView.setSidebarElementConstraints(Preferences.minSidebarWidth); | |
89 this.editorView.setMainElementConstraints(50, 50); | |
90 this.editorView.show(this._splitView.mainElement()); | 84 this.editorView.show(this._splitView.mainElement()); |
91 | 85 |
92 this._navigator = new WebInspector.SourcesNavigator(this._workspace); | 86 this._navigator = new WebInspector.SourcesNavigator(this._workspace); |
| 87 this._navigator.view.setMinimumSize(Preferences.minSidebarWidth, 25); |
93 this._navigator.view.show(this.editorView.sidebarElement()); | 88 this._navigator.view.show(this.editorView.sidebarElement()); |
94 this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.Source
Selected, this._sourceSelected, this); | 89 this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.Source
Selected, this._sourceSelected, this); |
95 this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.Source
Renamed, this._sourceRenamed, this); | 90 this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.Source
Renamed, this._sourceRenamed, this); |
96 | 91 |
97 this._sourcesView = new WebInspector.SourcesView(this._workspace, this); | 92 this._sourcesView = new WebInspector.SourcesView(this._workspace, this); |
98 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorSel
ected, this._editorSelected.bind(this)); | 93 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorSel
ected, this._editorSelected.bind(this)); |
99 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorClo
sed, this._editorClosed.bind(this)); | 94 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorClo
sed, this._editorClosed.bind(this)); |
100 this._sourcesView.registerShortcuts(this.registerShortcuts.bind(this)); | 95 this._sourcesView.registerShortcuts(this.registerShortcuts.bind(this)); |
101 | 96 |
102 this._drawerEditorView = new WebInspector.SourcesPanel.DrawerEditorView(); | 97 this._drawerEditorView = new WebInspector.SourcesPanel.DrawerEditorView(); |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 if (!vertically) | 989 if (!vertically) |
995 this._splitView.uninstallResizer(this._sourcesView.statusBarContaine
rElement()); | 990 this._splitView.uninstallResizer(this._sourcesView.statusBarContaine
rElement()); |
996 else | 991 else |
997 this._splitView.installResizer(this._sourcesView.statusBarContainerE
lement()); | 992 this._splitView.installResizer(this._sourcesView.statusBarContainerE
lement()); |
998 | 993 |
999 // Create vertical box with stack. | 994 // Create vertical box with stack. |
1000 var vbox = new WebInspector.VBox(); | 995 var vbox = new WebInspector.VBox(); |
1001 vbox.element.appendChild(this._debugToolbarDrawer); | 996 vbox.element.appendChild(this._debugToolbarDrawer); |
1002 vbox.element.appendChild(this.debugToolbar); | 997 vbox.element.appendChild(this.debugToolbar); |
1003 vbox.element.appendChild(this.threadsToolbar.element); | 998 vbox.element.appendChild(this.threadsToolbar.element); |
| 999 vbox.setMinimumSize(WebInspector.SourcesPanel.minToolbarWidth, 25); |
1004 var sidebarPaneStack = new WebInspector.SidebarPaneStack(); | 1000 var sidebarPaneStack = new WebInspector.SidebarPaneStack(); |
1005 sidebarPaneStack.element.classList.add("flex-auto"); | 1001 sidebarPaneStack.element.classList.add("flex-auto"); |
1006 sidebarPaneStack.show(vbox.element); | 1002 sidebarPaneStack.show(vbox.element); |
1007 | 1003 |
1008 if (!vertically) { | 1004 if (!vertically) { |
1009 // Populate the only stack. | 1005 // Populate the only stack. |
1010 for (var pane in this.sidebarPanes) | 1006 for (var pane in this.sidebarPanes) |
1011 sidebarPaneStack.addPane(this.sidebarPanes[pane]); | 1007 sidebarPaneStack.addPane(this.sidebarPanes[pane]); |
1012 this._extensionSidebarPanesContainer = sidebarPaneStack; | 1008 this._extensionSidebarPanesContainer = sidebarPaneStack; |
1013 | 1009 |
1014 this.sidebarPaneView = vbox; | 1010 this.sidebarPaneView = vbox; |
1015 } else { | 1011 } else { |
1016 var splitView = new WebInspector.SplitView(true, true, "sourcesPanel
DebuggerSidebarSplitViewState", 0.5); | 1012 var splitView = new WebInspector.SplitView(true, true, "sourcesPanel
DebuggerSidebarSplitViewState", 0.5); |
1017 splitView.setMainElementConstraints(WebInspector.SourcesPanel.minToo
lbarWidth, 25); | |
1018 vbox.show(splitView.mainElement()); | 1013 vbox.show(splitView.mainElement()); |
1019 | 1014 |
1020 // Populate the left stack. | 1015 // Populate the left stack. |
1021 sidebarPaneStack.addPane(this.sidebarPanes.callstack); | 1016 sidebarPaneStack.addPane(this.sidebarPanes.callstack); |
1022 sidebarPaneStack.addPane(this.sidebarPanes.jsBreakpoints); | 1017 sidebarPaneStack.addPane(this.sidebarPanes.jsBreakpoints); |
1023 sidebarPaneStack.addPane(this.sidebarPanes.domBreakpoints); | 1018 sidebarPaneStack.addPane(this.sidebarPanes.domBreakpoints); |
1024 sidebarPaneStack.addPane(this.sidebarPanes.xhrBreakpoints); | 1019 sidebarPaneStack.addPane(this.sidebarPanes.xhrBreakpoints); |
1025 sidebarPaneStack.addPane(this.sidebarPanes.eventListenerBreakpoints)
; | 1020 sidebarPaneStack.addPane(this.sidebarPanes.eventListenerBreakpoints)
; |
1026 if (this.sidebarPanes.workerList) | 1021 if (this.sidebarPanes.workerList) |
1027 sidebarPaneStack.addPane(this.sidebarPanes.workerList); | 1022 sidebarPaneStack.addPane(this.sidebarPanes.workerList); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 WebInspector.SourcesPanel.UILocationRevealer.prototype = { | 1214 WebInspector.SourcesPanel.UILocationRevealer.prototype = { |
1220 /** | 1215 /** |
1221 * @param {!Object} uiLocation | 1216 * @param {!Object} uiLocation |
1222 */ | 1217 */ |
1223 reveal: function(uiLocation) | 1218 reveal: function(uiLocation) |
1224 { | 1219 { |
1225 if (uiLocation instanceof WebInspector.UILocation) | 1220 if (uiLocation instanceof WebInspector.UILocation) |
1226 /** @type {!WebInspector.SourcesPanel} */ (WebInspector.inspectorVie
w.panel("sources")).showUILocation(uiLocation); | 1221 /** @type {!WebInspector.SourcesPanel} */ (WebInspector.inspectorVie
w.panel("sources")).showUILocation(uiLocation); |
1227 } | 1222 } |
1228 } | 1223 } |
OLD | NEW |