xed-progress-message-area.c: Clean up code style

This commit is contained in:
JosephMcc 2017-01-07 04:13:12 -08:00
parent 01ace1d02f
commit a1671a6227
1 changed files with 118 additions and 128 deletions

View File

@ -40,7 +40,8 @@
#include "xed-progress-message-area.h"
enum {
enum
{
PROP_0,
PROP_HAS_CANCEL_BUTTON
};
@ -62,9 +63,9 @@ xed_progress_message_area_set_has_cancel_button (XedProgressMessageArea *area,
gboolean has_button)
{
if (has_button)
gtk_info_bar_add_button (GTK_INFO_BAR (area),
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL);
{
gtk_info_bar_add_button (GTK_INFO_BAR (area), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
}
g_object_notify (G_OBJECT (area), "has-cancel-button");
}
@ -82,8 +83,7 @@ xed_progress_message_area_set_property (GObject *object,
switch (prop_id)
{
case PROP_HAS_CANCEL_BUTTON:
xed_progress_message_area_set_has_cancel_button (area,
g_value_get_boolean (value));
xed_progress_message_area_set_has_cancel_button (area, g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -141,8 +141,7 @@ xed_progress_message_area_init (XedProgressMessageArea *area)
gtk_widget_show (hbox);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
area->priv->image = gtk_image_new_from_icon_name (GTK_STOCK_MISSING_IMAGE,
GTK_ICON_SIZE_SMALL_TOOLBAR);
area->priv->image = gtk_image_new_from_icon_name (GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_widget_show (area->priv->image);
gtk_widget_set_halign (area->priv->image, GTK_ALIGN_CENTER);
gtk_widget_set_valign (area->priv->image, GTK_ALIGN_CENTER);
@ -153,8 +152,7 @@ xed_progress_message_area_init (XedProgressMessageArea *area)
gtk_box_pack_start (GTK_BOX (hbox), area->priv->label, TRUE, TRUE, 0);
gtk_label_set_use_markup (GTK_LABEL (area->priv->label), TRUE);
gtk_misc_set_alignment (GTK_MISC (area->priv->label), 0.0, 0.5);
gtk_label_set_ellipsize (GTK_LABEL (area->priv->label),
PANGO_ELLIPSIZE_END);
gtk_label_set_ellipsize (GTK_LABEL (area->priv->label), PANGO_ELLIPSIZE_END);
area->priv->progress = gtk_progress_bar_new ();
gtk_widget_show (area->priv->progress);
@ -181,11 +179,8 @@ xed_progress_message_area_new (const gchar *stock_id,
"has-cancel-button", has_cancel,
NULL));
xed_progress_message_area_set_stock_image (area,
stock_id);
xed_progress_message_area_set_markup (area,
markup);
xed_progress_message_area_set_stock_image (area, stock_id);
xed_progress_message_area_set_markup (area, markup);
return GTK_WIDGET (area);
}
@ -197,9 +192,7 @@ xed_progress_message_area_set_stock_image (XedProgressMessageArea *area,
g_return_if_fail (XED_IS_PROGRESS_MESSAGE_AREA (area));
g_return_if_fail (stock_id != NULL);
gtk_image_set_from_stock (GTK_IMAGE (area->priv->image),
stock_id,
GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_image_set_from_stock (GTK_IMAGE (area->priv->image), stock_id, GTK_ICON_SIZE_SMALL_TOOLBAR);
}
void
@ -209,8 +202,7 @@ xed_progress_message_area_set_markup (XedProgressMessageArea *area,
g_return_if_fail (XED_IS_PROGRESS_MESSAGE_AREA (area));
g_return_if_fail (markup != NULL);
gtk_label_set_markup (GTK_LABEL (area->priv->label),
markup);
gtk_label_set_markup (GTK_LABEL (area->priv->label), markup);
}
void
@ -220,8 +212,7 @@ xed_progress_message_area_set_text (XedProgressMessageArea *area,
g_return_if_fail (XED_IS_PROGRESS_MESSAGE_AREA (area));
g_return_if_fail (text != NULL);
gtk_label_set_text (GTK_LABEL (area->priv->label),
text);
gtk_label_set_text (GTK_LABEL (area->priv->label), text);
}
void
@ -230,8 +221,7 @@ xed_progress_message_area_set_fraction (XedProgressMessageArea *area,
{
g_return_if_fail (XED_IS_PROGRESS_MESSAGE_AREA (area));
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (area->priv->progress),
fraction);
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (area->priv->progress), fraction);
}
void