Bambu H2D: Filament group wiki fix (#12880)

Co-authored-by: yw4z <yw4z@outlook.com>
Co-authored-by: yw4z <ywsyildiz@gmail.com>
This commit is contained in:
Ian Bassi
2026-04-16 14:38:26 -03:00
committed by GitHub
parent 30265e4f98
commit 80ef058aaa
3 changed files with 56 additions and 17 deletions

View File

@@ -20,6 +20,7 @@
#include "GUI_Utils.hpp"
#include "GUI.hpp"
#include "GLCanvas3D.hpp"
#include "FilamentGroupPopup.hpp"
#include "GLToolbar.hpp"
#include "GUI_Preview.hpp"
#include "libslic3r/Print.hpp"
@@ -2773,13 +2774,12 @@ void GCodeViewer::render_legend_color_arr_recommen(float window_padding)
auto link_filament_group_wiki = [&](const std::string& label) {
ImVec2 wiki_part_size = ImGui::CalcTextSize(label.c_str());
ImColor HyperColor = ImColor(0, 150, 136, 255).Value;
ImColor HyperColor = ImColor(0, 150, 136, 255); // ORCA match color
ImGui::PushStyleColor(ImGuiCol_Text, HyperColor.Value);
imgui.text(label.c_str());
ImGui::PopStyleColor();
// underline
// ORCA use underline to match hyperlink style
ImVec2 lineEnd = ImGui::GetItemRectMax();
lineEnd.y -= 2.0f;
ImVec2 lineStart = lineEnd;
@@ -2788,8 +2788,7 @@ void GCodeViewer::render_legend_color_arr_recommen(float window_padding)
// click behavior
if (ImGui::IsMouseHoveringRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), true)) {
if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) {
std::string wiki_path = Slic3r::resources_dir() + "/wiki/filament_group_wiki_zh.html";
wxLaunchDefaultBrowser(wxString(wiki_path.c_str()));
open_filament_group_wiki();
}
}
};
@@ -2996,8 +2995,9 @@ void GCodeViewer::render_legend_color_arr_recommen(float window_padding)
link_text(_u8L("Regroup filament"));
ImGui::SameLine();
ImGui::SetCursorPosX(ImGui::GetWindowContentRegionWidth() - window_padding - ImGui::CalcTextSize("Tips").x);
link_filament_group_wiki(_u8L("Tips"));
std::string wiki_str = _u8L("Wiki Guide"); // ORCA
ImGui::SetCursorPosX(ImGui::GetWindowContentRegionWidth() - window_padding - ImGui::CalcTextSize(wiki_str.c_str()).x);
link_filament_group_wiki(wiki_str);
ImGui::EndChild();
}