Web Inspector: add keyboard shortcut to tooltip of pinned tabs
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Mar 2020 03:07:25 +0000 (03:07 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Mar 2020 03:07:25 +0000 (03:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=209640

Reviewed by Timothy Hatcher.

* UserInterface/Views/TabBarItem.js:
(WI.TabBarItem):
(WI.TabBarItem.prototype.get displayName): Added.
(WI.TabBarItem.prototype.set displayName): Added.
(WI.TabBarItem.prototype.set title):
(WI.TabBarItem.prototype.titleDidChange): Deleted.
* UserInterface/Views/GeneralTabBarItem.js:
(WI.GeneralTabBarItem.fromTabContentView):
(WI.GeneralTabBarItem.prototype.get displayName): Added.
(WI.GeneralTabBarItem.prototype.set displayName): Added.
(WI.GeneralTabBarItem.prototype.get title): Deleted.
(WI.GeneralTabBarItem.prototype.set title): Deleted.
* UserInterface/Views/PinnedTabBarItem.js:
(WI.PinnedTabBarItem):
(WI.PinnedTabBarItem.fromTabContentView):
(WI.PinnedTabBarItem.titleDidChange): Deleted.
* UserInterface/Views/TabBar.css:
(.tab-bar > .tabs > .item > .name): Added.
(body.window-inactive .tab-bar > .tabs > .item > .name): Added.
(.tab-bar > .tabs > .item > .name > .content): Added.
(.tab-bar > .tabs > .item:not(.selected):hover > .name): Added.
(.tab-bar > .tabs > .item:not(.disabled).selected > .name): Added.
(body.window-inactive .tab-bar > .tabs > .item:not(.disabled).selected > .name): Added.
(.tab-bar > .tabs > .item > .title): Deleted.
(body.window-inactive .tab-bar > .tabs > .item > .title): Deleted.
(.tab-bar > .tabs > .item > .title > .content): Deleted.
(.tab-bar > .tabs > .item:not(.selected):hover > .title): Deleted.
(.tab-bar > .tabs > .item:not(.disabled).selected > .title): Deleted.
(body.window-inactive .tab-bar > .tabs > .item:not(.disabled).selected > .title): Deleted.
Separate the shown name of the tab (`displayName`) from the tooltip text (`title`).

* UserInterface/Views/SearchTabContentView.js:
(WI.SearchTabContentView.tabInfo):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.tabInfo):
Move the current `title` value to `displayName` and add a new `title` value with the
keyboard shortcut in parenthesis.

* UserInterface/Views/AuditTabContentView.js:
(WI.AuditTabContentView.tabInfo):
* UserInterface/Views/ConsoleTabContentView.js:
(WI.ConsoleTabContentView.tabInfo):
* UserInterface/Views/ElementsTabContentView.js:
(WI.ElementsTabContentView.tabInfo):
* UserInterface/Views/GraphicsTabContentView.js:
(WI.GraphicsTabContentView.tabInfo):
* UserInterface/Views/LayersTabContentView.js:
(WI.LayersTabContentView.tabInfo):
* UserInterface/Views/NetworkTabContentView.js:
(WI.NetworkTabContentView.tabInfo):
* UserInterface/Views/SourcesTabContentView.js:
(WI.SourcesTabContentView.tabInfo):
* UserInterface/Views/StorageTabContentView.js:
(WI.StorageTabContentView.tabInfo):
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView.tabInfo):
Use `displayName` instead of `title` since the name is shown in the UI.

* UserInterface/Base/Main.js:
(WI.contentLoaded):
Make the Settings Tab shortcut public.

