summaryrefslogtreecommitdiff
path: root/eel
diff options
context:
space:
mode:
Diffstat (limited to 'eel')
-rw-r--r--eel/eel-gtk-extensions.c27
-rw-r--r--eel/eel-gtk-extensions.h4
2 files changed, 29 insertions, 2 deletions
diff --git a/eel/eel-gtk-extensions.c b/eel/eel-gtk-extensions.c
index c880ec32..da8e7d7c 100644
--- a/eel/eel-gtk-extensions.c
+++ b/eel/eel-gtk-extensions.c
@@ -32,16 +32,17 @@
#include "eel-gdk-pixbuf-extensions.h"
#include "eel-glib-extensions.h"
#include "eel-mate-extensions.h"
+#include "eel-marshal.h"
#include "eel-string.h"
+
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <gdk/gdk.h>
#include <gdk/gdkprivate.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
+#include <glib/gi18n-lib.h>
#include <math.h>
-#include "eel-marshal.h"
-#include "eel-marshal.c"
/* This number is fairly arbitrary. Long enough to show a pretty long
* menu title, but not so long to make a menu grotesquely wide.
@@ -486,3 +487,25 @@ eel_gtk_tree_view_set_activate_on_single_click (GtkTreeView *tree_view,
GUINT_TO_POINTER (button_press_id));
}
}
+
+void
+eel_gtk_message_dialog_set_details_label (GtkMessageDialog *dialog,
+ const gchar *details_text)
+{
+ GtkWidget *content_area, *expander, *label;
+
+ content_area = gtk_message_dialog_get_message_area (dialog);
+ expander = gtk_expander_new_with_mnemonic (_("Show more _details"));
+ gtk_expander_set_spacing (GTK_EXPANDER (expander), 6);
+
+ label = gtk_label_new (details_text);
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ gtk_label_set_selectable (GTK_LABEL (label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+
+ gtk_container_add (GTK_CONTAINER (expander), label);
+ gtk_box_pack_start (GTK_BOX (content_area), expander, FALSE, FALSE, 0);
+
+ gtk_widget_show (label);
+ gtk_widget_show (expander);
+}
diff --git a/eel/eel-gtk-extensions.h b/eel/eel-gtk-extensions.h
index 8703d4b5..e26c2e2f 100644
--- a/eel/eel-gtk-extensions.h
+++ b/eel/eel-gtk-extensions.h
@@ -77,4 +77,8 @@ void eel_gtk_adjustment_clamp_value (GtkAdjust
void eel_gtk_tree_view_set_activate_on_single_click (GtkTreeView *tree_view,
gboolean should_activate);
+/* GtkMessageDialog */
+void eel_gtk_message_dialog_set_details_label (GtkMessageDialog *dialog,
+ const gchar *details_text);
+
#endif /* EEL_GTK_EXTENSIONS_H */