- if (tree_column->show_sort_indicator)
- {
- gboolean alternative;
-
- g_object_get (gtk_widget_get_settings (tree_column->tree_view),
- "gtk-alternative-sort-arrows", &alternative,
- NULL);
-
- switch (tree_column->sort_order)
- {
- case GTK_SORT_ASCENDING:
- arrow_type = alternative ? GTK_ARROW_UP : GTK_ARROW_DOWN;
- break;
-
- case GTK_SORT_DESCENDING:
- arrow_type = alternative ? GTK_ARROW_DOWN : GTK_ARROW_UP;
- break;
-
- default:
- g_warning (G_STRLOC": bad sort order");
- break;
- }
- }
-
- gtk_arrow_set (GTK_ARROW (arrow),
- arrow_type,
- GTK_SHADOW_IN);
-
- /* Put arrow on the right if the text is left-or-center justified, and on the
- * left otherwise; do this by packing boxes, so flipping text direction will
- * reverse things
- */
- g_object_ref (arrow);
- gtk_container_remove (GTK_CONTAINER (hbox), arrow);
-
- if (tree_column->xalign <= 0.5)
- {
- gtk_box_pack_end (GTK_BOX (hbox), arrow, FALSE, FALSE, 0);
- }
- else
- {
- gtk_box_pack_start (GTK_BOX (hbox), arrow, FALSE, FALSE, 0);
- /* move it to the front */
- gtk_box_reorder_child (GTK_BOX (hbox), arrow, 0);
- }
- g_object_unref (arrow);
-
- if (tree_column->show_sort_indicator
- || (GTK_IS_TREE_SORTABLE (model) && tree_column->sort_column_id >= 0))
- gtk_widget_show (arrow);
- else
- gtk_widget_hide (arrow);