* Localizations/en.lproj/localizedStrings.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259101 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Views/AuditTabContentView.js
Source/WebInspectorUI/UserInterface/Views/ConsoleTabContentView.js
Source/WebInspectorUI/UserInterface/Views/ElementsTabContentView.js
Source/WebInspectorUI/UserInterface/Views/GeneralTabBarItem.js
Source/WebInspectorUI/UserInterface/Views/GraphicsTabContentView.js
Source/WebInspectorUI/UserInterface/Views/LayersTabContentView.js
Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js
Source/WebInspectorUI/UserInterface/Views/PinnedTabBarItem.js
Source/WebInspectorUI/UserInterface/Views/SearchTabContentView.js
Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js
Source/WebInspectorUI/UserInterface/Views/SourcesTabContentView.js
Source/WebInspectorUI/UserInterface/Views/StorageTabContentView.js
Source/WebInspectorUI/UserInterface/Views/TabBar.css
Source/WebInspectorUI/UserInterface/Views/TabBarItem.js
Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js

index c52c1ec..bb191c4 100644 (file)
@@ -1,3 +1,74 @@
+2020-03-26  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: add keyboard shortcut to tooltip of pinned tabs
+        https://bugs.webkit.org/show_bug.cgi?id=209640
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/TabBarItem.js:
+        (WI.TabBarItem):
+        (WI.TabBarItem.prototype.get displayName): Added.
+        (WI.TabBarItem.prototype.set displayName): Added.
+        (WI.TabBarItem.prototype.set title):
+        (WI.TabBarItem.prototype.titleDidChange): Deleted.
+        * UserInterface/Views/GeneralTabBarItem.js:
+        (WI.GeneralTabBarItem.fromTabContentView):
+        (WI.GeneralTabBarItem.prototype.get displayName): Added.
+        (WI.GeneralTabBarItem.prototype.set displayName): Added.
+        (WI.GeneralTabBarItem.prototype.get title): Deleted.
+        (WI.GeneralTabBarItem.prototype.set title): Deleted.
+        * UserInterface/Views/PinnedTabBarItem.js:
+        (WI.PinnedTabBarItem):
+        (WI.PinnedTabBarItem.fromTabContentView):
+        (WI.PinnedTabBarItem.titleDidChange): Deleted.
+        * UserInterface/Views/TabBar.css:
+        (.tab-bar > .tabs > .item > .name): Added.
+        (body.window-inactive .tab-bar > .tabs > .item > .name): Added.
+        (.tab-bar > .tabs > .item > .name > .content): Added.
+        (.tab-bar > .tabs > .item:not(.selected):hover > .name): Added.
+        (.tab-bar > .tabs > .item:not(.disabled).selected > .name): Added.
+        (body.window-inactive .tab-bar > .tabs > .item:not(.disabled).selected > .name): Added.
+        (.tab-bar > .tabs > .item > .title): Deleted.
+        (body.window-inactive .tab-bar > .tabs > .item > .title): Deleted.
+        (.tab-bar > .tabs > .item > .title > .content): Deleted.
+        (.tab-bar > .tabs > .item:not(.selected):hover > .title): Deleted.
+        (.tab-bar > .tabs > .item:not(.disabled).selected > .title): Deleted.
+        (body.window-inactive .tab-bar > .tabs > .item:not(.disabled).selected > .title): Deleted.
+        Separate the shown name of the tab (`displayName`) from the tooltip text (`title`).
+
+        * UserInterface/Views/SearchTabContentView.js:
+        (WI.SearchTabContentView.tabInfo):
+        * UserInterface/Views/SettingsTabContentView.js:
+        (WI.SettingsTabContentView.tabInfo):
+        Move the current `title` value to `displayName` and add a new `title` value with the
+        keyboard shortcut in parenthesis.
+
+        * UserInterface/Views/AuditTabContentView.js:
+        (WI.AuditTabContentView.tabInfo):
+        * UserInterface/Views/ConsoleTabContentView.js:
+        (WI.ConsoleTabContentView.tabInfo):
+        * UserInterface/Views/ElementsTabContentView.js:
+        (WI.ElementsTabContentView.tabInfo):
+        * UserInterface/Views/GraphicsTabContentView.js:
+        (WI.GraphicsTabContentView.tabInfo):
+        * UserInterface/Views/LayersTabContentView.js:
+        (WI.LayersTabContentView.tabInfo):
+        * UserInterface/Views/NetworkTabContentView.js:
+        (WI.NetworkTabContentView.tabInfo):
+        * UserInterface/Views/SourcesTabContentView.js:
+        (WI.SourcesTabContentView.tabInfo):
+        * UserInterface/Views/StorageTabContentView.js:
+        (WI.StorageTabContentView.tabInfo):
+        * UserInterface/Views/TimelineTabContentView.js:
+        (WI.TimelineTabContentView.tabInfo):
+        Use `displayName` instead of `title` since the name is shown in the UI.
+
+        * UserInterface/Base/Main.js:
+        (WI.contentLoaded):
+        Make the Settings Tab shortcut public.
+
+        * Localizations/en.lproj/localizedStrings.js:
+
 2020-03-26  Nikita Vasilyev  <nvasilyev@apple.com>
 
         Web Inspector: RTL: ArrowLeft and ArrowRight keys select wrong navigation bar items
