xed-statusbar.c/h: Clean up code styling

This commit is contained in:
JosephMcc 2017-01-13 03:21:50 -08:00
parent 9dc61e0df5
commit c5d8a4378a
2 changed files with 65 additions and 88 deletions

View File

@ -114,25 +114,18 @@ xed_statusbar_init (XedStatusbar *statusbar)
gtk_widget_set_margin_bottom (GTK_WIDGET (statusbar), 0);
statusbar->priv->overwrite_mode_label = gtk_label_new (NULL);
gtk_label_set_width_chars (GTK_LABEL (statusbar->priv->overwrite_mode_label),
get_overwrite_mode_length ());
gtk_label_set_width_chars (GTK_LABEL (statusbar->priv->overwrite_mode_label), get_overwrite_mode_length ());
gtk_widget_show (statusbar->priv->overwrite_mode_label);
gtk_box_pack_end (GTK_BOX (statusbar),
statusbar->priv->overwrite_mode_label,
FALSE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (statusbar), statusbar->priv->overwrite_mode_label, FALSE, TRUE, 0);
gtk_widget_set_margin_right (GTK_WIDGET (statusbar->priv->overwrite_mode_label), 6);
statusbar->priv->cursor_position_label = gtk_label_new (NULL);
gtk_label_set_width_chars (GTK_LABEL (statusbar->priv->cursor_position_label),
CURSOR_POSITION_LABEL_WIDTH_CHARS);
gtk_label_set_width_chars (GTK_LABEL (statusbar->priv->cursor_position_label), CURSOR_POSITION_LABEL_WIDTH_CHARS);
gtk_widget_show (statusbar->priv->cursor_position_label);
gtk_box_pack_end (GTK_BOX (statusbar),
statusbar->priv->cursor_position_label,
FALSE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (statusbar), statusbar->priv->cursor_position_label, FALSE, TRUE, 0);
statusbar->priv->state_frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (statusbar->priv->state_frame),
GTK_SHADOW_IN);
gtk_frame_set_shadow_type (GTK_FRAME (statusbar->priv->state_frame), GTK_SHADOW_IN);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (statusbar->priv->state_frame), hbox);
@ -143,19 +136,11 @@ xed_statusbar_init (XedStatusbar *statusbar)
gtk_widget_show (hbox);
gtk_box_pack_start (GTK_BOX (hbox),
statusbar->priv->load_image,
FALSE, TRUE, 4);
gtk_box_pack_start (GTK_BOX (hbox),
statusbar->priv->save_image,
FALSE, TRUE, 4);
gtk_box_pack_start (GTK_BOX (hbox),
statusbar->priv->print_image,
FALSE, TRUE, 4);
gtk_box_pack_start (GTK_BOX (hbox), statusbar->priv->load_image, FALSE, TRUE, 4);
gtk_box_pack_start (GTK_BOX (hbox), statusbar->priv->save_image, FALSE, TRUE, 4);
gtk_box_pack_start (GTK_BOX (hbox), statusbar->priv->print_image, FALSE, TRUE, 4);
gtk_box_pack_start (GTK_BOX (statusbar),
statusbar->priv->state_frame,
FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (statusbar), statusbar->priv->state_frame, FALSE, TRUE, 0);
statusbar->priv->error_frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (statusbar->priv->error_frame), GTK_SHADOW_IN);
@ -168,18 +153,13 @@ xed_statusbar_init (XedStatusbar *statusbar)
gtk_widget_set_margin_bottom (error_image, 0);
statusbar->priv->error_event_box = gtk_event_box_new ();
gtk_event_box_set_visible_window (GTK_EVENT_BOX (statusbar->priv->error_event_box),
FALSE);
gtk_event_box_set_visible_window (GTK_EVENT_BOX (statusbar->priv->error_event_box), FALSE);
gtk_widget_show (statusbar->priv->error_event_box);
gtk_container_add (GTK_CONTAINER (statusbar->priv->error_frame),
statusbar->priv->error_event_box);
gtk_container_add (GTK_CONTAINER (statusbar->priv->error_event_box),
error_image);
gtk_container_add (GTK_CONTAINER (statusbar->priv->error_frame), statusbar->priv->error_event_box);
gtk_container_add (GTK_CONTAINER (statusbar->priv->error_event_box), error_image);
gtk_box_pack_start (GTK_BOX (statusbar),
statusbar->priv->error_frame,
FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (statusbar), statusbar->priv->error_frame, FALSE, TRUE, 0);
gtk_style_context_add_class (gtk_widget_get_style_context (statusbar), "xed-statusbar");
}
@ -305,9 +285,7 @@ xed_statusbar_flash_message (XedStatusbar *statusbar,
}
statusbar->priv->flash_context_id = context_id;
statusbar->priv->flash_message_id = gtk_statusbar_push (GTK_STATUSBAR (statusbar),
context_id,
msg);
statusbar->priv->flash_message_id = gtk_statusbar_push (GTK_STATUSBAR (statusbar), context_id, msg);
statusbar->priv->flash_timeout = g_timeout_add (flash_length,
(GSourceFunc) remove_message_timeout,
@ -354,8 +332,7 @@ xed_statusbar_set_window_state (XedStatusbar *statusbar,
num_of_errors),
num_of_errors);
gtk_widget_set_tooltip_text (statusbar->priv->error_event_box,
tip);
gtk_widget_set_tooltip_text (statusbar->priv->error_event_box, tip);
g_free (tip);
gtk_widget_show (statusbar->priv->error_frame);