Skip to content

Commit c4ab7f4

Browse files
committed
Merge: hContent_ as uigridlayout for top-anchor
2 parents 179094a + b80b944 commit c4ab7f4

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

libs/FastSenseCompanion/InspectorPane.m

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,18 @@ function attach(obj, parentPanel, hFig, catalogPane, orchestrator, theme)
5959
obj.ComposerMode_ = 'Overlay';
6060
obj.CurrentTagKeys_ = {};
6161
delete(obj.hPanel_.Children);
62-
obj.hContent_ = uipanel(obj.hPanel_);
63-
obj.hContent_.Units = 'normalized';
64-
obj.hContent_.Position = [0 0 1 1];
65-
obj.hContent_.Scrollable = 'on';
66-
obj.hContent_.BorderType = 'none';
62+
% hContent_ is a uigridlayout (NOT a Scrollable uipanel) so its
63+
% child grid is naturally top-aligned. Earlier iterations used
64+
% uipanel(Scrollable='on') which centered or bottom-aligned
65+
% fixed-height content, leaving the top of the right pane
66+
% blank. The uigridlayout outer-wrapper guarantees content sits
67+
% at the top.
68+
obj.hContent_ = uigridlayout(obj.hPanel_, [1 1]);
69+
obj.hContent_.Padding = [0 0 0 0];
70+
obj.hContent_.RowHeight = {'1x'};
71+
obj.hContent_.ColumnWidth = {'1x'};
6772
obj.hContent_.BackgroundColor = obj.Theme_.WidgetBackground;
73+
obj.hContent_.Scrollable = 'on'; % R2020b+ supports this on uigridlayout
6874
obj.renderState_();
6975
end
7076

0 commit comments

Comments
 (0)