Skip to content
This repository has been archived by the owner on Aug 15, 2022. It is now read-only.

Commit

Permalink
Lock file tree header during scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadelessFox committed Oct 18, 2020
1 parent ad4282f commit 8d5b4e7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/decima/archive/archive_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,29 @@ void FileTree::reset_filter(bool visibility) {

void FileTree::draw(SelectionInfo& selection, Decima::ArchiveManager& manager, bool header, ExpandMode expand) {
if (header) {
ImGui::BeginChild(ImGui::GetID("TreeView"));

ImGui::Separator();

ImGui::Columns(3);
ImGui::SetColumnWidth(0, ImGui::GetWindowWidth() - 200);
ImGui::SetColumnWidth(1, 100);
ImGui::SetColumnWidth(2, 100);

ImGui::Text("Name");
ImGui::NextColumn();
ImGui::Text("Type");
ImGui::NextColumn();
ImGui::Text("Size");
ImGui::NextColumn();

ImGui::Separator();

ImGui::Columns(1);

ImGui::BeginChild(ImGui::GetID("TreeViewContents"));

ImGui::Columns(3);
ImGui::SetColumnWidth(0, ImGui::GetWindowWidth() - 200);
ImGui::SetColumnWidth(1, 100);
ImGui::SetColumnWidth(2, 100);
Expand Down Expand Up @@ -260,6 +273,8 @@ void FileTree::draw(SelectionInfo& selection, Decima::ArchiveManager& manager, b

if (header) {
ImGui::Columns(1);
ImGui::EndChild();
ImGui::EndChild();
}
}

Expand Down

0 comments on commit 8d5b4e7

Please sign in to comment.