Skip to content

Commit

Permalink
fix: fixed table view cell height
Browse files Browse the repository at this point in the history
  • Loading branch information
klonyyy committed Dec 8, 2024
1 parent 2bcc42a commit b249a21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions example/MCUViewer_test/MCUViewer_project/MCUViewer_test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ format = HEX

[plot1-series3]
name = test.structA.c
visibility = false
visibility = true
format = DEC

[plot1-series4]
Expand All @@ -308,7 +308,7 @@ format = DEC

[plot1-series5]
name = test.structA.g
visibility = false
visibility = true
format = DEC

[plot1-series6]
Expand Down Expand Up @@ -533,11 +533,11 @@ visibility = true

[group0-plot1]
name = settings
visibility = false
visibility = true

[group0-plot2]
name = sine signals
visibility = false
visibility = true

[group0-plot3]
name = triangle
Expand Down
3 changes: 3 additions & 0 deletions src/Gui/GuiPlots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ void Gui::drawPlotTable(std::shared_ptr<Plot> plot)
ImGui::SetCursorPosX((ImGui::GetWindowSize().x - ImGui::CalcTextSize(plot->getName().c_str()).x) * 0.5f);
ImGui::Text("%s", plot->getName().c_str());

ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0.0f, 0.0f)); // Adjust vertical padding
if (ImGui::BeginTable(plot->getName().c_str(), 4, flags))
{
ImGui::TableSetupScrollFreeze(0, 1); // Make top row always visible
Expand Down Expand Up @@ -298,6 +299,7 @@ void Gui::drawPlotTable(std::shared_ptr<Plot> plot)
if (viewerDataHandler->getState() == DataHandlerBase::State::STOP)
{
ImGui::PopStyleColor(3);
ImGui::EndDisabled();
continue;
}
if (ImGui::IsKeyPressed(ImGuiKey_Enter) || ImGui::IsKeyPressed(ImGuiKey_KeypadEnter))
Expand Down Expand Up @@ -325,6 +327,7 @@ void Gui::drawPlotTable(std::shared_ptr<Plot> plot)
ImGui::EndDragDropTarget();
}
}
ImGui::PopStyleVar();
plot->setIsHovered(ImGui::IsItemHovered());
}

Expand Down

0 comments on commit b249a21

Please sign in to comment.