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

Unified Diff: chrome/browser/ui/libgtk2ui/gtk2_border.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
Index: chrome/browser/ui/libgtk2ui/gtk2_border.cc
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_border.cc b/chrome/browser/ui/libgtk2ui/gtk2_border.cc
index 31a239690e7c9f6c04fe7136c186d124c1f6f77a..9d78d959ab8ae34bebfad7210e81b451a844c9b2 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_border.cc
+++ b/chrome/browser/ui/libgtk2ui/gtk2_border.cc
@@ -72,9 +72,11 @@ class ButtonImageSkiaSource : public gfx::ImageSkiaSource {
} // namespace
Gtk2Border::Gtk2Border(Gtk2UI* gtk2_ui,
- views::LabelButton* owning_button)
+ views::LabelButton* owning_button,
+ scoped_ptr<views::Border> border)
: gtk2_ui_(gtk2_ui),
owning_button_(owning_button),
+ border_(border.Pass()),
observer_manager_(this) {
observer_manager_.Add(NativeThemeGtk2::instance());
}
@@ -113,14 +115,11 @@ void Gtk2Border::Paint(const views::View& view, gfx::Canvas* canvas) {
}
gfx::Insets Gtk2Border::GetInsets() const {
- // On STYLE_TEXTUBTTON, we want the smaller insets so we can fit the GTK icon
- // in the toolbar without cutting off the edges of the GTK image.
- return gtk2_ui_->GetButtonInsets();
+ return border_->GetInsets();
}
gfx::Size Gtk2Border::GetMinimumSize() const {
- gfx::Insets insets = GetInsets();
- return gfx::Size(insets.width(), insets.height());
+ return border_->GetMinimumSize();
}
void Gtk2Border::OnNativeThemeUpdated(ui::NativeTheme* observed_theme) {

Powered by Google App Engine
This is Rietveld 408576698