aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk/gui_utils.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2013-03-20 22:41:51 +0000
committerGerald Combs <gerald@wireshark.org>2013-03-20 22:41:51 +0000
commita8e0c855486f76b75cc2b2d0a3ec9c313cf854c6 (patch)
tree30503e72ef2c56fe911d763c83f60248e54e0c62 /ui/gtk/gui_utils.c
parente704aaa14b5ac9a4ab0635fb7ed8f5dedce820f2 (diff)
Add frame_new, which creates a frame that best conforms to the GNOME,
Windows, and OS X HIGs. Use it in the capture options dialog. The capture options dialog is a bit taller now and could probably use a bit more tweaking. In the capture options, conversation, and endpoint dialogs use our best-guess dialog spacing and pad out some areas. svn path=/trunk/; revision=48445
Diffstat (limited to 'ui/gtk/gui_utils.c')
-rw-r--r--ui/gtk/gui_utils.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/ui/gtk/gui_utils.c b/ui/gtk/gui_utils.c
index eb1c2b2ee6..27e04df5df 100644
--- a/ui/gtk/gui_utils.c
+++ b/ui/gtk/gui_utils.c
@@ -1865,6 +1865,27 @@ gtk_separator_new(GtkOrientation orientation)
}
#endif /* GTK_CHECK_VERSION(3,0,0) */
+GtkWidget *
+frame_new(const gchar *title) {
+ GtkWidget *frame, *frame_lb;
+ GString *mu_title = g_string_new("");
+
+ frame = gtk_frame_new(NULL);
+ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_NONE);
+ if (title) {
+#if !defined(_WIN32) && !defined(__APPLE__)
+ g_string_printf(mu_title, "%s", title);
+#else
+ g_string_printf(mu_title, "<b>%s</b>", title);
+#endif
+ frame_lb = gtk_label_new(NULL);
+ gtk_label_set_markup(GTK_LABEL(frame_lb), mu_title->str);
+ gtk_frame_set_label_widget(GTK_FRAME(frame), frame_lb);
+ }
+ g_string_free(mu_title, TRUE);
+
+ return frame;
+}
/* ---------------------------------