mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 10:32:20 +00:00
ENH:Optimize the gcode viewer and STEP mesh UI
jira: nojira Change-Id: Ie8d4f1eace04b2c51d4975c67b9a4deb7d88a56f (cherry picked from commit b9aa0397600ab0f5040ac719277c7b16b1371435)
This commit is contained in:
@@ -4393,21 +4393,20 @@ void GCodeViewer::render_legend_color_arr_recommen(float window_padding)
|
|||||||
auto link_text = [&](const std::string &label) {
|
auto link_text = [&](const std::string &label) {
|
||||||
ImVec2 wiki_part_size = ImGui::CalcTextSize(label.c_str());
|
ImVec2 wiki_part_size = ImGui::CalcTextSize(label.c_str());
|
||||||
|
|
||||||
ImColor HyperColor = ImColor(48, 221, 114, 255).Value;
|
ImColor HyperColor = ImColor(0, 174, 66, 255).Value;
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, HyperColor.Value);
|
ImGui::PushStyleColor(ImGuiCol_Text, HyperColor.Value);
|
||||||
imgui.text(label.c_str());
|
imgui.text(label.c_str());
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
|
|
||||||
|
// underline
|
||||||
|
ImVec2 lineEnd = ImGui::GetItemRectMax();
|
||||||
|
lineEnd.y -= 2.0f;
|
||||||
|
ImVec2 lineStart = lineEnd;
|
||||||
|
lineStart.x = ImGui::GetItemRectMin().x;
|
||||||
|
ImGui::GetWindowDrawList()->AddLine(lineStart, lineEnd, HyperColor);
|
||||||
// click behavior
|
// click behavior
|
||||||
if (ImGui::IsMouseHoveringRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), true)) {
|
if (ImGui::IsMouseHoveringRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), true)) {
|
||||||
// underline
|
if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) {
|
||||||
ImVec2 lineEnd = ImGui::GetItemRectMax();
|
|
||||||
lineEnd.y -= 2.0f;
|
|
||||||
ImVec2 lineStart = lineEnd;
|
|
||||||
lineStart.x = ImGui::GetItemRectMin().x;
|
|
||||||
ImGui::GetWindowDrawList()->AddLine(lineStart, lineEnd, HyperColor);
|
|
||||||
|
|
||||||
if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) {
|
|
||||||
Plater *plater = wxGetApp().plater();
|
Plater *plater = wxGetApp().plater();
|
||||||
wxCommandEvent evt(EVT_OPEN_FILAMENT_MAP_SETTINGS_DIALOG);
|
wxCommandEvent evt(EVT_OPEN_FILAMENT_MAP_SETTINGS_DIALOG);
|
||||||
evt.SetEventObject(plater);
|
evt.SetEventObject(plater);
|
||||||
@@ -4420,20 +4419,18 @@ void GCodeViewer::render_legend_color_arr_recommen(float window_padding)
|
|||||||
auto link_text_set_to_optional = [&](const std::string &label) {
|
auto link_text_set_to_optional = [&](const std::string &label) {
|
||||||
ImVec2 wiki_part_size = ImGui::CalcTextSize(label.c_str());
|
ImVec2 wiki_part_size = ImGui::CalcTextSize(label.c_str());
|
||||||
|
|
||||||
ImColor HyperColor = ImColor(48, 221, 114, 255).Value;
|
ImColor HyperColor = ImColor(0, 174, 66, 255).Value;
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, HyperColor.Value);
|
ImGui::PushStyleColor(ImGuiCol_Text, HyperColor.Value);
|
||||||
imgui.text(label.c_str());
|
imgui.text(label.c_str());
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
|
// underline
|
||||||
|
ImVec2 lineEnd = ImGui::GetItemRectMax();
|
||||||
|
lineEnd.y -= 2.0f;
|
||||||
|
ImVec2 lineStart = lineEnd;
|
||||||
|
lineStart.x = ImGui::GetItemRectMin().x;
|
||||||
|
ImGui::GetWindowDrawList()->AddLine(lineStart, lineEnd, HyperColor);
|
||||||
// click behavior
|
// click behavior
|
||||||
if (ImGui::IsMouseHoveringRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), true)) {
|
if (ImGui::IsMouseHoveringRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), true)) {
|
||||||
// underline
|
|
||||||
ImVec2 lineEnd = ImGui::GetItemRectMax();
|
|
||||||
lineEnd.y -= 2.0f;
|
|
||||||
ImVec2 lineStart = lineEnd;
|
|
||||||
lineStart.x = ImGui::GetItemRectMin().x;
|
|
||||||
ImGui::GetWindowDrawList()->AddLine(lineStart, lineEnd, HyperColor);
|
|
||||||
|
|
||||||
if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) {
|
if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) {
|
||||||
MessageDialog msg_dlg(nullptr, _L("Automatically re-slice according to the optimal filament arrangement, and the arrangement results will be displayed after slicing."), wxEmptyString, wxOK | wxCANCEL);
|
MessageDialog msg_dlg(nullptr, _L("Automatically re-slice according to the optimal filament arrangement, and the arrangement results will be displayed after slicing."), wxEmptyString, wxOK | wxCANCEL);
|
||||||
if (msg_dlg.ShowModal() == wxID_OK) {
|
if (msg_dlg.ShowModal() == wxID_OK) {
|
||||||
@@ -4563,6 +4560,8 @@ void GCodeViewer::render_legend_color_arr_recommen(float window_padding)
|
|||||||
if (!is_optimal_group) {
|
if (!is_optimal_group) {
|
||||||
link_text_set_to_optional(_u8L("Set to Optimal"));
|
link_text_set_to_optional(_u8L("Set to Optimal"));
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
ImGui::Dummy({window_padding, window_padding});
|
||||||
|
ImGui::SameLine();
|
||||||
}
|
}
|
||||||
link_text(_u8L("Rearrange filament"));
|
link_text(_u8L("Rearrange filament"));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user