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

Unified Diff: chrome/browser/ui/views/toolbar/toolbar_button.cc

Issue 292153008: linux_aura: Fix the insets on LabelButtons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments about where the smaller insets come from. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_button.h ('k') | ui/views/controls/button/blue_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/toolbar_button.cc
diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.cc b/chrome/browser/ui/views/toolbar/toolbar_button.cc
index 7a285d39e02a23c3b1990408d2886dfa953b8195..7cafc299d66835fde0f0a449d9d453e11070ba8b 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_button.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_button.cc
@@ -11,6 +11,7 @@
#include "ui/accessibility/ax_view_state.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/menu_model.h"
+#include "ui/base/theme_provider.h"
#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
#include "ui/views/controls/button/label_button_border.h"
@@ -128,6 +129,20 @@ void ToolbarButton::GetAccessibleState(ui::AXViewState* state) {
state->AddStateFlag(ui::AX_STATE_HASPOPUP);
}
+void ToolbarButton::SetDefaultBorderInsets(views::LabelButtonBorder* border) {
+ ui::ThemeProvider* provider = GetThemeProvider();
+ if (provider && provider->UsingSystemTheme()) {
+ // These values have no real justification. Because of a mistake in how we
msw 2014/05/21 23:22:57 nit: this paragraph doesn't add much, I think the
+ // were using GTK, we were using these values, which we thought were
+ // insets, but were actually the size of the focus border on the default
+ // activatable widget. This just happened to work.
+ //
+ // We set smaller insets here to accommodate the slightly larger GTK+
+ // icons.
+ border->set_insets(gfx::Insets(2, 2, 2, 2));
+ }
+}
+
void ToolbarButton::ShowContextMenuForView(View* source,
const gfx::Point& point,
ui::MenuSourceType source_type) {
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_button.h ('k') | ui/views/controls/button/blue_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698