diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-14 00:18:57 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-14 00:18:57 +0000 |
commit | a6d953ed61489bec9075f7441df3c2d559946de1 (patch) | |
tree | d1d2d5cfa478d86d248e0980d611cbe6c0a0cf6d /chrome/browser/gtk/bookmark_bar_gtk.cc | |
parent | c3c9909ee8533061752628de4523786c383ce399 (diff) | |
download | chromium_src-a6d953ed61489bec9075f7441df3c2d559946de1.zip chromium_src-a6d953ed61489bec9075f7441df3c2d559946de1.tar.gz chromium_src-a6d953ed61489bec9075f7441df3c2d559946de1.tar.bz2 |
Blind attempt at fixing the bookmark bar instructional text color for GTK.
BUG=23536
TEST=Open Chrome Linux w/a theme and no bookmarks, verify instructional text in bookmarks bar has correct color.
Review URL: http://codereview.chromium.org/274034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28922 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/bookmark_bar_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/bookmark_bar_gtk.cc | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc index 3387013..eb71258 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.cc +++ b/chrome/browser/gtk/bookmark_bar_gtk.cc @@ -67,9 +67,6 @@ const int kBookmarkBarMinimumHeight = 4; // Left-padding for the instructional text. const int kInstructionsPadding = 6; -// Color of the instructional text. -const GdkColor kInstructionsColor = GDK_COLOR_RGB(128, 128, 142); - // Middle color of the separator gradient. const double kSeparatorColor[] = { 194.0 / 255.0, 205.0 / 255.0, 212.0 / 212.0 }; @@ -119,6 +116,7 @@ BookmarkBarGtk::BookmarkBarGtk(BrowserWindowGtk* window, window_(window), tabstrip_origin_provider_(tabstrip_origin_provider), model_(NULL), + instructions_label_(NULL), instructions_(NULL), dragged_node_(NULL), toolbar_drop_item_(NULL), @@ -197,11 +195,10 @@ void BookmarkBarGtk::Init(Profile* profile) { kInstructionsPadding, 0); g_signal_connect(instructions_, "destroy", G_CALLBACK(gtk_widget_destroyed), &instructions_); - GtkWidget* instructions_label = gtk_label_new( - l10n_util::GetStringUTF8(IDS_BOOKMARKS_NO_ITEMS).c_str()); - gtk_widget_modify_fg(instructions_label, GTK_STATE_NORMAL, - &kInstructionsColor); - gtk_container_add(GTK_CONTAINER(instructions_), instructions_label); + instructions_label_ = + gtk_label_new(l10n_util::GetStringUTF8(IDS_BOOKMARKS_NO_ITEMS).c_str()); + UpdateInstructionsLabelColor(); + gtk_container_add(GTK_CONTAINER(instructions_), instructions_label_); gtk_box_pack_start(GTK_BOX(bookmark_hbox_), instructions_, FALSE, FALSE, 0); @@ -494,6 +491,16 @@ int BookmarkBarGtk::GetBookmarkButtonCount() { return count; } +void BookmarkBarGtk::UpdateInstructionsLabelColor() { + if (theme_provider_->UseGtkTheme()) { + gtk_util::SetLabelColor(instructions_label_, NULL); + } else { + GdkColor color = theme_provider_->GetGdkColor( + BrowserThemeProvider::COLOR_BOOKMARK_TEXT); + gtk_util::SetLabelColor(instructions_label_, &color); + } +} + void BookmarkBarGtk::SetOverflowButtonAppearance() { GtkWidget* former_child = gtk_bin_get_child(GTK_BIN(overflow_button_)); if (former_child) @@ -627,6 +634,8 @@ void BookmarkBarGtk::Observe(NotificationType type, << "don't have a BookmarkModel. Taking no action."; } + UpdateInstructionsLabelColor(); + UpdateEventBoxPaintability(); GdkColor paint_box_color = |