Добавлены остальные инструменты

This commit is contained in:
2026-02-25 23:20:30 +03:00
parent 65ca468bfb
commit 790200be2a
8 changed files with 84 additions and 9 deletions

View File

@@ -196,16 +196,21 @@ fn drawToolbar(canvas: *Canvas) void {
},
);
{
var to_select: ?usize = null;
for (tools_list, 0..) |*tool_desc, i| {
const is_selected = (canvas.toolbar.selected_index == i);
const is_selected = canvas.toolbar.selected_index == i;
const selected_fill = dvui.themeGet().focus;
const opts: dvui.Options = .{
.id_extra = i,
.color_fill = if (is_selected) dvui.themeGet().fill else undefined,
.color_fill = if (is_selected) selected_fill else null,
};
if (dvui.buttonIcon(@src(), tool_desc.name, tool_desc.icon_tvg, .{}, .{}, opts)) {
canvas.toolbar.select(i);
to_select = i;
}
}
if (to_select) |index| {
canvas.toolbar.select(index);
}
}
bar.deinit();
}