index bef84a4..2151526 100644 (file)
@@ -165,8 +165,9 @@ localizedStrings["Attribute"] = "Attribute";
 /* A submenu item of 'Break On' that breaks (pauses) before DOM attribute is modified */
 localizedStrings["Attribute Modified"] = "Attribute Modified";
 localizedStrings["Attributes"] = "Attributes";
-localizedStrings["Audit"] = "Audit";
 localizedStrings["Audit Error: %s"] = "Audit Error: %s";
+/* Name of Audit Tab */
+localizedStrings["Audit Tab Name"] = "Audit";
 localizedStrings["Audit Warning: %s"] = "Audit Warning: %s";
 localizedStrings["Audit version: %s"] = "Audit version: %s";
 localizedStrings["Audits"] = "Audits";
@@ -316,6 +317,8 @@ localizedStrings["Console"] = "Console";
 localizedStrings["Console Evaluation"] = "Console Evaluation";
 localizedStrings["Console Evaluation %d"] = "Console Evaluation %d";
 localizedStrings["Console Profile Recorded"] = "Console Profile Recorded";
+/* Name of Console Tab */
+localizedStrings["Console Tab Name"] = "Console";
 localizedStrings["Console cleared at %s"] = "Console cleared at %s";
 localizedStrings["Console opened at %s"] = "Console opened at %s";
 localizedStrings["Console prompt"] = "Console prompt";
@@ -480,6 +483,8 @@ localizedStrings["Element is the root element"] = "Element is the root element";
 localizedStrings["Element may overlap another compositing element"] = "Element may overlap another compositing element";
 localizedStrings["Element overlaps other compositing element"] = "Element overlaps other compositing element";
 localizedStrings["Elements"] = "Elements";
+/* Name of Elements Tab */
+localizedStrings["Elements Tab Name"] = "Elements";
 localizedStrings["Emulate User Gesture"] = "Emulate User Gesture";
 localizedStrings["Enable Breakpoint"] = "Enable Breakpoint";
 localizedStrings["Enable Breakpoints"] = "Enable Breakpoints";
@@ -605,7 +610,8 @@ localizedStrings["Global Code"] = "Global Code";
 localizedStrings["Global Lexical Environment"] = "Global Lexical Environment";
 localizedStrings["Global Variables"] = "Global Variables";
 localizedStrings["Grammar"] = "Grammar";
-localizedStrings["Graphics"] = "Graphics";
+/* Name of Graphics Tab */
+localizedStrings["Graphics Tab Name"] = "Graphics";
 localizedStrings["Group"] = "Group";
 localizedStrings["Group By Resource"] = "Group By Resource";
 localizedStrings["Group Media Requests"] = "Group Media Requests";
@@ -698,6 +704,8 @@ localizedStrings["Latency"] = "Latency";
 localizedStrings["Layer Count: %d"] = "Layer Count: %d";
 localizedStrings["Layer Info"] = "Layer Info";
 localizedStrings["Layers"] = "Layers";
+/* Name of Layers Tab */
+localizedStrings["Layers Tab Name"] = "Layers";
 localizedStrings["Layout & Rendering"] = "Layout & Rendering";
 /* Layout phase timeline records */
 localizedStrings["Layout @ Timeline record"] = "Layout";
