Skip to content

Commit 8017401

Browse files
committed
Make TabbedPanelImage/Label mode-aware for icon extraction
In RmlUi mode, return plain tables instead of Chili objects so ActionButton can extract file/caption properties. Enables proper icon rendering in RmlUi action buttons.
1 parent b3768fc commit 8017401

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

scen_edit/view/main_window/main_window_panel.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ function TabbedPanelButton(tbl)
3131
end
3232

3333
function TabbedPanelImage(tbl)
34+
-- In RmlUi mode, just return the table with file property for extraction
35+
if SB.view and SB.view.useRmlUi then
36+
return tbl -- Return plain table { file = "..." }
37+
end
38+
39+
-- Chili mode - create actual Image object
3440
return Image:New(Table.Merge({
3541
width = SB.conf.TOOLBOX_ITEM_WIDTH / 2,
3642
height = SB.conf.TOOLBOX_ITEM_HEIGHT / 2,
@@ -41,6 +47,12 @@ function TabbedPanelImage(tbl)
4147
end
4248

4349
function TabbedPanelLabel(tbl)
50+
-- In RmlUi mode, just return the table with caption property for extraction
51+
if SB.view and SB.view.useRmlUi then
52+
return tbl -- Return plain table { caption = "..." }
53+
end
54+
55+
-- Chili mode - create actual Label object
4456
return Label:New(Table.Merge({
4557
bottom = SB.conf.TOOLBOX_ITEM_HEIGHT / 8,
4658
width = SB.conf.TOOLBOX_ITEM_WIDTH,

0 commit comments

Comments
 (0)