Repository navigation
[GUI] Fix truncated Help, Cancel and OK buttons - #966
Conversation
Set the Help/Cancel/OK width in pixels from the rendered label instead of letting supergui scale it with the figure, which truncated the labels in narrow dialogs on high resolution displays. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Code review
Layouts, develop vs this branchMATLAB R2025b, macOS, 3440x1440 display. Six Each pushbutton's pixel
Every clipped label now fits, and no layout is clipped on either side. Margin fix (7ab34de)The first commit used a fixed
Narrow dialogs are unchanged by the second commit beyond a few pixels (pop_resample: Help x 10 -> 14, figure 276 -> 281), because the two borders nearly coincide there. Other checks
BlockingNone. ImportantNone remaining. The wide-dialog margin finding from the first review pass is fixed in 7ab34de. Nits
Test gapsNo automated check, which matches the repo (no central test suite). The regression is cheap to pin down if you want a snippet in the PR body or in inputgui('geometry', {[2 1]}, 'uilist', { {'style' 'text' 'string' 'Rate'} {'style' 'edit' 'string' '128'} }, ...
'helpcom', 'disp(1)', 'mode', 'plot');
h = findobj(gcf, 'style', 'pushbutton'); set(h, 'units', 'pixels');
p = get(h, 'position'); e = get(h, 'extent');
assert(all(cellfun(@(a,b) a(3) >= b(3), p, e)), 'button labels are clipped');EEGLAB notes
|
Keep the left and right margins supergui used for the bottom row instead of a fixed 10 px, so the buttons stay aligned with the columns above them in wide dialogs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>


The bottom buttons were sized in normalized units, so their pixel width followed the figure scaling factor and their labels were clipped in narrow dialogs (28 px wide buttons on a 3440 px display, 56 px on a 560 px default figure). They are now sized in pixels from the rendered label, and the figure is widened only when the row does not fit.
Checked on pop_resample and on the single help, double help, no help, wide, geomvert and geom layouts, plus a full pop_resample round trip on sample data.