GUI: prepare to add a time bar to sample editor

This commit is contained in:
tildearrow 2022-12-09 03:51:41 -05:00
parent 3d191e247b
commit a512dd3c6b
1 changed files with 20 additions and 1 deletions

View File

@ -975,7 +975,26 @@ void FurnaceGUI::drawSampleEdit() {
ImGui::Separator();
ImVec2 avail=ImGui::GetContentRegionAvail(); // graph size determined here
// time
ImDrawList* dl=ImGui::GetWindowDrawList();
ImGuiWindow* window=ImGui::GetCurrentWindow();
ImVec2 size=ImVec2(ImGui::GetContentRegionAvail().x,ImGui::GetFontSize()+2.0*dpiScale);
ImVec2 minArea=window->DC.CursorPos;
ImVec2 maxArea=ImVec2(
minArea.x+size.x,
minArea.y+size.y
);
ImRect rect=ImRect(minArea,maxArea);
ImGuiStyle& style=ImGui::GetStyle();
ImGui::ItemSize(size,style.FramePadding.y);
if (ImGui::ItemAdd(rect,ImGui::GetID("SETime"))) {
dl->AddText(minArea,0xffffffff,"0");
}
ImVec2 avail=ImGui::GetContentRegionAvail(); // sample view size determined here
// don't do this. reason: mobile.
/*if (ImGui::GetContentRegionAvail().y>(ImGui::GetContentRegionAvail().x*0.5f)) {
avail=ImVec2(ImGui::GetContentRegionAvail().x,ImGui::GetContentRegionAvail().x*0.5f);