New issue
Advanced search Search tips

Issue 691895 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 1
Type: Bug

Blocking:
issue 686962



Sign in to add a comment

Add vector icon support for ImageButton, remove VectorIconButton

Project Member Reported by pkasting@chromium.org, Feb 14 2017

Issue description

VectorIconButton's main reason for existence is that ImageButton only supports bitmap images.  We should add vector image support directly to ImageButton and kill VectorIconButton in favor of that.

Note that VectorIconButton also has some particular behaviors regarding padding sizes, ripples, etc.  Most of these should be controlled by the caller.  I don't think there are really enough users of this class today to justify an ImageButton subclass that does this stuff.  This may require adding a bit more flexibility to ImageButton.

Also note that some of this behavior is undesirable in a Harmony world.  For example, hardcoding 4 px of padding around each edge is not really what we want; see https://codereview.chromium.org/2671443002/ .  This is another reason why this should probably be specified by the caller, not by the button class.

Marking as a P1 Harmony issue because this seems like the solution for getting e.g. dialog close buttons to match the Harmony spec, so it blocks compliance for all dialogs.
 
My open CL to muck with VectorIconButton padding is https://codereview.chromium.org/2671443002/ .  It's not clear to me if it would make sense to try to push to land that.  Let me know.

Comment 2 by bsep@chromium.org, Mar 2 2017

Status: Started (was: Assigned)
Hmm, hold off on landing it. I need the do something similar to avoid exposing kButtonExtraTouchSize to all the subclasses of VectorIconButton, so I might patch it in, but it looks like you're setting the padding to 0 for all vector buttons, which is going to break stuff, e.g. the find-in-page buttons.
It was an open design question from me what to do in the find box; I'm not clear how big the buttons should be and what the padding should be between them.  So I considered that change "intentional, but maybe it shouldn't be".

Comment 4 by bsep@chromium.org, Mar 2 2017

Well, without any other changes it definitely looks wrong to me... The hover highlights overlap, I think the they're hardcoded somehow. Though maybe it's just that I'm not convinced the correct icon padding is 0 in the first place.

I guess I didn't realize that was the ONLY non-close-button use of VectorIconButton (other than "Payments Request" back button, which I'm not sure what that is).
Hmm, I don't recall the hover highlights overlapping when I tested this.  The hover area should have been reduced by the amount of padding reduction, leading to no additional overlap compared to today.  Unless I did something wrong, or the code changed, or you only applied part of the patch.
Project Member

Comment 6 by bugdroid1@chromium.org, Mar 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b7f329f1bcb344b270da73f0ef23650198886a0f

commit b7f329f1bcb344b270da73f0ef23650198886a0f
Author: bsep <bsep@chromium.org>
Date: Tue Mar 21 23:21:44 2017

Move VectorIconButton functionality into static utilities.

There are only a few users of VectorIconButton, and its hard-coded
nature means it is not very flexible. This patch moves its functionality
into two static utilities, one which creates an ImageButton with the
existing vector button styling, and another that updates the
ImageButton's images from an icon. The owner classes are now responsible
for updating the styling if the theme changes.

BUG= 691895 

Review-Url: https://codereview.chromium.org/2744463002
Cr-Commit-Position: refs/heads/master@{#458601}

[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_container.cc
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/chrome/browser/ui/views/download/download_item_view.cc
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/chrome/browser/ui/views/download/download_item_view.h
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/chrome/browser/ui/views/download/download_shelf_view.cc
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/chrome/browser/ui/views/download/download_shelf_view.h
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/chrome/browser/ui/views/find_bar_view.cc
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/chrome/browser/ui/views/find_bar_view.h
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/chrome/browser/ui/views/infobars/infobar_view.cc
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/chrome/browser/ui/views/infobars/infobar_view.h
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/chrome/browser/ui/views/payments/editor_view_controller.h
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/chrome/browser/ui/views/payments/payment_request_sheet_controller.h
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/chrome/browser/ui/views/payments/payment_request_views_util.cc
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/chrome/browser/ui/views/payments/payment_request_views_util.h
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/ui/views/BUILD.gn
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/ui/views/animation/ink_drop_host_view.h
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/ui/views/bubble/bubble_frame_view.cc
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/ui/views/bubble/bubble_frame_view.h
[modify] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/ui/views/controls/button/image_button.h
[add] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/ui/views/controls/button/image_button_factory.cc
[add] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/ui/views/controls/button/image_button_factory.h
[add] https://crrev.com/b7f329f1bcb344b270da73f0ef23650198886a0f/ui/views/controls/button/image_button_factory_unittest.cc
[delete] https://crrev.com/2e8294f8c416b5ec2ad67ae06ff40462aa6020d4/ui/views/controls/button/vector_icon_button.cc
[delete] https://crrev.com/2e8294f8c416b5ec2ad67ae06ff40462aa6020d4/ui/views/controls/button/vector_icon_button.h
[delete] https://crrev.com/2e8294f8c416b5ec2ad67ae06ff40462aa6020d4/ui/views/controls/button/vector_icon_button_delegate.cc
[delete] https://crrev.com/2e8294f8c416b5ec2ad67ae06ff40462aa6020d4/ui/views/controls/button/vector_icon_button_delegate.h

Comment 8 by bsep@chromium.org, Mar 30 2017

Status: Fixed (was: Started)

Sign in to add a comment