Changeset 195456 in webkit


Ignore:
Timestamp:
Jan 22, 2016 10:07:58 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Sidebar's should remember their width's
https://bugs.webkit.org/show_bug.cgi?id=153007

Patch by Devin Rousso <Devin Rousso> on 2016-01-22
Reviewed by Timothy Hatcher.

  • UserInterface/Views/CSSStyleDetailsSidebarPanel.js:

(WebInspector.CSSStyleDetailsSidebarPanel.prototype.widthDidChange):
Now calls superclass function.

  • UserInterface/Views/Sidebar.js:

(WebInspector.Sidebar.prototype.set selectedSidebarPanel):
Now calls _recalculateWidth with the saved width value of the sidebar as
the first parameter.

(WebInspector.Sidebar.prototype.set collapsed):
Now only calls _recalculateWidth if the selected sidebar panel is visible,
seeing as if it is hidden the width is irrelevant.

  • UserInterface/Views/SidebarPanel.js:

(WebInspector.SidebarPanel):
Creates a setting object using the panel's identifier to store the current width.

(WebInspector.SidebarPanel.prototype.get savedWidth):
(WebInspector.SidebarPanel.prototype.widthDidChange):
So long as the current width has a value, save it to the setting object.

Location:
trunk/Source/WebInspectorUI
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r195454 r195456  
     12016-01-22  Devin Rousso  <dcrousso+webkit@gmail.com>
     2
     3        Web Inspector: Sidebar's should remember their width's
     4        https://bugs.webkit.org/show_bug.cgi?id=153007
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
     9        (WebInspector.CSSStyleDetailsSidebarPanel.prototype.widthDidChange):
     10        Now calls superclass function.
     11
     12        * UserInterface/Views/Sidebar.js:
     13        (WebInspector.Sidebar.prototype.set selectedSidebarPanel):
     14        Now calls _recalculateWidth with the saved width value of the sidebar as
     15        the first parameter.
     16
     17        (WebInspector.Sidebar.prototype.set collapsed):
     18        Now only calls _recalculateWidth if the selected sidebar panel is visible,
     19        seeing as if it is hidden the width is irrelevant.
     20
     21        * UserInterface/Views/SidebarPanel.js:
     22        (WebInspector.SidebarPanel):
     23        Creates a setting object using the panel's identifier to store the current width.
     24
     25        (WebInspector.SidebarPanel.prototype.get savedWidth):
     26        (WebInspector.SidebarPanel.prototype.widthDidChange):
     27        So long as the current width has a value, save it to the setting object.
     28
    1292016-01-22  Devin Rousso  <dcrousso+webkit@gmail.com>
    230
  • trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.js

    r195454 r195456  
    173173    widthDidChange()
    174174    {
     175        super.widthDidChange();
     176
    175177        this._updateNoForcedPseudoClassesScrollOffset();
    176178
  • trunk/Source/WebInspectorUI/UserInterface/Views/Sidebar.js

    r194879 r195456  
    148148                this._selectedSidebarPanel.shown();
    149149                this._selectedSidebarPanel.visibilityDidChange();
    150                 this._recalculateWidth();
     150                this._recalculateWidth(this._selectedSidebarPanel.savedWidth);
    151151            }
    152152        }
     
    201201
    202202        if (this._selectedSidebarPanel) {
    203             if (this._selectedSidebarPanel.visible)
     203            if (this._selectedSidebarPanel.visible) {
    204204                this._selectedSidebarPanel.shown();
    205             else
     205                this._recalculateWidth(this._selectedSidebarPanel.savedWidth);
     206            } else
    206207                this._selectedSidebarPanel.hidden();
    207208
    208209            this._selectedSidebarPanel.visibilityDidChange();
    209             this._selectedSidebarPanel.widthDidChange();
    210             this._recalculateWidth();
    211210        }
    212211
  • trunk/Source/WebInspectorUI/UserInterface/Views/SidebarPanel.js

    r194879 r195456  
    3434        this._selected = false;
    3535
     36        this._widthSetting = new WebInspector.Setting(identifier + "-sidebar-panel-width", 0);
    3637        this._savedScrollPosition = 0;
    3738
     
    8687        // Implemented by subclasses.
    8788        return 0;
     89    }
     90
     91    get savedWidth()
     92    {
     93        return this._widthSetting.value;
    8894    }
    8995
     
    149155    widthDidChange()
    150156    {
     157        let width = this.element.realOffsetWidth;
     158        if (width && width !== this._widthSetting.value)
     159            this._widthSetting.value = width;
     160
    151161        // Implemented by subclasses.
    152162    }
Note: See TracChangeset for help on using the changeset viewer.