Merge branch 'main' into feature/h2c_support_clean

This commit is contained in:
Rodrigo Faselli
2026-07-12 22:00:40 -03:00
committed by GitHub
65 changed files with 3958 additions and 1183 deletions
+10 -6
View File
@@ -489,7 +489,7 @@ void GCodeViewer::SequentialView::Marker::render_position_window(const libvgcode
const float main_row_h = 2.0f * text_h + item_spacing_y; // Two lines of text (position and detail) + spacing between them
const float properties_h = static_cast<float>(properties_rows.size()) * (text_h + 2.0f * cell_pad_y) + 2.0f * cell_pad_y + 1.0f + item_spacing_y // table rows
+ item_spacing_y + show_button_h // Spacing() + Show/Hide button row
+ item_spacing_y + 1.0f + style.FramePadding.y; // Spacing() + Separator() + Dummy()
+ item_spacing_y + 1.0f + style.WindowPadding.y; // Spacing() + Separator() + Dummy()
const float folded_window_h = std::ceil(window_pad_h + main_row_h); // Height of the window when properties are hidden, with padding, rounded up for better look
const float unfolded_window_h = std::ceil(folded_window_h + properties_h); // Height of the window when properties are shown, with padding, rounded up for better look
const float window_h = properties_shown ? unfolded_window_h : folded_window_h; // Final window height depending on whether properties are shown or not
@@ -615,9 +615,12 @@ void GCodeViewer::SequentialView::Marker::render_position_window(const libvgcode
ImGui::Spacing();
ImGui::Separator();
ImGui::Dummy({0, style.FramePadding.y});
ImGui::Dummy({0, style.WindowPadding.y});
}
float draw_area_height = ImGui::GetTextLineHeight() * 2.f + style.ItemSpacing.y;
ImGui::Dummy({10.f, draw_area_height}); // reserve area
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding , 3.f * m_scale);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding , ImVec2(2.f, 2.f) * m_scale);
ImGui::PushStyleColor(ImGuiCol_Button , ImVec4(0, 0, 0, 0));
@@ -625,6 +628,10 @@ void GCodeViewer::SequentialView::Marker::render_position_window(const libvgcode
ImGui::PushStyleColor(ImGuiCol_ButtonActive , ImVec4(84 / 255.f, 84 / 255.f, 90 / 255.f, 1.f));
const float main_wnd_height = ImGui::GetWindowHeight();
const float draw_start_y = main_wnd_height - draw_area_height - style.WindowPadding.y;
ImGui::SetCursorPos(ImVec2(style.WindowPadding.x, draw_start_y));
// ORCA use glyph based button for fixing button sizes changing depends on used font size on platform
const wchar_t foldIcon = properties_shown ? ImGui::UnfoldButtonIcon : ImGui::FoldButtonIcon;
if (imgui.glyph_button(foldIcon, ImVec2(16.f, 16.f) * m_scale)) {
@@ -640,10 +647,7 @@ void GCodeViewer::SequentialView::Marker::render_position_window(const libvgcode
ImGui::PopStyleColor(3);
ImGui::PopStyleVar(2);
ImGui::SameLine();
if(!properties_shown)
ImGui::SetCursorPosY(ImGui::GetCursorPosY() - style.FramePadding.y); // aligns button with next group
ImGui::SetCursorPos(ImVec2(style.WindowPadding.x + style.ItemSpacing.x + 24.f * m_scale, draw_start_y - 1.f * m_scale));
ImGui::BeginGroup(); // group contents to make information area more compact