xed-status-combo-box.c: Clean up some code styling

This commit is contained in:
JosephMcc 2017-01-01 16:12:36 -08:00
parent 8ebb54b824
commit b082e73a61
1 changed files with 36 additions and 49 deletions

View File

@ -117,9 +117,7 @@ xed_status_combo_box_destroy (GtkWidget *widget)
if (combo->priv->menu)
{
g_signal_handlers_disconnect_by_func (combo->priv->menu,
menu_deactivate,
combo);
g_signal_handlers_disconnect_by_func (combo->priv->menu, menu_deactivate, combo);
gtk_menu_detach (GTK_MENU (combo->priv->menu));
}
@ -232,8 +230,7 @@ show_menu (XedStatusComboBox *combo,
gint max_height;
GtkAllocation allocation;
gtk_widget_get_preferred_size (combo->priv->menu,
&request, NULL);
gtk_widget_get_preferred_size (combo->priv->menu, &request, NULL);
/* do something relative to our own height here, maybe we can do better */
gtk_widget_get_allocation (GTK_WIDGET (combo), &allocation);
@ -257,8 +254,7 @@ show_menu (XedStatusComboBox *combo,
if (combo->priv->current_item)
{
gtk_menu_shell_select_item (GTK_MENU_SHELL (combo->priv->menu),
combo->priv->current_item);
gtk_menu_shell_select_item (GTK_MENU_SHELL (combo->priv->menu), combo->priv->current_item);
}
}
@ -354,18 +350,12 @@ xed_status_combo_box_init (XedStatusComboBox *self)
gtk_box_pack_start (GTK_BOX (self->priv->hbox), self->priv->arrow, FALSE, TRUE, 0);
self->priv->menu = gtk_menu_new ();
gtk_menu_attach_to_widget (GTK_MENU (self->priv->menu),
GTK_WIDGET (self),
menu_detached);
gtk_menu_attach_to_widget (GTK_MENU (self->priv->menu), GTK_WIDGET (self), menu_detached);
g_signal_connect (self->priv->button,
"button-press-event",
G_CALLBACK (button_press_event),
self);
g_signal_connect (self->priv->menu,
"deactivate",
G_CALLBACK (menu_deactivate),
self);
g_signal_connect (self->priv->button, "button-press-event",
G_CALLBACK (button_press_event), self);
g_signal_connect (self->priv->menu, "deactivate",
G_CALLBACK (menu_deactivate), self);
context = gtk_widget_get_style_context (GTK_WIDGET (self->priv->button));
gtk_style_context_add_provider (context,
@ -449,8 +439,7 @@ xed_status_combo_box_remove_item (XedStatusComboBox *combo,
g_return_if_fail (XED_IS_STATUS_COMBO_BOX (combo));
g_return_if_fail (GTK_IS_MENU_ITEM (item));
gtk_container_remove (GTK_CONTAINER (combo->priv->menu),
GTK_WIDGET (item));
gtk_container_remove (GTK_CONTAINER (combo->priv->menu), GTK_WIDGET (item));
}
@ -496,10 +485,8 @@ xed_status_combo_box_set_item_text (XedStatusComboBox *combo,
g_return_if_fail (XED_IS_STATUS_COMBO_BOX (combo));
g_return_if_fail (GTK_IS_MENU_ITEM (item));
g_object_set_data_full (G_OBJECT (item),
COMBO_BOX_TEXT_DATA,
g_strdup (text),
(GDestroyNotify)g_free);
g_object_set_data_full (G_OBJECT (item), COMBO_BOX_TEXT_DATA,
g_strdup (text), (GDestroyNotify)g_free);
}
void