update libslic3r

This commit is contained in:
QIDI TECH
2025-08-04 10:13:51 +08:00
parent e3f49c2fb5
commit 8d4d60ec48
96 changed files with 4993 additions and 1903 deletions

View File

@@ -4860,7 +4860,7 @@ void ImGui::CaptureMouseFromApp(bool capture)
bool ImGui::IsItemActive()
{
ImGuiContext& g = *GImGui;
if (g.ActiveId)
if (g.ActiveId && g.CurrentWindow)
{
ImGuiWindow* window = g.CurrentWindow;
return g.ActiveId == window->DC.LastItemId;

View File

@@ -130,6 +130,9 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInpu
static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end);
static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining = NULL, ImVec2* out_offset = NULL, bool stop_on_new_line = false);
const ImVec4 IMGUI_COL_QIDISTUDIO = { 68.f / 255.0f, 121.f / 255.0f, 251.0f / 255, 1.0f};
const ImVec4 IMGUI_COL_WHITE = {1.0f, 1.0f, 1.0f, 1.0f};
//-------------------------------------------------------------------------
// [SECTION] Widgets: Text, etc.
//-------------------------------------------------------------------------
@@ -1508,29 +1511,27 @@ bool ImGui::CheckboxFlags(const char* label, ImU64* flags, ImU64 flags_value)
return CheckboxFlagsT(label, flags, flags_value);
}
bool ImGui::RadioButton(const char* label, bool active)
bool ImGui::RadioButton(const char *label, bool active)
{
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
ImGuiWindow *window = GetCurrentWindow();
if (!window || window->SkipItems) return false;
ImGuiContext& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
const ImVec2 label_size = CalcTextSize(label, NULL, true);
ImGuiContext & g = *GImGui;
const ImGuiStyle &style = g.Style;
const ImGuiID id = window->GetID(label);
const ImVec2 label_size = CalcTextSize(label, NULL, true);
const float square_sz = GetFrameHeight();
const ImVec2 pos = window->DC.CursorPos;
const float square_sz = GetFrameHeight();
const ImVec2 pos = window->DC.CursorPos;
const ImRect check_bb(pos, pos + ImVec2(square_sz, square_sz));
const ImRect total_bb(pos, pos + ImVec2(square_sz + (label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f), label_size.y + style.FramePadding.y * 2.0f));
ItemSize(total_bb, style.FramePadding.y);
if (!ItemAdd(total_bb, id))
return false;
if (!ItemAdd(total_bb, id)) return false;
ImVec2 center = check_bb.GetCenter();
center.x = IM_ROUND(center.x);
center.y = IM_ROUND(center.y);
const float radius = (square_sz - 1.0f) * 0.5f;
ImVec2 center = check_bb.GetCenter();
center.x = IM_ROUND(center.x);
center.y = IM_ROUND(center.y);
const float radius = (square_sz - 1.0f) * 0.35f;
bool hovered, held;
bool pressed = ButtonBehavior(total_bb, id, &hovered, &held);
@@ -1538,17 +1539,33 @@ bool ImGui::RadioButton(const char* label, bool active)
MarkItemEdited(id);
RenderNavHighlight(total_bb, id);
window->DrawList->AddCircleFilled(center, radius, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), 16);
if (active)
{
const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f));
window->DrawList->AddCircleFilled(center, radius - pad, GetColorU32(ImGuiCol_CheckMark), 16);
float hover_scale = 1.0f;
if (held && hovered) {
window->DrawList->AddCircleFilled(center, radius, GetColorU32(IMGUI_COL_QIDISTUDIO), 16);
} else if (hovered) {
if (active) {
hover_scale = 1.1f;
window->DrawList->AddCircleFilled(center, radius * hover_scale, GetColorU32(IMGUI_COL_QIDISTUDIO), 16);
} else {
window->DrawList->AddCircleFilled(center, radius * hover_scale, GetColorU32(ImGuiCol_FrameBgHovered), 16);
}
} else {
window->DrawList->AddCircleFilled(center, radius, GetColorU32(ImGuiCol_FrameBg), 16);
}
if (active) { // selected
if (!hovered){
window->DrawList->AddCircleFilled(center, radius, GetColorU32(IMGUI_COL_QIDISTUDIO), 16);
}
const float pad = radius * 0.6f;
window->DrawList->AddCircleFilled(center, radius - pad, GetColorU32(IMGUI_COL_WHITE), 16);
}
if (style.FrameBorderSize > 0.0f)
{
window->DrawList->AddCircle(center + ImVec2(1, 1), radius, GetColorU32(ImGuiCol_BorderShadow), 16, style.FrameBorderSize);
window->DrawList->AddCircle(center, radius, GetColorU32(ImGuiCol_Border), 16, style.FrameBorderSize);
window->DrawList->AddCircle(center + ImVec2(1, 1), radius * hover_scale, GetColorU32(ImGuiCol_BorderShadow), 16, style.FrameBorderSize);
window->DrawList->AddCircle(center, radius * hover_scale, GetColorU32(ImGuiCol_Border), 16, style.FrameBorderSize);
}
ImVec2 label_pos = ImVec2(check_bb.Max.x + style.ItemInnerSpacing.x, check_bb.Min.y + style.FramePadding.y);
@@ -4416,7 +4433,7 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
bool ImGui::InputTextMultiline(const char* label, char* buf, size_t buf_size, const ImVec2& size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
{
return InputTextEx(label, NULL, buf, (int)buf_size, size, flags | ImGuiInputTextFlags_Multiline, callback, user_data);
return InputTextEx(label, NULL, buf, (int) buf_size, size, flags , callback, user_data);//ImGuiInputTextFlags_Multiline should manual input
}
bool ImGui::InputTextWithHint(const char* label, const char* hint, char* buf, size_t buf_size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
@@ -5056,8 +5073,10 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if (g.ActiveId == id && !g.ActiveIdIsJustActivated && !clear_active_id)
{
IM_ASSERT(state != NULL);
IM_ASSERT(io.KeyMods == GetMergedKeyModFlags() && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods"); // We rarely do this check, but if anything let's do it here.
#ifndef __APPLE__
IM_ASSERT(io.KeyMods == GetMergedKeyModFlags() &&
"Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods"); // We rarely do this check, but if anything let's do it here.
#endif
const int row_count_per_page = ImMax((int)((inner_size.y - style.FramePadding.y) / g.FontSize), 1);
state->Stb.row_count_per_page = row_count_per_page;
@@ -7315,10 +7334,10 @@ bool ImGui::QDTSelectable(const char *label, bool selected, ImGuiSelectableFlags
bool pressed = ButtonBehavior(bb, id, &hovered, &held, button_flags);
if (hovered || g.ActiveId == id) {
ImGui::PushStyleColor(ImGuiCol_Border, GetColorU32(ImGuiCol_BorderActive));
if(arrow_size == 0) {
if (arrow_size == 0) {
RenderFrameBorder(bb.Min, ImVec2(bb.Max.x - style.WindowPadding.x, bb.Max.y), style.FrameRounding);
} else {
RenderFrameBorder(ImVec2(bb.Min.x + style.WindowPadding.x,bb.Min.y), ImVec2(bb.Max.x - style.WindowPadding.x,bb.Max.y), style.FrameRounding);
RenderFrameBorder(ImVec2(bb.Min.x + style.WindowPadding.x, bb.Min.y), ImVec2(bb.Max.x - style.WindowPadding.x, bb.Max.y), style.FrameRounding);
}
ImGui::PopStyleColor(1);
}