summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/gtk_util.cc
diff options
context:
space:
mode:
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);