Changeset 223147 in webkit


Ignore:
Timestamp:
Oct 10, 2017 2:40:31 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Network Tab - Set column initial widths to try allow waterfall column to expand more by default
https://bugs.webkit.org/show_bug.cgi?id=178142
<rdar://problem/34918233>

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2017-10-10
Reviewed by Brian Burg.

  • UserInterface/Views/NetworkTableContentView.js:

(WI.NetworkTableContentView.prototype.initialLayout):
Provide initial widths for many columns where the max could fit
but we'd prefer a smaller than max initial width in wide cases.

  • UserInterface/Views/Table.js:

(WI.Table.prototype._resizeColumnsAndFiller):
When auto sizing all columns use the preferred initial widths.

  • UserInterface/Views/TableColumn.js:

(WI.TableColumn.prototype.get preferredInitialWidth):
Save the initial width.

Location:
trunk/Source/WebInspectorUI
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r223137 r223147  
     12017-10-10  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Network Tab - Set column initial widths to try allow waterfall column to expand more by default
     4        https://bugs.webkit.org/show_bug.cgi?id=178142
     5        <rdar://problem/34918233>
     6
     7        Reviewed by Brian Burg.
     8
     9        * UserInterface/Views/NetworkTableContentView.js:
     10        (WI.NetworkTableContentView.prototype.initialLayout):
     11        Provide initial widths for many columns where the max could fit
     12        but we'd prefer a smaller than max initial width in wide cases.
     13
     14        * UserInterface/Views/Table.js:
     15        (WI.Table.prototype._resizeColumnsAndFiller):
     16        When auto sizing all columns use the preferred initial widths.
     17
     18        * UserInterface/Views/TableColumn.js:
     19        (WI.TableColumn.prototype.get preferredInitialWidth):
     20        Save the initial width.
     21
    1222017-10-10  Ross Kirsling  <ross.kirsling@sony.com>
    223
  • trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js

    r223065 r223147  
    478478    {
    479479        this._nameColumn = new WI.TableColumn("name", WI.UIString("Name"), {
    480             initialWidth: this._nameColumnWidthSetting.value,
    481480            minWidth: WI.Sidebar.AbsoluteMinimumWidth,
    482481            maxWidth: 500,
     482            initialWidth: this._nameColumnWidthSetting.value,
    483483            resizeType: WI.TableColumn.ResizeType.Locked,
    484484        });
     
    489489            minWidth: 120,
    490490            maxWidth: 200,
     491            initialWidth: 150,
    491492        });
    492493
     
    494495            minWidth: 70,
    495496            maxWidth: 120,
     497            initialWidth: 90,
    496498        });
    497499
     
    500502            minWidth: 100,
    501503            maxWidth: 150,
     504            initialWidth: 120,
    502505        });
    503506
     
    506509            minWidth: 55,
    507510            maxWidth: 80,
     511            initialWidth: 65,
    508512        });
    509513
     
    512516            minWidth: 55,
    513517            maxWidth: 80,
     518            initialWidth: 65,
    514519        });
    515520
     
    525530            minWidth: 65,
    526531            maxWidth: 80,
     532            initialWidth: 75,
    527533        });
    528534
     
    531537            minWidth: 65,
    532538            maxWidth: 80,
     539            initialWidth: 70,
    533540        });
    534541
     
    542549            minWidth: 50,
    543550            maxWidth: 120,
     551            initialWidth: 80,
    544552            align: "right",
    545553        });
     
    549557            minWidth: 80,
    550558            maxWidth: 100,
     559            initialWidth: 80,
    551560            align: "right",
    552561        });
     
    555564            minWidth: 100,
    556565            maxWidth: 150,
     566            initialWidth: 100,
    557567            align: "right",
    558568        });
     
    561571            minWidth: 65,
    562572            maxWidth: 90,
     573            initialWidth: 65,
    563574            align: "right",
    564575        });
  • trunk/Source/WebInspectorUI/UserInterface/Views/Table.js

    r223058 r223147  
    821821            }
    822822
     823            // Best fit with the preferred initial width for flexible columns.
     824            bestFit.call(this, (column, width) => {
     825                if (!column.preferredInitialWidth || width <= column.preferredInitialWidth)
     826                    return -1;
     827                return column.preferredInitialWidth;
     828            });
     829
    823830            // Best fit max size flexible columns. May make more pixels available for other columns.
    824831            bestFit.call(this, (column, width) => {
  • trunk/Source/WebInspectorUI/UserInterface/Views/TableColumn.js

    r223058 r223147  
    4242        this._minWidth = minWidth || 50;
    4343        this._maxWidth = maxWidth || 0;
     44        this._initialWidth = initialWidth || NaN;
    4445        this._hidden = hidden || false;
    4546        this._defaultHidden = hidden || false;
     
    6061    get minWidth() { return this._minWidth; }
    6162    get maxWidth() { return this._maxWidth; }
     63    get preferredInitialWidth() { return this._initialWidth; }
    6264    get defaultHidden() { return this._defaultHidden; }
    6365    get sortable() { return this._sortable; }
Note: See TracChangeset for help on using the changeset viewer.