From 09362dd79163eb465fcfb1c153f41d76265806d6 Mon Sep 17 00:00:00 2001 From: Filip Sykala - NTB T15p Date: Tue, 25 Jul 2023 08:24:41 +0200 Subject: [PATCH] Keep same line height for input and slider --- src/slic3r/GUI/ImGuiWrapper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index e3f2220cad..c9337a9deb 100644 --- a/src/slic3r/GUI/ImGuiWrapper.cpp +++ b/src/slic3r/GUI/ImGuiWrapper.cpp @@ -665,8 +665,9 @@ bool ImGuiWrapper::slider_float(const char* label, float* v, float v_min, float ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0.4f, 0.4f, 0.4f, 1.0f }); ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0.4f, 0.4f, 0.4f, 1.0f }); + int frame_padding = style.ItemSpacing.y / 2; // keep same line height for input and slider const ImTextureID tex_id = io.Fonts->TexID; - if (image_button(tex_id, size, uv0, uv1, -1, ImVec4(0.0, 0.0, 0.0, 0.0), ImVec4(1.0, 1.0, 1.0, 1.0), ImGuiButtonFlags_PressedOnClick)) { + if (image_button(tex_id, size, uv0, uv1, frame_padding, ImVec4(0.0, 0.0, 0.0, 0.0), ImVec4(1.0, 1.0, 1.0, 1.0), ImGuiButtonFlags_PressedOnClick)) { if (!slider_editing) ImGui::SetKeyboardFocusHere(-1); else