Changeset 27171 in webkit


Ignore:
Timestamp:
Oct 27, 2007 11:45:10 PM (17 years ago)
Author:
timothy@apple.com
Message:

Reviewed by Adam.

Bug 15727: Resizing the resource sidebar doesn't scale the font preview or network timeline
http://bugs.webkit.org/show_bug.cgi?id=15727

Add one window resize listener and call the new resize function on the currentPanel.
Also call the currentPanel's resize function when resizing the sidebar.

  • page/inspector/DocumentPanel.js: Implement resize and call updateTreeSelection() when the panel is shown and when resizing the DOM sidebar.
  • page/inspector/FontPanel.js: Implement resize.
  • page/inspector/NetworkPanel.js: Ditto.
  • page/inspector/inspector.js: Add a window resize listener.
Location:
trunk/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r27170 r27171  
     12007-10-27  Timothy Hatcher  <timothy@apple.com>
     2
     3        Reviewed by Adam.
     4
     5        Bug 15727: Resizing the resource sidebar doesn't scale the font preview or network timeline
     6        http://bugs.webkit.org/show_bug.cgi?id=15727
     7
     8        Add one window resize listener and call the new resize function on the currentPanel.
     9        Also call the currentPanel's resize function when resizing the sidebar.
     10
     11        * page/inspector/DocumentPanel.js: Implement resize and call updateTreeSelection() when
     12          the panel is shown and when resizing the DOM sidebar.
     13        * page/inspector/FontPanel.js: Implement resize.
     14        * page/inspector/NetworkPanel.js: Ditto.
     15        * page/inspector/inspector.js: Add a window resize listener.
     16
    1172007-10-27  Maciej Stachowiak  <mjs@apple.com>
    218
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r27161 r27171  
    1366213662                        isa = PBXProject;
    1366313663                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
     13664                        compatibilityVersion = "Xcode 2.4";
    1366413665                        hasScannedForEncodings = 1;
    1366513666                        knownRegions = (
  • trunk/WebCore/page/inspector/DocumentPanel.js

    r27141 r27171  
    4949    domView.treeOutline.panel = this;
    5050
    51     var panel = this;
    52     window.addEventListener("resize", function() { panel.updateTreeSelection() }, false);
    53 
    5451    domView.crumbsElement = document.createElement("div");
    5552    domView.crumbsElement.className = "crumbs";
     
    9390
    9491WebInspector.DocumentPanel.prototype = {
     92    show: function()
     93    {
     94        WebInspector.SourcePanel.prototype.show.call(this);
     95        this.updateTreeSelection();
     96    },
     97
     98    resize: function()
     99    {
     100        this.updateTreeSelection();
     101    },
     102
    95103    updateTreeSelection: function()
    96104    {
     
    704712            this.views.dom.sideContentElement.style.right = newWidth + "px";
    705713            this.views.dom.sidebarResizeElement.style.right = (newWidth - 3) + "px";
     714
     715            this.updateTreeSelection();
     716
    706717            event.preventDefault();
    707718        }
  • trunk/WebCore/page/inspector/FontPanel.js

    r26933 r27171  
    4343
    4444    this.updateFontPreviewSize();
    45 
    46     var panel = this;
    47     var resizeListener = function() {
    48         panel.updateFontPreviewSize();
    49     };
    50 
    51     window.addEventListener("resize", resizeListener, false);
    5245}
    5346
     
    5649    {
    5750        WebInspector.ResourcePanel.prototype.show.call(this);
     51        this.updateFontPreviewSize();
     52    },
     53
     54    resize: function()
     55    {
    5856        this.updateFontPreviewSize();
    5957    },
  • trunk/WebCore/page/inspector/NetworkPanel.js

    r26948 r27171  
    8989    graphSideElement.appendChild(this.legendElement);
    9090
    91     var networkPanel = this;
    92     window.addEventListener("resize", function() { networkPanel.updateTimelineDividersIfNeeded() }, false);
    93 
    9491    this.drawSummaryGraph(); // draws an empty graph
    9592
     
    109106        WebInspector.Panel.prototype.hide.call(this);
    110107        WebInspector.networkListItem.deselect();
     108    },
     109
     110    resize: function()
     111    {
     112        this.updateTimelineDividersIfNeeded();
    111113    },
    112114
  • trunk/WebCore/page/inspector/inspector.js

    r27141 r27171  
    237237
    238238    window.addEventListener("unload", function(event) { WebInspector.windowUnload(event) }, true);
     239    window.addEventListener("resize", function(event) { WebInspector.windowResize(event) }, true);
     240
    239241    document.addEventListener("mousedown", function(event) { WebInspector.changeFocus(event) }, true);
    240242    document.addEventListener("focus", function(event) { WebInspector.changeFocus(event) }, true);
     
    267269{
    268270    InspectorController.windowUnloading();
     271}
     272
     273WebInspector.windowResize = function(event)
     274{
     275    if (this.currentPanel && this.currentPanel.resize)
     276        this.currentPanel.resize();
    269277}
    270278
     
    462470    var sidebar = document.getElementById("sidebar");
    463471    if (sidebar.dragging == true) {
    464 
    465472        var x = event.clientX + window.scrollX;
    466473
     
    478485        document.getElementById("searchResults").style.left = newWidth + "px";
    479486        document.getElementById("searchResultsResizer").style.left = newWidth + "px";
     487
     488        if (WebInspector.currentPanel && WebInspector.currentPanel.resize)
     489            WebInspector.currentPanel.resize();
     490
    480491        event.preventDefault();
    481492    }
Note: See TracChangeset for help on using the changeset viewer.