@@ -779,6 +787,8 @@ localizedStrings["Network"] = "Network";
 localizedStrings["Network Issue"] = "Network Issue";
 localizedStrings["Network Requests"] = "Network Requests";
 localizedStrings["Network Requests:"] = "Network Requests:";
+/* Name of Network Tab */
+localizedStrings["Network Tab Name"] = "Network";
 /* A submenu item of 'Add' to add DOM nodes after the selected DOM node */
 localizedStrings["Next Sibling"] = "Next Sibling";
 localizedStrings["No"] = "No";
@@ -1043,6 +1053,10 @@ localizedStrings["Scroll into View"] = "Scroll into View";
 localizedStrings["Search"] = "Search";
 localizedStrings["Search Again"] = "Search Again";
 localizedStrings["Search Resource Content"] = "Search Resource Content";
+/* Name of Search Tab */
+localizedStrings["Search Tab Name"] = "Search";
+/* Title of Search Tab with keyboard shortcut */
+localizedStrings["Search Tab Title"] = "Search (%s)";
 /* Settings tab label for search related settings */
 localizedStrings["Search: @ Settings"] = "Search:";
 localizedStrings["Searching %s"] = "Searching %s";
@@ -1077,7 +1091,10 @@ localizedStrings["Session"] = "Session";
 localizedStrings["Session Storage"] = "Session Storage";
 localizedStrings["Set to Automatically Continue"] = "Set to Automatically Continue";
 localizedStrings["Setter"] = "Setter";
-localizedStrings["Settings"] = "Settings";
+/* Name of Settings Tab */
+localizedStrings["Settings Tab Name"] = "Settings";
+/* Title of Settings Tab with keyboard shortcut */
+localizedStrings["Settings Tab Title"] = "Settings (%s)";
 localizedStrings["Shader Programs"] = "Shader Programs";
 localizedStrings["Shadow Content"] = "Shadow Content";
 localizedStrings["Shadow Content (%s)"] = "Shadow Content (%s)";
@@ -1123,6 +1140,8 @@ localizedStrings["Sort Descending"] = "Sort Descending";
 localizedStrings["Source"] = "Source";
 localizedStrings["Source Maps:"] = "Source Maps:";
 localizedStrings["Sources"] = "Sources";
+/* Name of Sources Tab */
+localizedStrings["Sources Tab Name"] = "Sources";
 localizedStrings["Space"] = "Space";
 localizedStrings["Spaces"] = "Spaces";
 localizedStrings["Specially Exposed Data"] = "Specially Exposed Data";
@@ -1155,6 +1174,8 @@ localizedStrings["Stop recording canvas actions"] = "Stop recording canvas actio
 localizedStrings["Stop recording once page loads"] = "Stop recording once page loads";
 localizedStrings["Stopping the \u201C%s\u201D audit"] = "Stopping the \u201C%s\u201D audit";
 localizedStrings["Storage"] = "Storage";
+/* Name of Storage Tab */
+localizedStrings["Storage Tab Name"] = "Storage";
 /* CSS properties defined via HTML style attribute */
 localizedStrings["Style Attribute"] = "Style Attribute";
 localizedStrings["Style Sheet"] = "Style Sheet";
@@ -1242,7 +1263,8 @@ localizedStrings["Time to First Byte"] = "Time to First Byte";
 localizedStrings["Timeline"] = "Timeline";
 localizedStrings["Timeline Recording %d"] = "Timeline Recording %d";
 localizedStrings["Timeline Recording Import Error: %s"] = "Timeline Recording Import Error: %s";
-localizedStrings["Timelines"] = "Timelines";
+/* Name of Timelines Tab */
+localizedStrings["Timelines Tab Name"] = "Timelines";
 localizedStrings["Timer %d Fired"] = "Timer %d Fired";
 localizedStrings["Timer %d Installed"] = "Timer %d Installed";
 localizedStrings["Timer %d Removed"] = "Timer %d Removed";
