Commit bb269b0e authored by Leonard Grey's avatar Leonard Grey Committed by Commit Bot

Mac: don't set default max widths in task manager

Currently, if no max width is specified, we use 1.5 * min_width as the
max which can be insufficient especially in longer languages (but this
also affects English: for example, on my machine "GPU memory" nor
"Keepalive count" can fit the name in the header).

This change leaves the max width unset if it's not specified. It also
changes the autoresizing style to "Sequential" which prioritizes in
leading to trailing order, to ensure "Task" is prioritized for resizes.

Bug: 1109129

Change-Id: I238942541af72b4baea4d61b98e5cfcaa795ff98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2317837Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792039}
parent b331c597
...@@ -289,7 +289,7 @@ NSString* ColumnIdentifier(int id) { ...@@ -289,7 +289,7 @@ NSString* ColumnIdentifier(int id) {
[tableView setAllowsMultipleSelection:YES]; [tableView setAllowsMultipleSelection:YES];
[tableView setAutosaveTableColumns:NO]; [tableView setAutosaveTableColumns:NO];
[tableView [tableView
setColumnAutoresizingStyle:NSTableViewUniformColumnAutoresizingStyle]; setColumnAutoresizingStyle:NSTableViewSequentialColumnAutoresizingStyle];
[tableView setDoubleAction:@selector(tableWasDoubleClicked:)]; [tableView setDoubleAction:@selector(tableWasDoubleClicked:)];
[tableView setFocusRingType:NSFocusRingTypeNone]; [tableView setFocusRingType:NSFocusRingTypeNone];
[tableView setIntercellSpacing:NSMakeSize(0, 0)]; [tableView setIntercellSpacing:NSMakeSize(0, 0)];
...@@ -337,10 +337,8 @@ NSString* ColumnIdentifier(int id) { ...@@ -337,10 +337,8 @@ NSString* ColumnIdentifier(int id) {
[column.get() setSortDescriptorPrototype:sortDescriptor.get()]; [column.get() setSortDescriptorPrototype:sortDescriptor.get()];
[column.get() setMinWidth:columnData.min_width]; [column.get() setMinWidth:columnData.min_width];
int maxWidth = columnData.max_width; if (columnData.max_width > 0)
if (maxWidth < 0) [column.get() setMaxWidth:columnData.max_width];
maxWidth = 3 * columnData.min_width / 2; // *1.5 for ints.
[column.get() setMaxWidth:maxWidth];
[column.get() setResizingMask:NSTableColumnAutoresizingMask | [column.get() setResizingMask:NSTableColumnAutoresizingMask |
NSTableColumnUserResizingMask]; NSTableColumnUserResizingMask];
......
...@@ -27,7 +27,7 @@ struct TableColumnData { ...@@ -27,7 +27,7 @@ struct TableColumnData {
float percent; float percent;
// min and max widths used for Mac's implementation and are ignored on Views. // min and max widths used for Mac's implementation and are ignored on Views.
// If |max_width| is -1, a value of 1.5 * |min_width| will be used. // If |max_width| is -1, it is unset.
int min_width; int min_width;
int max_width; int max_width;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment