FIX:Imgui colorButton support alpha display
jira: STUDIO-8543 Change-Id: If90e4cecd89b53cf2f67856024a75821faa2c055
This commit is contained in:
parent
733531b1c6
commit
1e3d16c2f1
|
@ -555,7 +555,7 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw filament background
|
// draw filament background
|
||||||
ImGuiColorEditFlags flags = ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel | ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_NoTooltip;
|
ImGuiColorEditFlags flags = ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel | ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_NoTooltip;
|
||||||
if (m_selected_extruder_idx != extruder_idx) flags |= ImGuiColorEditFlags_NoBorder;
|
if (m_selected_extruder_idx != extruder_idx) flags |= ImGuiColorEditFlags_NoBorder;
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.00f, 0.68f, 0.26f, 1.00f));
|
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.00f, 0.68f, 0.26f, 1.00f));
|
||||||
|
@ -581,10 +581,15 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
|
||||||
float gray = 0.299 * extruder_color[0] + 0.587 * extruder_color[1] + 0.114 * extruder_color[2];
|
float gray = 0.299 * extruder_color[0] + 0.587 * extruder_color[1] + 0.114 * extruder_color[2];
|
||||||
ImGui::SameLine(button_offset + (button_size.x - label_size.x) / 2.f);
|
ImGui::SameLine(button_offset + (button_size.x - label_size.x) / 2.f);
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, {10.0,15.0});
|
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, {10.0,15.0});
|
||||||
if (gray * 255.f < 80.f)
|
if (abs(color_vec.w - 1) < 0.01) {
|
||||||
ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, 1.0f), item_text.c_str());
|
if (gray * 255.f < 80.f)
|
||||||
else
|
ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, 1.0f), item_text.c_str());
|
||||||
|
else
|
||||||
|
ImGui::TextColored(ImVec4(0.0f, 0.0f, 0.0f, 1.0f), item_text.c_str());
|
||||||
|
}
|
||||||
|
else {//alpha
|
||||||
ImGui::TextColored(ImVec4(0.0f, 0.0f, 0.0f, 1.0f), item_text.c_str());
|
ImGui::TextColored(ImVec4(0.0f, 0.0f, 0.0f, 1.0f), item_text.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::PopStyleVar();
|
ImGui::PopStyleVar();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue