Skip to content

Commit 33a3f75

Browse files
committed
Merge: scrollable multitag inspector
2 parents 7fb4114 + 5f0ed1c commit 33a3f75

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

libs/FastSenseCompanion/InspectorPane.m

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ function attach(obj, parentPanel, hFig, catalogPane, orchestrator, theme)
8282
obj.hContent_.RowHeight = {'1x'};
8383
obj.hContent_.ColumnWidth = {'1x'};
8484
obj.hContent_.BackgroundColor = obj.Theme_.WidgetBackground;
85-
obj.hContent_.Scrollable = 'on'; % R2020b+ supports this on uigridlayout
85+
% Note: per-renderer outer grids set Scrollable='on' themselves
86+
% so they scroll when their fixed rows overflow the panel
87+
% (e.g. multitag with many preview cards). Setting Scrollable
88+
% here too is harmless but redundant.
89+
obj.hContent_.Scrollable = 'on';
8690
obj.renderState_();
8791
end
8892

@@ -916,21 +920,23 @@ function renderMultitag_(obj)
916920
nT = numel(tags);
917921

918922
% Per-card height: 16 (name row) + 60 (sparkline) + 14 (range) +
919-
% 4 spacing = ~94. Use 94 to give the sparkline some breathing.
923+
% spacing ≈ 94. The grid uses Scrollable='on' so 11 cards
924+
% spilling past the panel height will scroll instead of
925+
% squashing.
920926
cardH = 94;
921-
nRows = nT + 4; % header + N cards + mode + plot + spacer
927+
nRows = nT + 3; % header + N cards + mode + plot
922928
rowH = cell(1, nRows);
923929
rowH{1} = 24;
924930
for k = 1:nT; rowH{1 + k} = cardH; end
925931
rowH{nT + 2} = 28; % mode toggle row
926932
rowH{nT + 3} = 32; % plot button
927-
rowH{nT + 4} = '1x'; % bottom spacer
928933

929934
g = uigridlayout(obj.hContent_, [nRows 1]);
930935
g.RowHeight = rowH;
931936
g.ColumnWidth = {'1x'};
932937
g.Padding = [16 16 16 16]; g.RowSpacing = 6;
933938
g.BackgroundColor = t.WidgetBackground;
939+
g.Scrollable = 'on';
934940

935941
hHdr = uilabel(g); hHdr.Layout.Row = 1; hHdr.Layout.Column = 1;
936942
hHdr.Text = sprintf('%d tags selected', nT);

0 commit comments

Comments
 (0)