Commit 03ab195b authored by Jan-Michael Brummer's avatar Jan-Michael Brummer
Browse files

Add hdy_preferences_group_get_listbox

Add access function to internal listbox in preferences group to handle special cases like DnD
parent 142b65a2
Pipeline #50734 passed with stages
in 11 minutes and 28 seconds
......@@ -119,6 +119,11 @@
<xi:include href="xml/api-index-0.0.12.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-0-0-14" role="0.0.14">
<title>Index of new symbols in 0.0.14</title>
<xi:include href="xml/api-index-0.0.14.xml"><xi:fallback /></xi:include>
</index>
<index id="annotations-glossary">
<title>Annotations glossary</title>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
......
......@@ -423,3 +423,23 @@ hdy_preferences_group_add_preferences_to_model (HdyPreferencesGroup *self,
gtk_container_foreach (GTK_CONTAINER (priv->listbox), (GtkCallback) add_preferences_to_model, model);
}
/**
* hdy_preferences_group_get_listbox:
* @self: a #HdyPreferencesGroup
*
* Get internal listbox widget from @self.
*
* Returns: (transfer none) (nullable): the #GtkListBox or %NULL if no widget is set
*
* Since: 0.0.14
*/
GtkWidget *
hdy_preferences_group_get_listbox (HdyPreferencesGroup *self)
{
HdyPreferencesGroupPrivate *priv = hdy_preferences_group_get_instance_private (self);
g_return_val_if_fail (HDY_IS_PREFERENCES_GROUP (self), NULL);
return GTK_WIDGET (priv->listbox);
}
......@@ -37,4 +37,6 @@ const gchar *hdy_preferences_group_get_description (HdyPreferencesGroup *self);
void hdy_preferences_group_set_description (HdyPreferencesGroup *self,
const gchar *description);
GtkWidget *hdy_preferences_group_get_listbox (HdyPreferencesGroup *self);
G_END_DECLS
......@@ -67,6 +67,18 @@ test_hdy_preferences_group_description (void)
}
static void
test_hdy_preferences_group_listbox (void)
{
g_autoptr (HdyPreferencesGroup) group = NULL;
group = g_object_ref_sink (HDY_PREFERENCES_GROUP (hdy_preferences_group_new ()));
g_assert_nonnull (group);
g_assert_nonnull (hdy_preferences_group_get_listbox (group));
}
gint
main (gint argc,
gchar *argv[])
......@@ -77,6 +89,7 @@ main (gint argc,
g_test_add_func("/Handy/PreferencesGroup/add", test_hdy_preferences_group_add);
g_test_add_func("/Handy/PreferencesGroup/title", test_hdy_preferences_group_title);
g_test_add_func("/Handy/PreferencesGroup/description", test_hdy_preferences_group_description);
g_test_add_func("/Handy/PreferencesGroup/listbox", test_hdy_preferences_group_listbox);
return g_test_run();
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment