Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!1567
This commit is contained in:
Matthias Clasen 2020-03-26 01:54:30 +00:00
commit cc9c45a47a
5 changed files with 33 additions and 1 deletions

View File

@ -1316,6 +1316,7 @@ GtkFlattenListModel
gtk_flatten_list_model_new
gtk_flatten_list_model_set_model
gtk_flatten_list_model_get_model
gtk_flatten_list_model_get_model_for_item
<SUBSECTION Standard>
GTK_FLATTEN_LIST_MODEL
GTK_IS_FLATTEN_LIST_MODEL

View File

@ -35,7 +35,6 @@
#include "gtkwidgetprivate.h"
#include "gtkeventcontrollerprivate.h"
#include "gtkeventcontrollerfocus.h"
#include "gtkbindings.h"
#include "gtkenums.h"
#include "gtkmain.h"
#include "gtktypebuiltins.h"

View File

@ -539,3 +539,28 @@ gtk_flatten_list_model_get_model (GtkFlattenListModel *self)
return self->model;
}
/**
* gtk_flatten_list_model_get_model_for_item:
* @self: a #GtkFlattenListModel
* @position: a position
*
* Returns the model containing the item at the given position.
*
* Returns: (transfer none): the model containing the item at @position
*/
GListModel *
gtk_flatten_list_model_get_model_for_item (GtkFlattenListModel *self,
guint position)
{
FlattenNode *node;
if (!self->items)
return NULL;
node = gtk_flatten_list_model_get_nth (self->items, position, NULL);
if (node == NULL)
return NULL;
return node->model;
}

View File

@ -45,6 +45,10 @@ void gtk_flatten_list_model_set_model (GtkFlattenListM
GDK_AVAILABLE_IN_ALL
GListModel * gtk_flatten_list_model_get_model (GtkFlattenListModel *self);
GDK_AVAILABLE_IN_ALL
GListModel * gtk_flatten_list_model_get_model_for_item (GtkFlattenListModel *self,
guint position);
G_END_DECLS
#endif /* __GTK_FLATTEN_LIST_MODEL_H__ */

View File

@ -4441,6 +4441,9 @@ gtk_text_view_size_allocate (GtkWidget *widget,
if (priv->text_handles[TEXT_HANDLE_SELECTION_BOUND])
gtk_native_check_resize (GTK_NATIVE (priv->text_handles[TEXT_HANDLE_SELECTION_BOUND]));
if (priv->selection_bubble)
gtk_native_check_resize (GTK_NATIVE (priv->selection_bubble));
}
static void