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

Side by Side Diff: chrome/browser/ui/libgtk2ui/gtk2_border.cc

Issue 187133003: linux_aura: Fix all instances of LabelButton sizing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert on the right branch. Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/views/fullscreen_exit_bubble_views.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/libgtk2ui/gtk2_border.h" 5 #include "chrome/browser/ui/libgtk2ui/gtk2_border.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" 9 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
10 #include "third_party/skia/include/effects/SkLerpXfermode.h" 10 #include "third_party/skia/include/effects/SkLerpXfermode.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 PaintState(state, extra, rect, canvas); 113 PaintState(state, extra, rect, canvas);
114 canvas->sk_canvas()->restore(); 114 canvas->sk_canvas()->restore();
115 115
116 canvas->sk_canvas()->restore(); 116 canvas->sk_canvas()->restore();
117 } else { 117 } else {
118 PaintState(state, extra, rect, canvas); 118 PaintState(state, extra, rect, canvas);
119 } 119 }
120 } 120 }
121 121
122 gfx::Insets Gtk2Border::GetInsets() const { 122 gfx::Insets Gtk2Border::GetInsets() const {
123 ui::ThemeProvider* provider = owning_button_->GetThemeProvider(); 123 return border_->GetInsets();
124 if (!provider || !provider->UsingNativeTheme())
125 return border_->GetInsets();
126
127 return gtk2_ui_->GetButtonInsets();
128 } 124 }
129 125
130 gfx::Size Gtk2Border::GetMinimumSize() const { 126 gfx::Size Gtk2Border::GetMinimumSize() const {
131 ui::ThemeProvider* provider = owning_button_->GetThemeProvider(); 127 ui::ThemeProvider* provider = owning_button_->GetThemeProvider();
132 if (!provider || !provider->UsingNativeTheme()) 128 if (!provider || !provider->UsingNativeTheme())
133 return border_->GetMinimumSize(); 129 return border_->GetMinimumSize();
134 130
135 gfx::Insets insets = GetInsets(); 131 gfx::Insets insets = GetInsets();
136 return gfx::Size(insets.width(), insets.height()); 132 return gfx::Size(insets.width(), insets.height());
137 } 133 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 return true; 171 return true;
176 } else if (owning_button_->style() == Button::STYLE_TEXTBUTTON) { 172 } else if (owning_button_->style() == Button::STYLE_TEXTBUTTON) {
177 return focused == false && (state == Button::STATE_HOVERED || 173 return focused == false && (state == Button::STATE_HOVERED ||
178 state == Button::STATE_PRESSED); 174 state == Button::STATE_PRESSED);
179 } 175 }
180 176
181 return false; 177 return false;
182 } 178 }
183 179
184 } // namespace libgtk2ui 180 } // namespace libgtk2ui
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/fullscreen_exit_bubble_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698