summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/gtk_util.cc
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-07 19:16:06 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-07 19:16:06 +0000
commit03082a6536bb152e8391b66a692c092d5d1bd07d (patch)
treea63164bc50ae3a952262bbb3b1bf2d88b85bfe26 /chrome/browser/gtk/gtk_util.cc
parentd76cbd651f0880d9edb5e497f71717f47b5482d7 (diff)
downloadchromium_src-03082a6536bb152e8391b66a692c092d5d1bd07d.zip
chromium_src-03082a6536bb152e8391b66a692c092d5d1bd07d.tar.gz
chromium_src-03082a6536bb152e8391b66a692c092d5d1bd07d.tar.bz2
gtk: Avoid duplicating functions in anonymous namespaces by moving them to gtk_util.h
BUG=None TEST=compiles Patch from Thiago Farina <thiago.farina@gmail.com> Review URL: http://codereview.chromium.org/1610003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43862 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/gtk_util.cc')
-rw-r--r--chrome/browser/gtk/gtk_util.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/gtk/gtk_util.cc b/chrome/browser/gtk/gtk_util.cc
index 6157bda..72f392e 100644
--- a/chrome/browser/gtk/gtk_util.cc
+++ b/chrome/browser/gtk/gtk_util.cc
@@ -11,6 +11,7 @@
#include <map>
#include "app/gtk_util.h"
+#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "app/x11_util.h"
#include "base/i18n/rtl.h"
@@ -551,6 +552,24 @@ GtkWidget* AddButtonToDialog(GtkWidget* dialog, const gchar* text,
return button;
}
+GtkWidget* BuildDialogButton(GtkWidget* dialog, int ids_id,
+ const gchar* stock_id) {
+ GtkWidget* button = gtk_button_new_with_mnemonic(
+ gtk_util::ConvertAcceleratorsFromWindowsStyle(
+ l10n_util::GetStringUTF8(ids_id)).c_str());
+ gtk_button_set_image(GTK_BUTTON(button),
+ gtk_image_new_from_stock(stock_id,
+ GTK_ICON_SIZE_BUTTON));
+ return button;
+}
+
+GtkWidget* CreateEntryImageHBox(GtkWidget* entry, GtkWidget* image) {
+ GtkWidget* hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing);
+ gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0);
+ return hbox;
+}
+
void SetLabelColor(GtkWidget* label, const GdkColor* color) {
gtk_widget_modify_fg(label, GTK_STATE_NORMAL, color);
gtk_widget_modify_fg(label, GTK_STATE_ACTIVE, color);