index c8f5ee4..97263bf 100644 (file)
@@ -362,7 +362,7 @@ WI.contentLoaded = function()
     WI.stepIntoAlternateKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.CommandOrControl, WI.KeyboardShortcut.Key.Semicolon, WI.debuggerStepInto);
     WI.stepOutAlternateKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.Shift | WI.KeyboardShortcut.Modifier.CommandOrControl, WI.KeyboardShortcut.Key.Semicolon, WI.debuggerStepOut);
 
-    WI._settingsKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.CommandOrControl, WI.KeyboardShortcut.Key.Comma, WI._handleSettingsKeyboardShortcut);
+    WI.settingsKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.CommandOrControl, WI.KeyboardShortcut.Key.Comma, WI._handleSettingsKeyboardShortcut);
 
     WI._togglePreviousDockConfigurationKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.CommandOrControl | WI.KeyboardShortcut.Modifier.Shift, "D", WI._togglePreviousDockConfiguration);
 
index 532d0c3..c8a6830 100644 (file)
@@ -43,7 +43,7 @@ WI.AuditTabContentView = class AuditTabContentView extends WI.ContentBrowserTabC
         return {
             identifier: AuditTabContentView.Type,
             image: "Images/Audit.svg",
-            title: WI.UIString("Audit"),
+            displayName: WI.UIString("Audit", "Audit Tab Name", "Name of Audit Tab"),
         };
     }
 
index f68a9fa..123ad25 100644 (file)
@@ -35,7 +35,7 @@ WI.ConsoleTabContentView = class ConsoleTabContentView extends WI.ContentBrowser
         return {
             identifier: ConsoleTabContentView.Type,
             image: "Images/Console.svg",
-            title: WI.UIString("Console"),
+            displayName: WI.UIString("Console", "Console Tab Name", "Name of Console Tab"),
         };
     }
 
index ff21cf0..41f2dba 100644 (file)
@@ -47,7 +47,7 @@ WI.ElementsTabContentView = class ElementsTabContentView extends WI.ContentBrows
         return {
             identifier: ElementsTabContentView.Type,
             image: "Images/Elements.svg",
-            title: WI.UIString("Elements"),
+            displayName: WI.UIString("Elements", "Elements Tab Name", "Name of Elements Tab"),
         };
     }
 
index e0fc288..306e718 100644 (file)
@@ -32,36 +32,35 @@ WI.GeneralTabBarItem = class GeneralTabBarItem extends WI.TabBarItem
     {
         console.assert(tabContentView instanceof WI.TabContentView);
 
-        let {image, title} = tabContentView.constructor.tabInfo();
-        return new WI.GeneralTabBarItem(tabContentView, image, title);
+        let {image, displayName, title} = tabContentView.constructor.tabInfo();
+        return new WI.GeneralTabBarItem(tabContentView, image, displayName, title);
     }
 
     // Public
 
-    get title()
+    get displayName()
     {
-        return super.title;
+        return super.displayName;
     }
 
-    set title(title)
+    set displayName(displayName)
     {
-        if (title) {
-            this._titleElement = document.createElement("span");
-            this._titleElement.classList.add("title");
+        if (displayName) {
+            this._displayNameElement = document.createElement("span");
+            this._displayNameElement.className = "name";
 
-            let titleContentElement = document.createElement("span");
-            titleContentElement.classList.add("content");
-            titleContentElement.textContent = title;
-            this._titleElement.appendChild(titleContentElement);
+            let displayNameContentElement = this._displayNameElement.appendChild(document.createElement("span"));
+            displayNameContentElement.className = "content";
+            displayNameContentElement.textContent = displayName;
 
-            this.element.insertBefore(this._titleElement, this.element.lastChild);
+            this.element.insertBefore(this._displayNameElement, this.element.lastChild);
         } else {
-            if (this._titleElement)
-                this._titleElement.remove();
+            if (this._displayNameElement)
+                this._displayNameElement.remove();
 
-            this._titleElement = null;
+            this._displayNameElement = null;
         }
 
-        super.title = title;
+        super.displayName = displayName;
     }
 };
