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

Unified Diff: ui/views/controls/button/label_button.cc

Issue 131513005: linux_aura: Use GTK button borders in GTK theme mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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: ui/views/controls/button/label_button.cc
diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc
index 4fd7751fc47e7ec22b85a913c6ed6b16ad4ffcb9..95ec21411507d68c43697e238727b88ba6ed3034 100644
--- a/ui/views/controls/button/label_button.cc
+++ b/ui/views/controls/button/label_button.cc
@@ -17,6 +17,10 @@
#include "ui/views/painter.h"
#include "ui/views/window/dialog_delegate.h"
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#include "ui/views/linux_ui/linux_ui.h"
+#endif
+
namespace {
// The spacing between the icon and text.
@@ -155,8 +159,9 @@ void LabelButton::SetStyle(ButtonStyle style) {
ResetColorsFromNativeTheme();
- // Set the border and invalidate the layout to pickup its new insets.
- set_border(new LabelButtonBorder(style));
+ UpdateThemedBorder(new LabelButtonBorder(style_));
+
+ // Invalidate the layout to pickup the new insets from the border.
InvalidateLayout();
}
@@ -334,6 +339,18 @@ void LabelButton::UpdateImage() {
image_->SetImage(GetImage(state()));
}
+void LabelButton::UpdateThemedBorder(LabelButtonBorder* label_button_border) {
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+ views::LinuxUI* linux_ui = views::LinuxUI::instance();
+ if (linux_ui) {
+ set_border(linux_ui->CreateNativeBorder(this, label_button_border));
+ } else
+#endif
+ {
+ set_border(label_button_border);
+ }
+}
+
void LabelButton::StateChanged() {
const gfx::Size previous_image_size(image_->GetPreferredSize());
UpdateImage();

Powered by Google App Engine
This is Rietveld 408576698