File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -161,7 +161,16 @@ static void apply_entry_content_layout(ui_menu_t *menu, int index) {
161161 int32_t natural_label_width =
162162 measure_label_text_width (view -> label , UI_MENU_TEXT_MEASURE_MAX ) +
163163 UI_MENU_TEXT_WIDTH_PAD ;
164- int32_t label_width = LV_MIN (label_max_width , natural_label_width );
164+ int32_t label_width ;
165+ if (natural_label_width <= label_max_width ) {
166+ label_width = natural_label_width ;
167+ } else {
168+ /* Text wraps: size the label to its widest wrapped line, not the full
169+ max width, so centered multi-line text stays tight against the icon
170+ instead of leaving a gap on the left. */
171+ label_width = measure_label_text_width (view -> label , label_max_width ) +
172+ UI_MENU_TEXT_WIDTH_PAD ;
173+ }
165174 int32_t content_width = label_width ;
166175
167176 if (has_icon )
You can’t perform that action at this time.
0 commit comments