index cc029e3..3b20a77 100644 (file)
@@ -66,7 +66,7 @@ WI.GraphicsTabContentView = class GraphicsTabContentView extends WI.ContentBrows
         return {
             identifier: GraphicsTabContentView.Type,
             image: "Images/Graphics.svg",
-            title: WI.UIString("Graphics"),
+            displayName: WI.UIString("Graphics", "Graphics Tab Name", "Name of Graphics Tab"),
         };
     }
 
index 2bc0c9b..348633d 100644 (file)
@@ -45,7 +45,7 @@ WI.LayersTabContentView = class LayersTabContentView extends WI.ContentBrowserTa
         return {
             identifier: LayersTabContentView.Type,
             image: "Images/Layers.svg",
-            title: WI.UIString("Layers"),
+            displayName: WI.UIString("Layers", "Layers Tab Name", "Name of Layers Tab"),
         };
     }
 
index 65110ac..7b16c08 100644 (file)
@@ -50,7 +50,7 @@ WI.NetworkTabContentView = class NetworkTabContentView extends WI.TabContentView
         return {
             identifier: NetworkTabContentView.Type,
             image: "Images/Network.svg",
-            title: WI.UIString("Network"),
+            displayName: WI.UIString("Network", "Network Tab Name", "Name of Network Tab"),
         };
     }
 
index d58203b..342c679 100644 (file)
@@ -25,9 +25,9 @@
 
 WI.PinnedTabBarItem = class PinnedTabBarItem extends WI.TabBarItem
 {
-    constructor(representedObject, image, title)
+    constructor(representedObject, image, displayName, title)
     {
-        super(representedObject, image, title);
+        super(representedObject, image, displayName, title);
 
         this.element.classList.add("pinned");
     }
@@ -38,14 +38,7 @@ WI.PinnedTabBarItem = class PinnedTabBarItem extends WI.TabBarItem
     {
         console.assert(tabContentView instanceof WI.TabContentView);
 
-        let {image, title} = tabContentView.constructor.tabInfo();
-        return new WI.PinnedTabBarItem(tabContentView, image, title);
-    }
-
-    // Protected
-
-    titleDidChange()
-    {
-        this.element.title = this.title;
+        let {image, displayName, title} = tabContentView.constructor.tabInfo();
+        return new WI.PinnedTabBarItem(tabContentView, image, displayName, title);
     }
 };
index 0061640..c2af15a 100644 (file)
@@ -50,7 +50,8 @@ WI.SearchTabContentView = class SearchTabContentView extends WI.ContentBrowserTa
         return {
             identifier: SearchTabContentView.Type,
             image: "Images/Search.svg",
-            title: WI.UIString("Search"),
+            displayName: WI.UIString("Search", "Search Tab Name", "Name of Search Tab"),
+            title: WI.UIString("Search (%s)", "Search Tab Title", "Title of Search Tab with keyboard shortcut").format(WI.searchKeyboardShortcut.displayName),
         };
     }
 
index b1edaac..99a3d57 100644 (file)
@@ -39,7 +39,8 @@ WI.SettingsTabContentView = class SettingsTabContentView extends WI.TabContentVi
         return {
             identifier: SettingsTabContentView.Type,
             image: "Images/Gear.svg",
-            title: WI.UIString("Settings"),
+            displayName: WI.UIString("Settings", "Settings Tab Name", "Name of Settings Tab"),
+            title: WI.UIString("Settings (%s)", "Settings Tab Title", "Title of Settings Tab with keyboard shortcut").format(WI.settingsKeyboardShortcut.displayName),
         };
     }
 
index 13b1d55..0bd7a0c 100644 (file)
@@ -47,7 +47,7 @@ WI.SourcesTabContentView = class SourcesTabContentView extends WI.ContentBrowser
         return {
             identifier: SourcesTabContentView.Type,
             image: "Images/Sources.svg",
-            title: WI.UIString("Sources"),
+            displayName: WI.UIString("Sources", "Sources Tab Name", "Name of Sources Tab"),
         };
     }
 
