Changeset 274465 in webkit
- Timestamp:
- Mar 15, 2021 10:08:03 PM (16 months ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UserInterface/Views/MultiSidebar.js (modified) (5 diffs)
-
UserInterface/Views/SingleSidebar.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r274303 r274465 1 2021-03-15 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: `Styles` sidebar pseudo-class checkboxes appear cramped after resizing window at narrow widths 4 https://bugs.webkit.org/show_bug.cgi?id=222990 5 6 Reviewed by Devin Rousso. 7 8 Fixed two compounding bugs that meant that a sidebar could end up using the base minimum width of 250px 9 instead of the actual minimum width as reported by the selected panel. 10 11 * UserInterface/Views/MultiSidebar.js: 12 (WI.MultiSidebar.prototype.didInsertSidebarPanel): 13 (WI.MultiSidebar.prototype.didRemoveSidebarPanel): 14 (WI.MultiSidebar.prototype.didSetCollapsed): 15 - Drive-by: Remove unused (and always undefined) `flag` argument. 16 (WI.MultiSidebar.prototype._updateMinimumWidthForMultipleSidebars): 17 - Add logic to make sure we can calculate a valid `_minimumWidthForMultipleSidebars`, and add a mechanism to 18 allow ignoring the presence of a cached value to force a recalculation. 19 (WI.MultiSidebar.prototype.get _hasWidthForMultipleSidebars): 20 - Ensure if possible that there is a valid `_minimumWidthForMultipleSidebars`. 21 (WI.MultiSidebar.prototype._makeSidebarPanelExclusive): 22 - Sets the sidebar as non-collapsible (which sets `collapsed` to `false`) before adding the panel and setting it 23 as the selected panel so that we don't set the selected panel on a collapsed sidebar. 24 * UserInterface/Views/SingleSidebar.js: 25 (WI.SingleSidebar.prototype.didSetCollapsed): 26 - Drive-by: Remove always undefined `flag` argument, use `this.collapsed` instead. 27 1 28 2021-03-11 Devin Rousso <drousso@apple.com> 2 29 -
trunk/Source/WebInspectorUI/UserInterface/Views/MultiSidebar.js
r268981 r274465 155 155 didInsertSidebarPanel(sidebarPanel, index) 156 156 { 157 this._updateMinimumWidthForMultipleSidebars( );157 this._updateMinimumWidthForMultipleSidebars({ignoreExistingComputedValue: true}); 158 158 this._updateMultipleSidebarLayout(); 159 159 } … … 168 168 } 169 169 170 this._updateMinimumWidthForMultipleSidebars( );171 this._updateMultipleSidebarLayout(); 172 } 173 174 didSetCollapsed( flag)170 this._updateMinimumWidthForMultipleSidebars({ignoreExistingComputedValue: true}); 171 this._updateMultipleSidebarLayout(); 172 } 173 174 didSetCollapsed() 175 175 { 176 176 this.primarySidebar.collapsed = this.collapsed; 177 178 this._updateMinimumWidthForMultipleSidebars({ignoreExistingComputedValue: true}); 177 179 this._updateMultipleSidebarLayout(); 178 180 } … … 185 187 } 186 188 187 _updateMinimumWidthForMultipleSidebars() 188 { 189 _updateMinimumWidthForMultipleSidebars({ignoreExistingComputedValue} = {}) 190 { 191 if (!ignoreExistingComputedValue && this._requiredMinimumWidthForMultipleSidebars) 192 return; 193 194 if (this.collapsed || !this.isAttached) 195 return; 196 189 197 // A 50px of additional required space helps make sure we collapse the multiple sidebars at an appropriate width 190 198 // without preventing the user from sizing the single sidebar to fill up to the minimum width of the … … 204 212 get _hasWidthForMultipleSidebars() 205 213 { 214 this._updateMinimumWidthForMultipleSidebars(); 206 215 return this._requiredMinimumWidthForMultipleSidebars < this.maximumWidth; 207 216 } … … 240 249 241 250 let sidebar = new WI.SingleSidebar(null, this.side, sidebarPanel.navigationItem.label); 251 sidebar.collapsable = false; 242 252 sidebar.addSidebarPanel(sidebarPanel); 243 sidebar. collapsable = false;253 sidebar.selectedSidebarPanel = sidebarPanel; 244 254 this.addSidebar(sidebar); 245 246 sidebar.selectedSidebarPanel = sidebarPanel;247 255 } 248 256 -
trunk/Source/WebInspectorUI/UserInterface/Views/SingleSidebar.js
r270134 r274465 117 117 } 118 118 119 didSetCollapsed( flag)119 didSetCollapsed() 120 120 { 121 121 if (this.selectedSidebarPanel) { … … 129 129 } 130 130 131 if (! flag&& this._navigationBar)131 if (!this.collapsed && this._navigationBar) 132 132 this._navigationBar.needsLayout(); 133 133 }
Note: See TracChangeset
for help on using the changeset viewer.