AdwPreferencesRow opposes vertical expansion

I cannot understand why a AdwPreferencesRow resists to expanding according to its content.

Is there a way to set the vexpand property of an AdwPreferencesRow’s child to true and see the row actually expand? In the following code the row’s height never occupies all the available space.

...

GtkWidget
	* const my_prefgroup = adw_preferences_group_new(),
	* const my_row = adw_preferences_row_new(),
	* const my_scrolled = g_object_new(
		GTK_TYPE_SCROLLED_WINDOW,
		"vexpand", true, /* I would expect this to make the row grow! */
		"child", my_content,
		NULL
	);

gtk_list_box_row_set_child(GTK_LIST_BOX_ROW(my_row), my_scrolled);
gtk_list_box_row_set_activatable(GTK_LIST_BOX_ROW(my_row), false);
adw_preferences_group_add(ADW_PREFERENCES_GROUP(my_prefgroup), my_row);

...

Alternatively, how can I get the expected result without having to set width and height with explicit numeric values?

―madmurphy

What are you implementing? A list row with a scrolled window inside it doesn’t looks like a good idea.

An emblem picker widget. Goals:

  • Support for :selected and :indeterminate CSS pseudo-classes (for selections of multiple files with inconsistent emblems) (DONE)
  • Possibility to show in form of text the emblems that are not present in the theme (DONE)
  • Possibility to force XDG standard emblems even if these are not present in the theme (DONE)
  • Cool interface (ALMOST THERE)

emblem-picker

(this is only a prototype – the popover menu has nothing to do with the widget; I have chosen it as a container only because the picker widget must be small enough to fit inside)

It doesn’t look like a good idea because it doesn’t work properly concerning the height. However I have dropped the plan. The scrolled windows now are not nested inside preference rows anymore.

―madmurphy

Why does any of that involve AdwPreferencesRow?..

The button for the “Unknown emblems” is already an AdwActionRow. It looks visually coherent if other AdwPreferencesRow are around. But, as I said, now I have dropped the plan.

So you want a card?

Indeed, I think that is exactly what I wanted. Thank you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.