Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(676)

Issue 292153008: linux_aura: Fix the insets on LabelButtons. (Closed)

Created:
6 years, 7 months ago by Elliot Glaysher
Modified:
6 years, 7 months ago
Reviewers:
msw, sky, Evan Stade
CC:
chromium-reviews, tfarina
Visibility:
Public.

Description

linux_aura: Fix the insets on LabelButtons. Starting in r266097, we always used the insets provided by Gtk2Border. We had previously had a hacky solution where we tried to determine whether the button was a toolbar button by digging in its style, but that hack was removed because it overreached. We had this hack to deal with slightly larger icon assets that GTK handed us. In r269180, there was a subtle timing change, which then meant that buttons outside the toolbar started using the GTK insets, such as buttons in the extension removal dialog, the javascript alert dialog, etc. Now, Gtk2Border always uses the insets provided by the views::LabelButtonBorder (and we no longer have a concept of "GTK insets"), and we explicitly set smaller insets that don't cause the clipping issues only in ToolbarButton. This lets both bugs be fixed at the same time. BUG=372305 TEST=Using GTK+ theme mode, the left edge of the back button shouldn't be visually chopped off. TEST=Using GTK+ theme mode, The OK button on a javascript alert shouldn't be vertically squashed. TEST=Using the default theme, both of the above should look normal. R=msw@chromium.org, sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=272326

Patch Set 1 #

Total comments: 7

Patch Set 2 : Add comments about where the smaller insets come from. #

Total comments: 1

Patch Set 3 : Removed paragraph. #

Patch Set 4 : Moved to a chain of CreateDefaultBorder()s instead. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -63 lines) Patch
M chrome/browser/ui/libgtk2ui/gtk2_border.h View 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/ui/libgtk2ui/gtk2_border.cc View 2 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/ui/libgtk2ui/gtk2_ui.h View 4 chunks +0 lines, -10 lines 0 comments Download
M chrome/browser/ui/libgtk2ui/gtk2_ui.cc View 3 chunks +2 lines, -32 lines 0 comments Download
M chrome/browser/ui/views/toolbar/back_button.h View 1 2 3 1 chunk +2 lines, -1 line 3 comments Download
M chrome/browser/ui/views/toolbar/back_button.cc View 1 2 3 1 chunk +6 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/toolbar/toolbar_button.h View 1 2 3 1 chunk +2 lines, -0 lines 1 comment Download
M chrome/browser/ui/views/toolbar/toolbar_button.cc View 1 2 3 2 chunks +16 lines, -0 lines 0 comments Download
M ui/views/controls/button/blue_button.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/button/blue_button.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M ui/views/controls/button/label_button.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/button/label_button.cc View 1 2 3 2 chunks +6 lines, -5 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Elliot Glaysher
msw: Requesting first round review before I send this to a wider audience.
6 years, 7 months ago (2014-05-21 22:24:25 UTC) #1
msw
This confuses me a little (see questions below), sorry. After the LabelButton cleanup, I hope ...
6 years, 7 months ago (2014-05-21 22:57:14 UTC) #2
Elliot Glaysher
https://codereview.chromium.org/292153008/diff/1/chrome/browser/ui/libgtk2ui/gtk2_ui.cc File chrome/browser/ui/libgtk2ui/gtk2_ui.cc (left): https://codereview.chromium.org/292153008/diff/1/chrome/browser/ui/libgtk2ui/gtk2_ui.cc#oldcode1372 chrome/browser/ui/libgtk2ui/gtk2_ui.cc:1372: gtk_widget_style_get(GTK_WIDGET(button), On 2014/05/21 22:57:14, msw wrote: > Why isn't ...
6 years, 7 months ago (2014-05-21 23:16:57 UTC) #3
msw
lgtm; thanks for explaining. https://codereview.chromium.org/292153008/diff/20001/chrome/browser/ui/views/toolbar/toolbar_button.cc File chrome/browser/ui/views/toolbar/toolbar_button.cc (right): https://codereview.chromium.org/292153008/diff/20001/chrome/browser/ui/views/toolbar/toolbar_button.cc#newcode135 chrome/browser/ui/views/toolbar/toolbar_button.cc:135: // These values have no ...
6 years, 7 months ago (2014-05-21 23:22:57 UTC) #4
Elliot Glaysher
sky: owners stamp estade: fyi, if you have anything you want to add
6 years, 7 months ago (2014-05-21 23:27:51 UTC) #5
sky
There's already CreateDefaultBorder(), why can't that do the customization?
6 years, 7 months ago (2014-05-22 03:21:22 UTC) #6
Elliot Glaysher
Done. PTAL.
6 years, 7 months ago (2014-05-22 18:06:00 UTC) #7
msw
https://codereview.chromium.org/292153008/diff/60001/chrome/browser/ui/views/toolbar/back_button.h File chrome/browser/ui/views/toolbar/back_button.h (right): https://codereview.chromium.org/292153008/diff/60001/chrome/browser/ui/views/toolbar/back_button.h#newcode35 chrome/browser/ui/views/toolbar/back_button.h:35: OVERRIDE; why did this change back to putting OVERRIDE ...
6 years, 7 months ago (2014-05-22 18:09:22 UTC) #8
Elliot Glaysher
https://codereview.chromium.org/292153008/diff/60001/chrome/browser/ui/views/toolbar/back_button.h File chrome/browser/ui/views/toolbar/back_button.h (right): https://codereview.chromium.org/292153008/diff/60001/chrome/browser/ui/views/toolbar/back_button.h#newcode35 chrome/browser/ui/views/toolbar/back_button.h:35: OVERRIDE; On 2014/05/22 18:09:22, msw wrote: > why did ...
6 years, 7 months ago (2014-05-22 18:14:03 UTC) #9
sky
LGTM https://codereview.chromium.org/292153008/diff/60001/chrome/browser/ui/views/toolbar/back_button.h File chrome/browser/ui/views/toolbar/back_button.h (right): https://codereview.chromium.org/292153008/diff/60001/chrome/browser/ui/views/toolbar/back_button.h#newcode35 chrome/browser/ui/views/toolbar/back_button.h:35: OVERRIDE; On 2014/05/22 18:09:22, msw wrote: > why ...
6 years, 7 months ago (2014-05-22 19:44:21 UTC) #10
Elliot Glaysher
6 years, 7 months ago (2014-05-22 21:34:47 UTC) #11
Message was sent while issue was closed.
Committed patchset #4 manually as r272326 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698