diff options
| author | Simon Glass <[email protected]> | 2024-10-14 16:31:55 -0600 |
|---|---|---|
| committer | Simon Glass <[email protected]> | 2024-10-18 14:10:22 -0600 |
| commit | 54eca1d39bc980a7e99af53a5b32443d5774b1a0 (patch) | |
| tree | 5c916e05eba224de4602a072a2ed2e3eeff67ac3 /include | |
| parent | 18a85cf7b5da3b8fabfed809cc972f0b58279620 (diff) | |
expo: Place menu items to the right of all labels
At present a fixed position is used for menu items, 200 pixels to the
right of the left side of the labels. This means that a menu item with
a very long label may overlap the items.
It seems better to calculate the maximum label width and then place the
items to the right of all of them.
To implement this, add a new struct to containing arrangement
information. Calculate it before doing the actual arrangement. Add a
new style item which sets the amount of space from the right side of
the labels to left side of the items.
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/expo.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/expo.h b/include/expo.h index c235fa2709d..50e11cd118c 100644 --- a/include/expo.h +++ b/include/expo.h @@ -59,11 +59,14 @@ struct expo_action { * @font_size: Default font size for all text * @menu_inset: Inset width (on each side and top/bottom) for menu items * @menuitem_gap_y: Gap between menu items in pixels + * @menu_title_margin_x: Gap between right side of menu title and left size of + * menu label */ struct expo_theme { u32 font_size; u32 menu_inset; u32 menuitem_gap_y; + u32 menu_title_margin_x; }; /** @@ -342,6 +345,15 @@ struct scene_obj_textline { }; /** + * struct expo_arrange_info - Information used when arranging a scene + * + * @label_width: Maximum width of labels in scene + */ +struct expo_arrange_info { + int label_width; +}; + +/** * expo_new() - create a new expo * * Allocates a new expo |
