Skip to content
Commit e207417c authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot
Browse files

views: fix node hiding in TreeView

This change:
1) Corrects an insidious bug where TreeView::InternalNode::GetMaxWidth
   would pass the InternalNode* as the node instead of the model node,
   which would cause crashes at call sites when attempting to cast it
   back to the model node type and use it. This avoided the type system's
   notice because InternalNode is a subclass of ui::TreeModelNode. Ow.
2) Computes the foreground bounds properly for a node whose icon is
   hidden, so that the selection foreground is drawn only where the text
   is.
3) Repaints the entire node's bounds when repainting a node, not just
   its background, since if the node is being repainted, its bounds may
   also have changed - e.g., if it had its icon shown before and hidden
   now. In that case, simply repainting inside the new bounds is not
   sufficient, because the old bounds may have been greater.

Bug: 610428
Change-Id: I0bce687b80248601259aa243d38230b615a8974c
Reviewed-on: https://chromium-review.googlesource.com/756857


Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518280}
parent e9853246
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment