Title: [118747] trunk/Source/WebCore
Revision
118747
Author
[email protected]
Date
2012-05-29 03:06:05 -0700 (Tue, 29 May 2012)

Log Message

Web Inspector: Tabbed Settings Screen
https://bugs.webkit.org/show_bug.cgi?id=87497

Patch by Eugene Klyuchnikov <[email protected]> on 2012-05-29
Reviewed by Yury Semikhatsky.

Combine settings screen and shortcuts screen
to a single tabbed settings screen.
This will make shortcuts screen more discoverable.

* inspector/front-end/HelpScreen.js:
(WebInspector.HelpScreen): Make titled tamplate optional.
(WebInspector.HelpScreen.prototype._createCloseButton): Extract method.
* inspector/front-end/SettingsScreen.js:
(WebInspector.SettingsScreen): Split initialization and UI construction.
(WebInspector.SettingsScreen.prototype._createSettingsTabView.appendSection):
(WebInspector.SettingsScreen.prototype._createSettingsTabView):
Extract GUI construction method.
(WebInspector.SettingsScreen.prototype._getOrCreateTabbedPane):
Make GUI construction lazy.
(WebInspector.SettingsScreen.prototype.selectTab):
Add method for external tab swithching.
(WebInspector.SettingsScreen.prototype.wasShown):
Make GUI construction lazy.
(WebInspector.SettingsScreenTabbedPane):
Extend class to access protected member.
(WebInspector.SettingsController.prototype._buttonClicked):
Change "showSettingsScreen" visibility and parameters.
(WebInspector.SettingsController.prototype._onHideSettingsScreen):
Preserve settings screen state.
(WebInspector.SettingsController.prototype.showSettingsScreen):
Change method visibility and parameters.
* inspector/front-end/ShortcutsScreen.js:
(WebInspector.ShortcutsScreen): Remove inheritance from HelpScreen.
(WebInspector.ShortcutsScreen.prototype._createShortcutsTabView):
Refactoring of GUI construction.
(WebInspector.ShortcutsSection.prototype.renderSection):
Ditto.
* inspector/front-end/helpScreen.css:
(.help-window-main ::-webkit-scrollbar): Rebind scrollbar settings.
(.help-window-main ::-webkit-resizer): Ditto.
(.help-window-main ::-webkit-scrollbar-thumb:vertical): Ditto.
(.help-window-main ::-webkit-scrollbar-thumb:vertical:active): Ditto.
(.help-window-main ::-webkit-scrollbar-track:vertical): Ditto.
(body:not(.compact) #settings-screen .tabbed-pane): Fix container height.
(#settings-screen .tabbed-pane-header): Ditto.
(#settings-screen .tabbed-pane-header-tabs): Adjust spacing.
(#settings-screen .tabbed-pane-header-tab): Adjust style.
(#settings-screen .help-close-button): Adjust spacing.
(#settings-screen .tabbed-pane-header-tab.selected):
Erase line below active tab.
(#settings-screen .tabbed-pane-content): Adjust spacing.
(#settings-screen .help-content): Ditto.
* inspector/front-end/inspector.js:
(WebInspector.documentKeyDown): Use Settings screen to show shortcuts.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (118746 => 118747)


--- trunk/Source/WebCore/ChangeLog	2012-05-29 09:43:13 UTC (rev 118746)
+++ trunk/Source/WebCore/ChangeLog	2012-05-29 10:06:05 UTC (rev 118747)
@@ -1,3 +1,60 @@
+2012-05-29  Eugene Klyuchnikov  <[email protected]>
+
+        Web Inspector: Tabbed Settings Screen
+        https://bugs.webkit.org/show_bug.cgi?id=87497
+
+        Reviewed by Yury Semikhatsky.
+
+        Combine settings screen and shortcuts screen
+        to a single tabbed settings screen.
+        This will make shortcuts screen more discoverable.
+
+        * inspector/front-end/HelpScreen.js:
+        (WebInspector.HelpScreen): Make titled tamplate optional.
+        (WebInspector.HelpScreen.prototype._createCloseButton): Extract method.
+        * inspector/front-end/SettingsScreen.js:
+        (WebInspector.SettingsScreen): Split initialization and UI construction.
+        (WebInspector.SettingsScreen.prototype._createSettingsTabView.appendSection):
+        (WebInspector.SettingsScreen.prototype._createSettingsTabView):
+        Extract GUI construction method.
+        (WebInspector.SettingsScreen.prototype._getOrCreateTabbedPane):
+        Make GUI construction lazy.
+        (WebInspector.SettingsScreen.prototype.selectTab):
+        Add method for external tab swithching.
+        (WebInspector.SettingsScreen.prototype.wasShown):
+        Make GUI construction lazy.
+        (WebInspector.SettingsScreenTabbedPane):
+        Extend class to access protected member.
+        (WebInspector.SettingsController.prototype._buttonClicked):
+        Change "showSettingsScreen" visibility and parameters.
+        (WebInspector.SettingsController.prototype._onHideSettingsScreen):
+        Preserve settings screen state.
+        (WebInspector.SettingsController.prototype.showSettingsScreen):
+        Change method visibility and parameters.
+        * inspector/front-end/ShortcutsScreen.js:
+        (WebInspector.ShortcutsScreen): Remove inheritance from HelpScreen.
+        (WebInspector.ShortcutsScreen.prototype._createShortcutsTabView):
+        Refactoring of GUI construction.
+        (WebInspector.ShortcutsSection.prototype.renderSection):
+        Ditto.
+        * inspector/front-end/helpScreen.css:
+        (.help-window-main ::-webkit-scrollbar): Rebind scrollbar settings.
+        (.help-window-main ::-webkit-resizer): Ditto.
+        (.help-window-main ::-webkit-scrollbar-thumb:vertical): Ditto.
+        (.help-window-main ::-webkit-scrollbar-thumb:vertical:active): Ditto.
+        (.help-window-main ::-webkit-scrollbar-track:vertical): Ditto.
+        (body:not(.compact) #settings-screen .tabbed-pane): Fix container height.
+        (#settings-screen .tabbed-pane-header): Ditto.
+        (#settings-screen .tabbed-pane-header-tabs): Adjust spacing.
+        (#settings-screen .tabbed-pane-header-tab): Adjust style.
+        (#settings-screen .help-close-button): Adjust spacing.
+        (#settings-screen .tabbed-pane-header-tab.selected):
+        Erase line below active tab.
+        (#settings-screen .tabbed-pane-content): Adjust spacing.
+        (#settings-screen .help-content): Ditto.
+        * inspector/front-end/inspector.js:
+        (WebInspector.documentKeyDown): Use Settings screen to show shortcuts.
+
 2012-05-29  Ilya Tikhonovsky  <[email protected]>
 
         Web Inspector: REGRESSION: load heap snapshot doesn't work.

Modified: trunk/Source/WebCore/inspector/front-end/HelpScreen.js (118746 => 118747)


--- trunk/Source/WebCore/inspector/front-end/HelpScreen.js	2012-05-29 09:43:13 UTC (rev 118746)
+++ trunk/Source/WebCore/inspector/front-end/HelpScreen.js	2012-05-29 10:06:05 UTC (rev 118747)
@@ -30,6 +30,7 @@
 
 /**
  * @constructor
+ * @param {string=} title
  * @extends {WebInspector.View}
  */
 WebInspector.HelpScreen = function(title)
@@ -42,14 +43,13 @@
     this.element.tabIndex = 0;
     this.element.addEventListener("focus", this._onBlur.bind(this), false);
 
-    var mainWindow = this.element.createChild("div", "help-window-main");
-    var captionWindow = mainWindow.createChild("div", "help-window-caption");
-    var closeButton = captionWindow.createChild("button", "help-close-button");
-    this.contentElement = mainWindow.createChild("div", "help-content");
-    captionWindow.createChild("h1", "help-window-title").textContent = title;
-
-    closeButton.textContent = "\u2716"; // Code stands for HEAVY MULTIPLICATION X.
-    closeButton.addEventListener("click", this.hide.bind(this), false);
+    if (title) {
+        var mainWindow = this.element.createChild("div", "help-window-main");
+        var captionWindow = mainWindow.createChild("div", "help-window-caption");
+        captionWindow.appendChild(this._createCloseButton());
+        this.contentElement = mainWindow.createChild("div", "help-content");
+        captionWindow.createChild("h1", "help-window-title").textContent = title;
+    }
 }
 
 /**
@@ -58,6 +58,15 @@
 WebInspector.HelpScreen._visibleScreen = null;
 
 WebInspector.HelpScreen.prototype = {
+    _createCloseButton: function()
+    {
+        var closeButton = document.createElement("button");
+        closeButton.className = "help-close-button";
+        closeButton.textContent = "\u2716"; // Code stands for HEAVY MULTIPLICATION X.
+        closeButton.addEventListener("click", this.hide.bind(this), false);
+        return closeButton;
+    },
+
     showModal: function()
     {
         var visibleHelpScreen = WebInspector.HelpScreen._visibleScreen;

Modified: trunk/Source/WebCore/inspector/front-end/SettingsScreen.js (118746 => 118747)


--- trunk/Source/WebCore/inspector/front-end/SettingsScreen.js	2012-05-29 09:43:13 UTC (rev 118746)
+++ trunk/Source/WebCore/inspector/front-end/SettingsScreen.js	2012-05-29 10:06:05 UTC (rev 118747)
@@ -35,99 +35,142 @@
  */
 WebInspector.SettingsScreen = function(onHide)
 {
-    WebInspector.HelpScreen.call(this, WebInspector.UIString("Settings"));
-    this.contentElement.id = "settings";
+    WebInspector.HelpScreen.call(this);
+    this.element.id = "settings-screen";
 
     /** @type {!function()} */
     this._onHide = onHide;
+}
 
-    var container = document.createElement("div");
-    container.className = "help-container";
+WebInspector.SettingsScreen.prototype = {
 
     /**
-     *  @param {string} name
-     *  @return {!Element}
+     * @return {!WebInspector.View}
      */
-    function appendSection(name) {
-        var block = container.createChild("div", "help-block");
-        block.createChild("div", "help-section-title").textContent = name;
-        return block;
-    }
+    _createSettingsTabView: function()
+    {
+        var view = new WebInspector.View();
 
-    var p = appendSection(WebInspector.UIString("General"));
-    if (Preferences.showDockToRight)
-        p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Dock to right"), WebInspector.settings.dockToRight));
-    if (Preferences.exposeDisableCache)
-        p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Disable cache"), WebInspector.settings.cacheDisabled));
-    var disableJSElement = this._createCheckboxSetting(WebInspector.UIString("Disable _javascript_"), WebInspector.settings._javascript_Disabled);
-    p.appendChild(disableJSElement);
-    WebInspector.settings._javascript_Disabled.addChangeListener(this._javaScriptDisabledChanged, this);
-    this._disableJSCheckbox = disableJSElement.getElementsByTagName("input")[0];
-    this._updateScriptDisabledCheckbox();
-    
-    p = appendSection(WebInspector.UIString("Rendering"));
-    p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show paint rectangles"), WebInspector.settings.showPaintRects));
-    WebInspector.settings.showPaintRects.addChangeListener(this._showPaintRectsChanged, this);
+        var container = view.element;
+        container.id = "settings";
+        container.className = "help-content help-container";
 
-    p = appendSection(WebInspector.UIString("Elements"));
-    p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Word wrap"), WebInspector.settings.domWordWrap));
+        /**
+         *  @param {string} name
+         *  @return {!Element}
+         */
+        function appendSection(name)
+        {
+            var block = container.createChild("div", "help-block");
+            block.createChild("div", "help-section-title").textContent = name;
+            return block;
+        }
 
-    p = appendSection(WebInspector.UIString("Styles"));
-    p.appendChild(this._createRadioSetting(WebInspector.UIString("Color format"), [
-        [ WebInspector.StylesSidebarPane.ColorFormat.Original, WebInspector.UIString("As authored") ],
-        [ WebInspector.StylesSidebarPane.ColorFormat.HEX, "HEX: #DAC0DE" ],
-        [ WebInspector.StylesSidebarPane.ColorFormat.RGB, "RGB: rgb(128, 255, 255)" ],
-        [ WebInspector.StylesSidebarPane.ColorFormat.HSL, "HSL: hsl(300, 80%, 90%)" ] ], WebInspector.settings.colorFormat));
-    p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show user agent styles"), WebInspector.settings.showUserAgentStyles));
+        var p = appendSection(WebInspector.UIString("General"));
+        if (Preferences.showDockToRight)
+            p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Dock to right"), WebInspector.settings.dockToRight));
+        if (Preferences.exposeDisableCache)
+            p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Disable cache"), WebInspector.settings.cacheDisabled));
+        var disableJSElement = this._createCheckboxSetting(WebInspector.UIString("Disable _javascript_"), WebInspector.settings._javascript_Disabled);
+        p.appendChild(disableJSElement);
+        WebInspector.settings._javascript_Disabled.addChangeListener(this._javaScriptDisabledChanged, this);
+        this._disableJSCheckbox = disableJSElement.getElementsByTagName("input")[0];
+        this._updateScriptDisabledCheckbox();
+        
+        p = appendSection(WebInspector.UIString("Rendering"));
+        p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show paint rectangles"), WebInspector.settings.showPaintRects));
+        WebInspector.settings.showPaintRects.addChangeListener(this._showPaintRectsChanged, this);
 
-    p = appendSection(WebInspector.UIString("Text editor"));
-    p.appendChild(this._createSelectSetting(WebInspector.UIString("Indent"), [
-            [ WebInspector.UIString("2 spaces"), WebInspector.TextEditorModel.Indent.TwoSpaces ],
-            [ WebInspector.UIString("4 spaces"), WebInspector.TextEditorModel.Indent.FourSpaces ],
-            [ WebInspector.UIString("8 spaces"), WebInspector.TextEditorModel.Indent.EightSpaces ],
-            [ WebInspector.UIString("Tab character"), WebInspector.TextEditorModel.Indent.TabCharacter ]
-        ], WebInspector.settings.textEditorIndent));
+        p = appendSection(WebInspector.UIString("Elements"));
+        p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Word wrap"), WebInspector.settings.domWordWrap));
 
-    p = appendSection(WebInspector.UIString("User Agent"));
-    p.appendChild(this._createUserAgentControl());
-    if (Capabilities.canOverrideDeviceMetrics)
-        p.appendChild(this._createDeviceMetricsControl());
-    p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Emulate touch events"), WebInspector.settings.emulateTouchEvents));
+        p = appendSection(WebInspector.UIString("Styles"));
+        p.appendChild(this._createRadioSetting(WebInspector.UIString("Color format"), [
+            [ WebInspector.StylesSidebarPane.ColorFormat.Original, WebInspector.UIString("As authored") ],
+            [ WebInspector.StylesSidebarPane.ColorFormat.HEX, "HEX: #DAC0DE" ],
+            [ WebInspector.StylesSidebarPane.ColorFormat.RGB, "RGB: rgb(128, 255, 255)" ],
+            [ WebInspector.StylesSidebarPane.ColorFormat.HSL, "HSL: hsl(300, 80%, 90%)" ] ], WebInspector.settings.colorFormat));
+        p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show user agent styles"), WebInspector.settings.showUserAgentStyles));
 
-    p = appendSection(WebInspector.UIString("Scripts"));
-    p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show script folders"), WebInspector.settings.showScriptFolders));
-    p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Search in content scripts"), WebInspector.settings.searchInContentScripts));
-    p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Enable source maps"), WebInspector.settings.sourceMapsEnabled));
+        p = appendSection(WebInspector.UIString("Text editor"));
+        p.appendChild(this._createSelectSetting(WebInspector.UIString("Indent"), [
+                [ WebInspector.UIString("2 spaces"), WebInspector.TextEditorModel.Indent.TwoSpaces ],
+                [ WebInspector.UIString("4 spaces"), WebInspector.TextEditorModel.Indent.FourSpaces ],
+                [ WebInspector.UIString("8 spaces"), WebInspector.TextEditorModel.Indent.EightSpaces ],
+                [ WebInspector.UIString("Tab character"), WebInspector.TextEditorModel.Indent.TabCharacter ]
+            ], WebInspector.settings.textEditorIndent));
 
-    p = appendSection(WebInspector.UIString("Profiler"));
-    p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show objects' hidden properties"), WebInspector.settings.showHeapSnapshotObjectsHiddenProperties));
+        p = appendSection(WebInspector.UIString("User Agent"));
+        p.appendChild(this._createUserAgentControl());
+        if (Capabilities.canOverrideDeviceMetrics)
+            p.appendChild(this._createDeviceMetricsControl());
+        p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Emulate touch events"), WebInspector.settings.emulateTouchEvents));
 
-    p = appendSection(WebInspector.UIString("Console"));
-    p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Log XMLHttpRequests"), WebInspector.settings.monitoringXHREnabled));
-    p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Preserve log upon navigation"), WebInspector.settings.preserveConsoleLog));
+        p = appendSection(WebInspector.UIString("Scripts"));
+        p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show script folders"), WebInspector.settings.showScriptFolders));
+        p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Search in content scripts"), WebInspector.settings.searchInContentScripts));
+        p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Enable source maps"), WebInspector.settings.sourceMapsEnabled));
 
-    if (WebInspector.extensionServer.hasExtensions()) {
-        var handlerSelector = new WebInspector.HandlerSelector(WebInspector.openAnchorLocationRegistry);
-        p = appendSection(WebInspector.UIString("Extensions"));
-        p.appendChild(this._createCustomSetting(WebInspector.UIString("Open links in"), handlerSelector.element));
-    }
+        p = appendSection(WebInspector.UIString("Profiler"));
+        p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show objects' hidden properties"), WebInspector.settings.showHeapSnapshotObjectsHiddenProperties));
 
-    var experiments = WebInspector.experimentsSettings.experiments;
-    if (WebInspector.experimentsSettings.experimentsEnabled && experiments.length) {
-        var experimentsSection = appendSection(WebInspector.UIString("Experiments"));
-        experimentsSection.appendChild(this._createExperimentsWarningSubsection());
-        for (var i = 0; i < experiments.length; ++i)
-            experimentsSection.appendChild(this._createExperimentCheckbox(experiments[i]));
-    }
+        p = appendSection(WebInspector.UIString("Console"));
+        p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Log XMLHttpRequests"), WebInspector.settings.monitoringXHREnabled));
+        p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Preserve log upon navigation"), WebInspector.settings.preserveConsoleLog));
 
-    this.contentElement.appendChild(container);
-}
+        if (WebInspector.extensionServer.hasExtensions()) {
+            var handlerSelector = new WebInspector.HandlerSelector(WebInspector.openAnchorLocationRegistry);
+            p = appendSection(WebInspector.UIString("Extensions"));
+            p.appendChild(this._createCustomSetting(WebInspector.UIString("Open links in"), handlerSelector.element));
+        }
 
-WebInspector.SettingsScreen.prototype = {
+        var experiments = WebInspector.experimentsSettings.experiments;
+        if (WebInspector.experimentsSettings.experimentsEnabled && experiments.length) {
+            var experimentsSection = appendSection(WebInspector.UIString("Experiments"));
+            experimentsSection.appendChild(this._createExperimentsWarningSubsection());
+            for (var i = 0; i < experiments.length; ++i)
+                experimentsSection.appendChild(this._createExperimentCheckbox(experiments[i]));
+        }
 
+        return view;
+    },
+
     /**
+     * return {!WebInspector.SettingsScreenTabbedPane}
+     */
+    _getOrCreateTabbedPane: function()
+    {
+        if (this._tabbedPane)
+            return this._tabbedPane;
+
+        var tabbedPane = new WebInspector.SettingsScreenTabbedPane(this._createCloseButton());
+        tabbedPane.appendTab(WebInspector.SettingsScreen.Tabs.Settings, WebInspector.UIString("Settings"), this._createSettingsTabView());
+        tabbedPane.appendTab(WebInspector.SettingsScreen.Tabs.Shortcuts, WebInspector.UIString("Keyboard Shortcuts"), WebInspector.shortcutsScreen._createShortcutsTabView());
+
+        this._tabbedPane = tabbedPane;
+        return tabbedPane;
+    },
+
+    /**
+     * @param {!string} tabId
+     */
+    selectTab: function(tabId)
+    {
+        this._getOrCreateTabbedPane().selectTab(tabId);
+    },
+
+    /**
      * @override
      */
+    wasShown: function()
+    {
+        this._getOrCreateTabbedPane().show(this.element);
+        WebInspector.HelpScreen.prototype.wasShown.call(this);
+    },
+
+    /**
+     * @override
+     */
     isClosingKey: function(keyCode)
     {
         return [
@@ -592,9 +635,29 @@
 
 WebInspector.SettingsScreen.prototype.__proto__ = WebInspector.HelpScreen.prototype;
 
+WebInspector.SettingsScreen.Tabs = {
+    Settings: "Settings",
+    Shortcuts: "Shortcuts"
+}
+
 /**
  * @constructor
+ * @extends {WebInspector.TabbedPane}
+ * @param {!Element} closeButton
  */
+WebInspector.SettingsScreenTabbedPane = function(closeButton)
+{
+    WebInspector.TabbedPane.call(this);
+    this.element.addStyleClass("help-window-main");
+
+    this._headerContentsElement.insertBefore(closeButton, this._headerContentsElement.firstChild);
+}
+
+WebInspector.SettingsScreenTabbedPane.prototype.__proto__ = WebInspector.TabbedPane.prototype;
+
+/**
+ * @constructor
+ */
 WebInspector.SettingsController = function()
 {
     this._statusBarButton = new WebInspector.StatusBarButton(WebInspector.UIString("Settings"), "settings-status-bar-item");;
@@ -616,20 +679,25 @@
         if (this._statusBarButton.toggled)
             this._hideSettingsScreen();
         else
-            this._showSettingsScreen();
+            this.showSettingsScreen();
     },
 
     _onHideSettingsScreen: function()
     {
         this._statusBarButton.toggled = false;
-        delete this._settingsScreen;
     },
 
-    _showSettingsScreen: function()
+    /**
+     * @param {tabId=}
+     */
+    showSettingsScreen: function(tabId)
     {
         if (!this._settingsScreen)
             this._settingsScreen = new WebInspector.SettingsScreen(this._onHideSettingsScreen.bind(this));
 
+        if (tabId)
+            this._settingsScreen.selectTab(tabId);
+
         this._settingsScreen.showModal();
         this._statusBarButton.toggled = true;
     },

Modified: trunk/Source/WebCore/inspector/front-end/ShortcutsScreen.js (118746 => 118747)


--- trunk/Source/WebCore/inspector/front-end/ShortcutsScreen.js	2012-05-29 09:43:13 UTC (rev 118746)
+++ trunk/Source/WebCore/inspector/front-end/ShortcutsScreen.js	2012-05-29 10:06:05 UTC (rev 118747)
@@ -30,13 +30,10 @@
 
 /**
  * @constructor
- * @extends {WebInspector.HelpScreen}
  */
 WebInspector.ShortcutsScreen = function()
 {
-    WebInspector.HelpScreen.call(this, WebInspector.UIString("Keyboard Shortcuts"));
     this._sections = {};
-    this._tableReady = false;
 }
 
 WebInspector.ShortcutsScreen.prototype = {
@@ -48,24 +45,8 @@
         return section;
     },
 
-    /**
-     * @override
-     */
-    wasShown: function()
+    _createShortcutsTabView: function()
     {
-        this._buildTable(this.contentElement);
-        WebInspector.HelpScreen.prototype.wasShown.call(this);
-    },
-
-    /**
-     * @param parent{Node}
-     */
-    _buildTable: function(parent)
-    {
-        if (this._tableReady)
-            return;
-        this._tableReady = true;
-
         var orderedSections = [];
         for (var section in this._sections)
             orderedSections.push(this._sections[section]);
@@ -75,16 +56,17 @@
         }
         orderedSections.sort(compareSections);
 
-        var container = document.createElement("div");
-        container.className = "help-container";
+        var view = new WebInspector.View();
+
+        var container = view.element;
+        container.className = "help-content help-container";
         for (var i = 0; i < orderedSections.length; ++i)
             orderedSections[i].renderSection(container);
-        parent.appendChild(container);
+
+        return view;
     }
 }
 
-WebInspector.ShortcutsScreen.prototype.__proto__ = WebInspector.HelpScreen.prototype;
-
 /**
  * We cannot initialize it here as localized strings are not loaded yet.
  * @type {?WebInspector.ShortcutsScreen}
@@ -130,8 +112,11 @@
     renderSection: function(container)
     {
         var parent = container.createChild("div", "help-block");
-        this._renderHeader(parent);
 
+        var headLine = parent.createChild("div", "help-line");
+        headLine.createChild("div", "help-key-cell");
+        headLine.createChild("div", "help-section-title help-cell").textContent = this.name;
+
         for (var i = 0; i < this._lines.length; ++i) {
             var line = parent.createChild("div", "help-line");
             var keyCell = line.createChild("div", "help-key-cell");
@@ -141,13 +126,6 @@
         }
     },
 
-    _renderHeader: function(parent)
-    {
-        var line = parent.createChild("div", "help-line");
-        line.createChild("div", "help-key-cell");
-        line.createChild("div", "help-section-title help-cell").textContent = this.name;
-    },
-
     _renderSequence: function(sequence, delimiter)
     {
         var delimiterSpan = this._createSpan("help-key-delimiter", delimiter);

Modified: trunk/Source/WebCore/inspector/front-end/helpScreen.css (118746 => 118747)


--- trunk/Source/WebCore/inspector/front-end/helpScreen.css	2012-05-29 09:43:13 UTC (rev 118746)
+++ trunk/Source/WebCore/inspector/front-end/helpScreen.css	2012-05-29 10:06:05 UTC (rev 118747)
@@ -51,27 +51,27 @@
     font-size: 13px;
 }
 
-.help-content::-webkit-scrollbar {
+.help-window-main ::-webkit-scrollbar {
     width: 11px;
 }
 
-.help-content::-webkit-scrollbar-corner,
-.help-content::-webkit-resizer {
+.help-window-main ::-webkit-scrollbar-corner,
+.help-window-main ::-webkit-resizer {
     display: none;
 }
 
-.help-content::-webkit-scrollbar-thumb:vertical {
+.help-window-main ::-webkit-scrollbar-thumb:vertical {
     background: -webkit-gradient(linear, left top, right top, from(rgb(128, 128, 128)), to(rgb(128, 128, 128)), color-stop(40%, rgb(96, 96, 96)));
     border-radius: 5px;
     min-height: 20px;
 }
 
-.help-content::-webkit-scrollbar-thumb:vertical:hover,
-.help-content::-webkit-scrollbar-thumb:vertical:active {
+.help-window-main ::-webkit-scrollbar-thumb:vertical:hover,
+.help-window-main ::-webkit-scrollbar-thumb:vertical:active {
     background: -webkit-gradient(linear, left top, right top, from(rgb(176, 176, 176)), to(rgb(176, 176, 176)), color-stop(40%, rgb(144, 144, 144)));
 }
 
-.help-content::-webkit-scrollbar-track:vertical {
+.help-window-main ::-webkit-scrollbar-track:vertical {
     background: -webkit-gradient(linear, left top, right top, from(rgb(10, 10, 10)), to(rgb(32, 32, 32)), color-stop(25%, rgb(32, 32, 32)));
     border-radius: 5px;
 }
@@ -118,7 +118,7 @@
     padding-bottom: 9px;
 }
 
-#settings .help-container {
+#settings.help-container {
     -webkit-column-width: 240px;
 }
 
@@ -226,3 +226,46 @@
     background-color: black;
     color: white;
 }
+
+body:not(.compact) #settings-screen .tabbed-pane {
+    height: auto;
+}
+
+#settings-screen .tabbed-pane-header {
+    height: auto;
+}
+
+#settings-screen .tabbed-pane-header-tabs {
+    padding-top: 9px;
+}
+
+#settings-screen .tabbed-pane-header-tab {
+    background-color: transparent;
+    position: relative;
+    top: 1px;
+    text-shadow: none;
+    color: rgb(255, 255, 255);
+    height: 19px;
+    font-size: 13px;
+    padding: 0 4px;
+    margin: 0;
+}
+
+#settings-screen .help-close-button {
+    margin: 6px 0;
+}
+
+#settings-screen .tabbed-pane-header-tab.selected {
+    border-bottom: solid 1px rgb(51, 51, 51);
+    border-bottom-right-radius: 2px;
+}
+
+#settings-screen .tabbed-pane-content {
+    margin: 8px;
+    padding: 0 4px;
+}
+
+#settings-screen .help-content {
+    margin: 0;
+    padding: 0;
+}

Modified: trunk/Source/WebCore/inspector/front-end/inspector.js (118746 => 118747)


--- trunk/Source/WebCore/inspector/front-end/inspector.js	2012-05-29 09:43:13 UTC (rev 118746)
+++ trunk/Source/WebCore/inspector/front-end/inspector.js	2012-05-29 10:06:05 UTC (rev 118747)
@@ -706,7 +706,7 @@
 
     if (event.keyIdentifier === "F1" ||
         (event.keyIdentifier === helpKey && event.shiftKey && (!WebInspector.isBeingEdited(event.target) || event.metaKey))) {
-        WebInspector.shortcutsScreen.showModal();
+        this.settingsController.showSettingsScreen(WebInspector.SettingsScreen.Tabs.Shortcuts);
         event.consume(true);
         return;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to