Skip to content

event-widget: Sizing overhaul

This reworks how GcalEventWidget handles its sizing by:

  • using an AdwSqueezer to automatically fall back from the vertical to the horizontal mode (simplifying the code)
  • allow narrow labels to wrap on chars in vertical mode (helping the widget to be narrow)
  • explicitely allow the labels to overflow the widget and hidding the overflow (helping the widget to be narrow)
  • ensuring we allocate the widgets at least what they request (fixing errors)

Before

Tons of errors like this:

(gnome-calendar:2): Gtk-CRITICAL **: 12:53:13.508: Allocation width too small. Tried to allocate 32x107, but GcalEventWidget 0x56540498bcf0 needs at least 51x107.

Screenshot_from_2022-05-05_12-54-25Screenshot_from_2022-05-05_12-54-14

After

No error message.

Screenshot_from_2022-05-05_12-55-11Screenshot_from_2022-05-05_12-55-24

Edited by Adrien Plazas

Merge request reports