Title: [200716] trunk/Source/WebInspectorUI
Revision
200716
Author
mattba...@apple.com
Date
2016-05-11 17:01:36 -0700 (Wed, 11 May 2016)

Log Message

Web Inspector: Make it possible to do special styling on selected TimelineOverviewGraphs
https://bugs.webkit.org/show_bug.cgi?id=157593
<rdar://problem/26232886>

Reviewed by Timothy Hatcher.

* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview.prototype._timelinesTreeSelectionDidChange.updateGraphSelectedState):
(WebInspector.TimelineOverview.prototype._timelinesTreeSelectionDidChange):
Select the new overview graph and deselect the old one.

* UserInterface/Views/TimelineOverviewGraph.js:
(WebInspector.TimelineOverviewGraph):
(WebInspector.TimelineOverviewGraph.prototype.get selected):
(WebInspector.TimelineOverviewGraph.prototype.set selected):
New property, toggles "selected" class on the graph element.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (200715 => 200716)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-05-11 23:36:59 UTC (rev 200715)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-05-12 00:01:36 UTC (rev 200716)
@@ -1,3 +1,22 @@
+2016-05-11  Matt Baker  <mattba...@apple.com>
+
+        Web Inspector: Make it possible to do special styling on selected TimelineOverviewGraphs
+        https://bugs.webkit.org/show_bug.cgi?id=157593
+        <rdar://problem/26232886>
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/TimelineOverview.js:
+        (WebInspector.TimelineOverview.prototype._timelinesTreeSelectionDidChange.updateGraphSelectedState):
+        (WebInspector.TimelineOverview.prototype._timelinesTreeSelectionDidChange):
+        Select the new overview graph and deselect the old one.
+
+        * UserInterface/Views/TimelineOverviewGraph.js:
+        (WebInspector.TimelineOverviewGraph):
+        (WebInspector.TimelineOverviewGraph.prototype.get selected):
+        (WebInspector.TimelineOverviewGraph.prototype.set selected):
+        New property, toggles "selected" class on the graph element.
+
 2016-05-11  Nikita Vasilyev  <nvasil...@apple.com>
 
         Web Inspector: "Selected Element" is hard to read when searching for "Element"

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js (200715 => 200716)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js	2016-05-11 23:36:59 UTC (rev 200715)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js	2016-05-12 00:01:36 UTC (rev 200716)
@@ -789,16 +789,29 @@
         return this._viewMode === WebInspector.TimelineOverview.ViewMode.Timelines ? this._timelinesViewModeSettings : this._renderingFramesViewModeSettings;
     }
 
-    _timelinesTreeSelectionDidChange()
+    _timelinesTreeSelectionDidChange(event)
     {
-        let treeElement = this._timelinesTreeOutline.selectedTreeElement;
+        function updateGraphSelectedState(timeline, selected)
+        {
+            let overviewGraph = this._overviewGraphsByTypeMap.get(timeline.type);
+            console.assert(overviewGraph, "Missing overview graph for timeline", timeline);
+            overviewGraph.selected = selected;
+        }
+
+        let selectedTreeElement = event.data.selectedElement;
+        let deselectedTreeElement = event.data.deselectedElement;
         let timeline = null;
-        if (treeElement) {
-            timeline = treeElement.representedObject;
+        if (selectedTreeElement) {
+            timeline = selectedTreeElement.representedObject;
             console.assert(timeline instanceof WebInspector.Timeline, timeline);
             console.assert(this._recording.timelines.get(timeline.type) === timeline, timeline);
+
+            updateGraphSelectedState.call(this, timeline, true);
         }
 
+        if (deselectedTreeElement)
+            updateGraphSelectedState.call(this, deselectedTreeElement.representedObject, false);
+
         this._selectedTimeline = timeline;
         this.dispatchEventToListeners(WebInspector.TimelineOverview.Event.TimelineSelected);
     }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js (200715 => 200716)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js	2016-05-11 23:36:59 UTC (rev 200715)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js	2016-05-12 00:01:36 UTC (rev 200716)
@@ -39,6 +39,7 @@
         this._selectedRecord = null;
         this._selectedRecordChanged = false;
         this._scheduledSelectedRecordLayoutUpdateIdentifier = undefined;
+        this._selected = false;
         this._visible = true;
     }
 
@@ -174,6 +175,17 @@
         return 36;
     }
 
+    get selected() { return this._selected; }
+
+    set selected(x)
+    {
+        if (this._selected === x)
+            return;
+
+        this._selected = x;
+        this.element.classList.toggle("selected", this._selected);
+    }
+
     shown()
     {
         if (this._visible)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to