If topbar_content_width() is more than the topbar's width, then
topbar buttons need to be added to the collapsed buttons layout
until the topbar is not smaller than the width of its contents.
When the first text button is collapsed, the collapse button
appears in its place, and that is all that happens visually.
However, after subsequent text buttons are collapsed, you need
to remove the arrow graphic positioned to the left (ALSO known
as the second arrow) of the collapsing text button.
The very last text button in the topbar should not be able to
collapse. It represents the current widget label. If more room
is needed, may consider a way to collapse the 'Window' text
button after this point.
Scaling Up:
If topbar_content_width() is less than the topbar's width, and
there happen to be collapsed text buttons, then:
Calculate what the topbar content width would be after
adding the last text button in the collapse buttons list.
This calculation needs to include the added arrow graphic
and general spacing.
If the calculated topbar content width is less than the
topbar width, move the text button to the topbar layout.
Ignore otherwise.
Try again until the calculated width is more than the
topbar width.
When the last collapsed text button is moved back, hide the
collapse button and do not add an arrow graphic.
Navigating Panels
Navigating to deeper panels from element buttons can only cause
a 'Scaling down' situation where the topbar content width ends
up exceeding the topbar width, and text buttons end up
collapsing. In no situation will this lead to text buttons
being de-collapsed.
Clicking on text buttons that are collapsed:
This scenario can only lead to a 'Scaling up' situation
where the topbar buttons de-collapse