index 9540ab8..bd0b7c9 100644 (file)
@@ -46,7 +46,7 @@ WI.StorageTabContentView = class StorageTabContentView extends WI.ContentBrowser
         return {
             identifier: StorageTabContentView.Type,
             image: "Images/Storage.svg",
-            title: WI.UIString("Storage"),
+            displayName: WI.UIString("Storage", "Storage Tab Name", "Name of Storage Tab"),
         };
     }
 
index cb0f690..7add76e 100644 (file)
@@ -299,7 +299,7 @@ body.window-inactive .tab-bar > .tabs > .item:not(.disabled).selected > .icon {
     opacity: 0.4;
 }
 
-.tab-bar > .tabs > .item > .title {
+.tab-bar > .tabs > .item > .name {
     color: hsla(0, 0%, var(--foreground-lightness), 0.6);
 
     display: flex;
@@ -309,11 +309,11 @@ body.window-inactive .tab-bar > .tabs > .item:not(.disabled).selected > .icon {
     -webkit-margin-start: 6px;
 }
 
-body.window-inactive .tab-bar > .tabs > .item > .title {
+body.window-inactive .tab-bar > .tabs > .item > .name {
     color: hsla(0, 0%, var(--foreground-lightness), 0.4);
 }
 
-.tab-bar > .tabs > .item > .title > .content {
+.tab-bar > .tabs > .item > .name > .content {
     min-width: 0;
     width: 100%;
     overflow: hidden;
@@ -321,15 +321,15 @@ body.window-inactive .tab-bar > .tabs > .item > .title {
     white-space: nowrap;
 }
 
-.tab-bar > .tabs > .item:not(.selected):hover > .title {
+.tab-bar > .tabs > .item:not(.selected):hover > .name {
     color: hsla(0, 0%, var(--foreground-lightness), 0.7);
 }
 
-.tab-bar > .tabs > .item:not(.disabled).selected > .title {
+.tab-bar > .tabs > .item:not(.disabled).selected > .name {
     color: hsla(0, 0%, var(--foreground-lightness), 0.8);
 }
 
-body.window-inactive .tab-bar > .tabs > .item:not(.disabled).selected > .title {
+body.window-inactive .tab-bar > .tabs > .item:not(.disabled).selected > .name {
     color: hsla(0, 0%, var(--foreground-lightness), 0.5);
 }
 
index 956766f..3397ed9 100644 (file)
@@ -26,7 +26,7 @@
 
 WI.TabBarItem = class TabBarItem
 {
-    constructor(representedObject, image, title)
+    constructor(representedObject, image, displayName, title)
     {
         this._representedObject = representedObject || null;
         this._parentTabBar = null;
@@ -45,7 +45,8 @@ WI.TabBarItem = class TabBarItem
 
         this._element.createChild("div", "flex-space");
 
-        this.title = title;
+        this.displayName = displayName;
+        this.title = title || displayName;
         this.image = image;
     }
 
@@ -102,6 +103,20 @@ WI.TabBarItem = class TabBarItem
     get image() { return this._iconElement.src; }
     set image(url) { this._iconElement.src = url || ""; }
 
+    get displayName()
+    {
+        return this._displayName;
+    }
+
+    set displayName(displayName)
+    {
+        displayName = displayName || "";
+        if (this._displayName === displayName)
+            return;
+
+        this._displayName = displayName;
+    }
+
     get title()
     {
         return this._title;
@@ -114,14 +129,8 @@ WI.TabBarItem = class TabBarItem
             return;
 
         this._title = title;
-        this.titleDidChange();
-    }
 
-    // Protected
-
-    titleDidChange()
-    {
-        // Implemented by subclasses.
+        this._element.title = this._title;
     }
 };
 
index 262d4ed..0b5bbe3 100644 (file)
@@ -103,7 +103,7 @@ WI.TimelineTabContentView = class TimelineTabContentView extends WI.ContentBrows
         return {
             identifier: TimelineTabContentView.Type,
             image: "Images/Timeline.svg",
-            title: WI.UIString("Timelines"),
+            displayName: WI.UIString("Timelines", "Timelines Tab Name", "Name of Timelines Tab"),
         };
     }