Skip to content

Commit 42b2f97

Browse files
HanSur94claude
andcommitted
fix: DividerWidget renders without border chrome and detach button
DividerWidget now gets a borderless panel with the dashboard background color instead of the standard widget border. The detach button is also skipped for dividers since they are purely decorative separators. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d5559a2 commit 42b2f97

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

libs/Dashboard/DashboardLayout.m

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,22 @@ function allocatePanels(obj, hFigure, widgets, theme)
272272
w = widgets{i};
273273
w.ParentTheme = theme;
274274
pos = obj.computePosition(w.Position);
275-
hp = uipanel('Parent', obj.hCanvas, ...
276-
'Units', 'normalized', ...
277-
'Position', pos, ...
278-
'BorderType', 'line', ...
279-
'BorderWidth', theme.WidgetBorderWidth, ...
280-
'ForegroundColor', theme.WidgetBorderColor, ...
281-
'BackgroundColor', theme.WidgetBackground);
275+
isDivider = isa(w, 'DividerWidget');
276+
if isDivider
277+
hp = uipanel('Parent', obj.hCanvas, ...
278+
'Units', 'normalized', ...
279+
'Position', pos, ...
280+
'BorderType', 'none', ...
281+
'BackgroundColor', theme.DashboardBackground);
282+
else
283+
hp = uipanel('Parent', obj.hCanvas, ...
284+
'Units', 'normalized', ...
285+
'Position', pos, ...
286+
'BorderType', 'line', ...
287+
'BorderWidth', theme.WidgetBorderWidth, ...
288+
'ForegroundColor', theme.WidgetBorderColor, ...
289+
'BackgroundColor', theme.WidgetBackground);
290+
end
282291
w.hPanel = hp;
283292
uicontrol('Parent', hp, 'Style', 'text', 'Units', 'normalized', ...
284293
'Position', [0.05 0.4 0.9 0.2], ...
@@ -308,8 +317,8 @@ function realizeWidget(obj, widget)
308317
if ~isempty(widget.Description)
309318
obj.addInfoIcon(widget);
310319
end
311-
% Inject detach button when DetachCallback is wired
312-
if ~isempty(obj.DetachCallback)
320+
% Inject detach button when DetachCallback is wired (skip for dividers)
321+
if ~isempty(obj.DetachCallback) && ~isa(widget, 'DividerWidget')
313322
obj.addDetachButton(widget);
314323
end
315324
end

0 commit comments

Comments
 (0)