Skip to content

Commit 75e9b5c

Browse files
committed
Merge: rich inspector + working Open buttons
2 parents 9852199 + 8f11427 commit 75e9b5c

2 files changed

Lines changed: 277 additions & 48 deletions

File tree

libs/FastSenseCompanion/DashboardListPane.m

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,16 +378,26 @@ function onRowClicked_(obj, engineIdx)
378378
end
379379

380380
function onOpenClicked_(obj, engineIdx)
381-
%ONOPENCLICKED_ Handle Open button press — fire event and call engine.render().
381+
%ONOPENCLICKED_ Handle Open button press — fire event, then bring
382+
% the dashboard figure forward (rendering it first if it doesn't
383+
% exist yet, or focusing the existing one if it does).
384+
%
385+
% DashboardEngine.render() is idempotent (early-returns when the
386+
% figure is already valid). To "open" an already-rendered
387+
% dashboard the user expects the figure to be brought to front.
382388
try
383389
obj.SelectedIdx_ = engineIdx;
384390
% Fire OpenDashboardRequested
385391
notify(obj, 'OpenDashboardRequested', ...
386392
DashboardEventData(obj.Engines_{engineIdx}, engineIdx));
387393
engine = obj.Engines_{engineIdx};
388-
% Attempt render in inner try/catch so companion stays alive on error
389394
try
390-
engine.render();
395+
if isempty(engine.hFigure) || ~ishandle(engine.hFigure)
396+
engine.render();
397+
end
398+
if ~isempty(engine.hFigure) && ishandle(engine.hFigure)
399+
figure(engine.hFigure); % bring to front / focus
400+
end
391401
catch ME
392402
uialert(obj.hFig_, ...
393403
sprintf('Failed to open dashboard "%s": %s', engine.Name, ME.message), ...

0 commit comments

Comments
 (0)