summaryrefslogtreecommitdiff
path: root/src/terminal-info-bar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/terminal-info-bar.c')
-rw-r--r--src/terminal-info-bar.c83
1 files changed, 42 insertions, 41 deletions
diff --git a/src/terminal-info-bar.c b/src/terminal-info-bar.c
index 57c132b..edf77db 100644
--- a/src/terminal-info-bar.c
+++ b/src/terminal-info-bar.c
@@ -26,7 +26,7 @@
struct _TerminalInfoBarPrivate
{
- GtkWidget *content_box;
+ GtkWidget *content_box;
};
G_DEFINE_TYPE (TerminalInfoBar, terminal_info_bar, GTK_TYPE_INFO_BAR)
@@ -36,22 +36,22 @@ G_DEFINE_TYPE (TerminalInfoBar, terminal_info_bar, GTK_TYPE_INFO_BAR)
static void
terminal_info_bar_init (TerminalInfoBar *bar)
{
- GtkInfoBar *info_bar = GTK_INFO_BAR (bar);
- TerminalInfoBarPrivate *priv;
+ GtkInfoBar *info_bar = GTK_INFO_BAR (bar);
+ TerminalInfoBarPrivate *priv;
- priv = bar->priv = TERMINAL_INFO_BAR_GET_PRIVATE (bar);
+ priv = bar->priv = TERMINAL_INFO_BAR_GET_PRIVATE (bar);
- priv->content_box = gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (info_bar)),
- priv->content_box, TRUE, TRUE, 0);
+ priv->content_box = gtk_vbox_new (FALSE, 6);
+ gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (info_bar)),
+ priv->content_box, TRUE, TRUE, 0);
}
static void
terminal_info_bar_class_init (TerminalInfoBarClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (gobject_class, sizeof (TerminalInfoBarPrivate));
+ g_type_class_add_private (gobject_class, sizeof (TerminalInfoBarPrivate));
}
/* public API */
@@ -67,26 +67,27 @@ terminal_info_bar_new (GtkMessageType type,
const char *first_button_text,
...)
{
- GtkWidget *info_bar;
- va_list args;
+ GtkWidget *info_bar;
+ va_list args;
- info_bar = g_object_new (TERMINAL_TYPE_INFO_BAR,
- "message-type", type,
- NULL);
+ info_bar = g_object_new (TERMINAL_TYPE_INFO_BAR,
+ "message-type", type,
+ NULL);
- va_start (args, first_button_text);
- while (first_button_text != NULL) {
- int response_id;
+ va_start (args, first_button_text);
+ while (first_button_text != NULL)
+ {
+ int response_id;
- response_id = va_arg (args, int);
- gtk_info_bar_add_button (GTK_INFO_BAR (info_bar),
- first_button_text, response_id);
+ response_id = va_arg (args, int);
+ gtk_info_bar_add_button (GTK_INFO_BAR (info_bar),
+ first_button_text, response_id);
- first_button_text = va_arg (args, const char *);
- }
- va_end (args);
+ first_button_text = va_arg (args, const char *);
+ }
+ va_end (args);
- return info_bar;
+ return info_bar;
}
void
@@ -94,26 +95,26 @@ terminal_info_bar_format_text (TerminalInfoBar *bar,
const char *format,
...)
{
- TerminalInfoBarPrivate *priv;
- char *text;
- GtkWidget *label;
- va_list args;
+ TerminalInfoBarPrivate *priv;
+ char *text;
+ GtkWidget *label;
+ va_list args;
- g_return_if_fail (TERMINAL_IS_INFO_BAR (bar));
+ g_return_if_fail (TERMINAL_IS_INFO_BAR (bar));
- priv = bar->priv;
+ priv = bar->priv;
- va_start (args, format);
- text = g_strdup_vprintf (format, args);
- va_end (args);
+ va_start (args, format);
+ text = g_strdup_vprintf (format, args);
+ va_end (args);
- label = gtk_label_new (text);
- g_free (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.0);
+ label = gtk_label_new (text);
+ g_free (text);
- gtk_box_pack_start (GTK_BOX (priv->content_box), label, FALSE, FALSE, 0);
- gtk_widget_show_all (priv->content_box);
+ 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.0);
+
+ gtk_box_pack_start (GTK_BOX (priv->content_box), label, FALSE, FALSE, 0);
+ gtk_widget_show_all (priv->content_box);
}