fix(ui): use folder tree icon for submodules
This commit is contained in:
@@ -182,7 +182,7 @@ std::optional<size_t> sidebar_section_index(std::string_view id) {
|
|||||||
if (id == ICON_TB_DESKTOP " LOCAL") return 0;
|
if (id == ICON_TB_DESKTOP " LOCAL") return 0;
|
||||||
if (id == ICON_TB_CLOUD " REMOTE") return 1;
|
if (id == ICON_TB_CLOUD " REMOTE") return 1;
|
||||||
if (id == ICON_TB_TREE " WORKTREES") return 2;
|
if (id == ICON_TB_TREE " WORKTREES") return 2;
|
||||||
if (id == ICON_TB_LAYERS_LINKED " SUBMODULES") return 3;
|
if (id == ICON_TB_FOLDER_TREE " SUBMODULES") return 3;
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1435,7 +1435,7 @@ void draw_sidebar(float width) {
|
|||||||
{ICON_TB_DESKTOP, "Local branches", repo().local_branches.size()},
|
{ICON_TB_DESKTOP, "Local branches", repo().local_branches.size()},
|
||||||
{ICON_TB_CLOUD, "Remote branches", repo().remote_branches.size()},
|
{ICON_TB_CLOUD, "Remote branches", repo().remote_branches.size()},
|
||||||
{ICON_TB_TREE, "Worktrees", repo().worktrees.size()},
|
{ICON_TB_TREE, "Worktrees", repo().worktrees.size()},
|
||||||
{ICON_TB_LAYERS_LINKED, "Submodules", repo().submodules.size()},
|
{ICON_TB_FOLDER_TREE, "Submodules", repo().submodules.size()},
|
||||||
};
|
};
|
||||||
for (size_t index = 0; index < std::size(sections); ++index) {
|
for (size_t index = 0; index < std::size(sections); ++index) {
|
||||||
ImGui::PushID(static_cast<int>(index));
|
ImGui::PushID(static_cast<int>(index));
|
||||||
@@ -1508,7 +1508,7 @@ void draw_sidebar(float width) {
|
|||||||
ICON_TB_DESKTOP " LOCAL",
|
ICON_TB_DESKTOP " LOCAL",
|
||||||
ICON_TB_CLOUD " REMOTE",
|
ICON_TB_CLOUD " REMOTE",
|
||||||
ICON_TB_TREE " WORKTREES",
|
ICON_TB_TREE " WORKTREES",
|
||||||
ICON_TB_LAYERS_LINKED " SUBMODULES",
|
ICON_TB_FOLDER_TREE " SUBMODULES",
|
||||||
};
|
};
|
||||||
std::array<bool, 4> section_open{};
|
std::array<bool, 4> section_open{};
|
||||||
std::vector<size_t> open_indices;
|
std::vector<size_t> open_indices;
|
||||||
@@ -1556,7 +1556,7 @@ void draw_sidebar(float width) {
|
|||||||
section_heights[2],
|
section_heights[2],
|
||||||
next_open_indices[2] < section_open.size() ? section_heights[next_open_indices[2]] / g_ui_scale : 0.0f,
|
next_open_indices[2] < section_open.size() ? section_heights[next_open_indices[2]] / g_ui_scale : 0.0f,
|
||||||
minimum_height, next_open_indices[2], next_open_indices[2] != last_open, section_open[2] && last_open != 2);
|
minimum_height, next_open_indices[2], next_open_indices[2] != last_open, section_open[2] && last_open != 2);
|
||||||
section(ICON_TB_LAYERS_LINKED " SUBMODULES", repo().submodules, ICON_TB_LAYERS_LINKED,
|
section(ICON_TB_FOLDER_TREE " SUBMODULES", repo().submodules, ICON_TB_FOLDER_TREE,
|
||||||
"Add submodule", "Add submodule", SidebarItemKind::submodule, 3,
|
"Add submodule", "Add submodule", SidebarItemKind::submodule, 3,
|
||||||
section_heights[3], 0.0f, minimum_height, section_open.size(), false, false);
|
section_heights[3], 0.0f, minimum_height, section_open.size(), false, false);
|
||||||
ImGui::PopStyleVar();
|
ImGui::PopStyleVar();
|
||||||
|
|||||||
Reference in New Issue
Block a user