search: Prevent listbox placeholder from being treated like a row
The Search panel providers listbox has a placeholder label that is visible when there are no listbox items. The placeholder label is being considered in the list of children of the listbox while estimating whether "Moving down" is allowed for the listbox reorder feature.
This commit is contained in:
parent
1d00a94009
commit
0787182dd0
1 changed files with 6 additions and 1 deletions
|
@ -413,14 +413,19 @@ search_panel_update_enabled_move_actions (CcSearchPanel *self)
|
|||
child;
|
||||
child = gtk_widget_get_next_sibling (child))
|
||||
{
|
||||
GtkWidget *next_child;
|
||||
gint row_idx;
|
||||
|
||||
if (!CC_IS_SEARCH_PANEL_ROW (child))
|
||||
continue;
|
||||
|
||||
next_child = gtk_widget_get_next_sibling (GTK_WIDGET (child));
|
||||
if (!CC_IS_SEARCH_PANEL_ROW (next_child))
|
||||
continue;
|
||||
|
||||
row_idx = gtk_list_box_row_get_index (GTK_LIST_BOX_ROW (child));
|
||||
gtk_widget_action_set_enabled (GTK_WIDGET (child), "row.move-up", row_idx != 0);
|
||||
gtk_widget_action_set_enabled (GTK_WIDGET (child), "row.move-down", GTK_LIST_BOX_ROW (gtk_widget_get_next_sibling (GTK_WIDGET (child))) != NULL);
|
||||
gtk_widget_action_set_enabled (GTK_WIDGET (child), "row.move-down", GTK_LIST_BOX_ROW (next_child) != NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue