subiquity/subiquitycore/ui
Michael Hudson-Doyle 3bdca52ed4 Tweak the adjustment of table columns widths for cells with colspan > 1
When allocating space for a cell colspan > 1, preferentially
allocate space to columns that have no colspan = 1 cells. If you
have content like this (content padded to 10 and 20 chars to make
calculations easier):

[[(2, "longer content567890"), "shorter890"],
 ["shorter890", (2, "longer content567890")]]

Taking only colspan = 1 cells into account, the widths of the
columns are (10, 0, 10).

To fit the first longer content in, the current algorithm expands
the first two columns equally, so the widths become (15, 5, 10).

Then to fit the second longer content in, the second two columns
are widened equally (or nearly so), resulting in final widths
of (15, 8, 12) and a table layout like this:

    +-------------------------+--------------+
    | longer content567890    | shorter890   |
    +-----------------+-------+--------------+
    | shorter890      | longer content567890 |
    +-----------------+----------------------+

which is bizarrely asymmetrical given the input and wider than it
needs to be.

If instead we preferentially widen columns that have no width
from colspan = 1 columns, we get this layout:

    +----------------------+------------+
    | longer content567890 | shorter890 |
    +------------+---------+------------+
    | shorter890 | longer content567890 |
    +------------+----------------------+

Which is much more in line with my expectations.
2019-05-30 15:10:34 +12:00
..
tests Tweak the adjustment of table columns widths for cells with colspan > 1 2019-05-30 15:10:34 +12:00
views small fixes 2019-03-26 11:32:02 +13:00
__init__.py Rename subiquity to subiquitycore -- will serve as base classes for everything 2016-06-30 14:17:01 -04:00
actionmenu.py unify "action menu row" creation 2018-07-06 13:57:55 +12:00
anchors.py move snap title into header 2019-02-27 15:56:02 +13:00
buttons.py change " menu >" to "[ menu ▸ ]" 2018-06-26 10:19:57 +12:00
container.py fix some dodgy algebra in scrollbars 2019-02-27 14:28:05 +13:00
form.py move ssh key fetching over to ssh view 2018-12-13 14:15:43 +13:00
frame.py use our custom WidgetWrap everywhere 2018-06-22 09:38:18 +12:00
interactive.py use our custom WidgetWrap everywhere 2018-06-22 09:38:18 +12:00
selector.py Merge pull request #373 from mwhudson/raid-the-fourth 2018-06-27 11:06:43 +12:00
spinner.py move spinner to subiquitycore 2019-03-21 14:48:48 +13:00
stretchy.py fix stupid failure of arithmetic in stretchy 2018-06-25 22:57:57 +12:00
table.py Tweak the adjustment of table columns widths for cells with colspan > 1 2019-05-30 15:10:34 +12:00
utils.py do storage probing in the background 2019-04-29 15:54:47 +12:00
width.py add form fields to ssh view 2018-12-13 14:15:43 +13:00