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
52323e2620
commit
e1224f499e
1 changed files with 6 additions and 1 deletions
|
@ -423,14 +423,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