forked from AuroraMiddleware/gtk
flowbox: Always return a NULL iter when we are at the end
The objective is simplify the semantics of the code so that we don't need to check for "(iter != NULL && !g_sequence_iter_is_end (iter))" in the callers.
This commit is contained in:
parent
65dd26d3f3
commit
bcc6979f89
@ -1198,7 +1198,7 @@ gtk_flow_box_get_next_focusable (GtkFlowBox *box,
|
||||
{
|
||||
iter = g_sequence_iter_next (iter);
|
||||
if (g_sequence_iter_is_end (iter))
|
||||
return iter;
|
||||
return NULL;
|
||||
child = g_sequence_get (iter);
|
||||
if (child_is_visible (GTK_WIDGET (child)) &&
|
||||
gtk_widget_is_sensitive (GTK_WIDGET (child)))
|
||||
@ -1276,7 +1276,7 @@ gtk_flow_box_get_below_focusable (GtkFlowBox *box,
|
||||
{
|
||||
iter = g_sequence_iter_next (iter);
|
||||
if (g_sequence_iter_is_end (iter))
|
||||
return iter;
|
||||
return NULL;
|
||||
child = g_sequence_get (iter);
|
||||
if (child_is_visible (GTK_WIDGET (child)))
|
||||
i++;
|
||||
@ -3200,7 +3200,7 @@ gtk_flow_box_focus (GtkWidget *widget,
|
||||
else if (direction == GTK_DIR_DOWN)
|
||||
iter = gtk_flow_box_get_below_focusable (box, iter);
|
||||
|
||||
if (iter != NULL && !g_sequence_iter_is_end (iter))
|
||||
if (iter != NULL)
|
||||
next_focus_child = g_sequence_get (iter);
|
||||
}
|
||||
else
|
||||
@ -3214,7 +3214,7 @@ gtk_flow_box_focus (GtkWidget *widget,
|
||||
else
|
||||
iter = gtk_flow_box_get_first_focusable (box);
|
||||
|
||||
if (iter != NULL && !g_sequence_iter_is_end (iter))
|
||||
if (iter != NULL)
|
||||
next_focus_child = g_sequence_get (iter);
|
||||
}
|
||||
}
|
||||
@ -3366,7 +3366,7 @@ gtk_flow_box_move_cursor (GtkFlowBox *box,
|
||||
iter = gtk_flow_box_get_first_focusable (box);
|
||||
else
|
||||
iter = gtk_flow_box_get_last_focusable (box);
|
||||
if (iter != NULL && !g_sequence_iter_is_end (iter))
|
||||
if (iter != NULL)
|
||||
child = g_sequence_get (iter);
|
||||
break;
|
||||
|
||||
@ -3386,7 +3386,7 @@ gtk_flow_box_move_cursor (GtkFlowBox *box,
|
||||
count = count - 1;
|
||||
}
|
||||
|
||||
if (iter != NULL && !g_sequence_iter_is_end (iter))
|
||||
if (iter != NULL)
|
||||
child = g_sequence_get (iter);
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user