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

Unified Diff: chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc

Issue 290573003: Make tooltips toplevel windows on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/libgtk2ui/native_theme_gtk2.h ('k') | chrome/browser/ui/views/chrome_views_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc
diff --git a/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc b/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc
index 8fa8f1483e4c2cd12f412069657001c2fd01b84c..f47540de9a6c9166e46ab8cc751a20baf694c004 100644
--- a/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc
+++ b/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc
@@ -104,12 +104,16 @@ NativeThemeGtk2* NativeThemeGtk2::instance() {
NativeThemeGtk2::NativeThemeGtk2()
: fake_window_(NULL),
+ fake_tooltip_(NULL),
fake_menu_item_(NULL) {
}
NativeThemeGtk2::~NativeThemeGtk2() {
if (fake_window_)
gtk_widget_destroy(fake_window_);
+ if (fake_tooltip_)
+ gtk_widget_destroy(fake_tooltip_);
+
fake_entry_.Destroy();
fake_label_.Destroy();
fake_button_.Destroy();
@@ -249,7 +253,9 @@ GdkColor NativeThemeGtk2::GetSystemGdkColor(ColorId color_id) const {
// Tooltips
case kColorId_TooltipBackground:
- return GetWindowStyle()->bg[GTK_STATE_NORMAL];
+ return GetTooltipStyle()->bg[GTK_STATE_NORMAL];
+ case kColorId_TooltipText:
+ return GetTooltipStyle()->fg[GTK_STATE_NORMAL];
// Trees and Tables (implemented on GTK using the same class)
case kColorId_TableBackground:
@@ -377,6 +383,15 @@ GtkStyle* NativeThemeGtk2::GetTreeStyle() const {
return gtk_rc_get_style(fake_tree_.get());
}
+GtkStyle* NativeThemeGtk2::GetTooltipStyle() const {
+ if (!fake_tooltip_) {
+ fake_tooltip_ = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ gtk_widget_set_name(fake_tooltip_, "gtk-tooltip");
+ gtk_widget_realize(fake_tooltip_);
+ }
+ return gtk_rc_get_style(fake_tooltip_);
+}
+
GtkStyle* NativeThemeGtk2::GetMenuStyle() const {
if (!fake_menu_.get())
fake_menu_.Own(gtk_menu_new());
« no previous file with comments | « chrome/browser/ui/libgtk2ui/native_theme_gtk2.h ('k') | chrome/browser/ui/views/chrome_views_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698