diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 22:37:09 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 22:37:09 +0000 |
commit | d3be4f1d9a1a09f47a59182ed5510a5cd6e41609 (patch) | |
tree | 1092a66ee0f3ed570b517220d1f3b7a58cc37443 /chrome/browser | |
parent | 4a77a57455118a2ab4ca802ce0d3eebc9d7ca39c (diff) | |
download | chromium_src-d3be4f1d9a1a09f47a59182ed5510a5cd6e41609.zip chromium_src-d3be4f1d9a1a09f47a59182ed5510a5cd6e41609.tar.gz chromium_src-d3be4f1d9a1a09f47a59182ed5510a5cd6e41609.tar.bz2 |
GTK: Chrome themes should use COLOR_BOOKMARK_TEXT for most download item text.
Review URL: http://codereview.chromium.org/201030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25536 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/gtk/download_item_gtk.cc | 47 |
1 files changed, 19 insertions, 28 deletions
diff --git a/chrome/browser/gtk/download_item_gtk.cc b/chrome/browser/gtk/download_item_gtk.cc index 815459a..74e15f8 100644 --- a/chrome/browser/gtk/download_item_gtk.cc +++ b/chrome/browser/gtk/download_item_gtk.cc @@ -51,10 +51,6 @@ const int kDangerousTextWidth = 350; // make the download item. const int kMinDownloadItemWidth = download_util::kSmallProgressIconSize; -const char* kLabelColorMarkup = "<span color='#%s'>%s</span>"; -const char* kFilenameColor = "576C95"; // 87, 108, 149 -const char* kStatusColor = "7B8DAE"; // 123, 141, 174 - // New download item animation speed in milliseconds. const int kNewItemAnimationDurationMs = 800; @@ -526,32 +522,29 @@ void DownloadItemGtk::UpdateNameLabel() { get_download()->GetFileName(), gfx::Font(), kTextWidth); if (theme_provider_->UseGtkTheme()) { - gtk_label_set_markup(GTK_LABEL(name_label_), - WideToUTF8(elided_filename).c_str()); + gtk_util::SetLabelColor(name_label_, NULL); } else { - gchar* label_markup = - g_markup_printf_escaped(kLabelColorMarkup, kFilenameColor, - WideToUTF8(elided_filename).c_str()); - gtk_label_set_markup(GTK_LABEL(name_label_), label_markup); - g_free(label_markup); + GdkColor color = theme_provider_->GetGdkColor( + BrowserThemeProvider::COLOR_BOOKMARK_TEXT); + gtk_util::SetLabelColor(name_label_, &color); } + + gtk_label_set_text(GTK_LABEL(name_label_), + WideToUTF8(elided_filename).c_str()); } void DownloadItemGtk::UpdateStatusLabel(GtkWidget* status_label, const std::string& status_text) { if (status_label) { if (theme_provider_->UseGtkTheme()) { - gtk_label_set_label(GTK_LABEL(status_label), status_text.c_str()); + gtk_util::SetLabelColor(status_label, NULL); } else { - // TODO(erg): I am not sure which ThemeProvider color I'm supposed to use - // here. I am also not sure if using set_markup is the correct course of - // action compared to modifying the GtkStyle->text[]. - gchar* label_markup = - g_markup_printf_escaped(kLabelColorMarkup, kStatusColor, - status_text.c_str()); - gtk_label_set_markup(GTK_LABEL(status_label), label_markup); - g_free(label_markup); + GdkColor color = theme_provider_->GetGdkColor( + BrowserThemeProvider::COLOR_BOOKMARK_TEXT); + gtk_util::SetLabelColor(status_label, &color); } + + gtk_label_set_label(GTK_LABEL(status_label), status_text.c_str()); } } @@ -568,22 +561,20 @@ void DownloadItemGtk::UpdateDangerWarning() { gtk_image_set_from_stock(GTK_IMAGE(dangerous_image_), GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_SMALL_TOOLBAR); - gtk_label_set_label(GTK_LABEL(dangerous_label_), - dangerous_warning.c_str()); - gtk_widget_set_size_request(dangerous_label_, -1, -1); + gtk_util::SetLabelColor(dangerous_label_, NULL); } else { // Set the warning icon. ResourceBundle& rb = ResourceBundle::GetSharedInstance(); GdkPixbuf* download_pixbuf = rb.GetPixbufNamed(IDR_WARNING); gtk_image_set_from_pixbuf(GTK_IMAGE(dangerous_image_), download_pixbuf); - gchar* label_markup = - g_markup_printf_escaped(kLabelColorMarkup, kFilenameColor, - dangerous_warning.c_str()); - gtk_label_set_markup(GTK_LABEL(dangerous_label_), label_markup); - g_free(label_markup); + GdkColor color = theme_provider_->GetGdkColor( + BrowserThemeProvider::COLOR_BOOKMARK_TEXT); + gtk_util::SetLabelColor(dangerous_label_, &color); } + gtk_label_set_label(GTK_LABEL(dangerous_label_), dangerous_warning.c_str()); + // Until we switch to vector graphics, force the font size. gtk_util::ForceFontSizePixels(dangerous_label_, kTextSize); gtk_label_set_line_wrap(GTK_LABEL(dangerous_label_), TRUE); |