mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 20:15:55 +08:00
Search input not change case of letter.
This commit is contained in:
parent
659096b2a8
commit
ce3785fdb1
@ -2183,7 +2183,6 @@ void GLGizmoEmboss::draw_font_list()
|
|||||||
const char *popup_id = "##font_list_popup";
|
const char *popup_id = "##font_list_popup";
|
||||||
const char *input_id = "##font_list_input";
|
const char *input_id = "##font_list_input";
|
||||||
ImGui::SetNextItemWidth(m_gui_cfg->input_width);
|
ImGui::SetNextItemWidth(m_gui_cfg->input_width);
|
||||||
ImGuiInputTextFlags input_flags = ImGuiInputTextFlags_CharsUppercase;
|
|
||||||
|
|
||||||
// change color of hint to normal text
|
// change color of hint to normal text
|
||||||
bool is_popup_open = ImGui::IsPopupOpen(popup_id);
|
bool is_popup_open = ImGui::IsPopupOpen(popup_id);
|
||||||
@ -2195,11 +2194,18 @@ void GLGizmoEmboss::draw_font_list()
|
|||||||
m_face_names.search.clear();
|
m_face_names.search.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::InputTextWithHint(input_id, selected, &m_face_names.search, input_flags)) {
|
if (ImGui::InputTextWithHint(input_id, selected, &m_face_names.search)) {
|
||||||
// update filtration result
|
// update filtration result
|
||||||
m_face_names.hide = std::vector<bool>(m_face_names.faces.size(), {false});
|
m_face_names.hide = std::vector<bool>(m_face_names.faces.size(), {false});
|
||||||
|
|
||||||
|
// search to uppercase
|
||||||
|
std::string search = m_face_names.search; // copy
|
||||||
|
std::transform(search.begin(), search.end(), search.begin(), ::toupper);
|
||||||
|
|
||||||
for (FaceName &face : m_face_names.faces) {
|
for (FaceName &face : m_face_names.faces) {
|
||||||
size_t index = &face - &m_face_names.faces.front();
|
size_t index = &face - &m_face_names.faces.front();
|
||||||
|
|
||||||
|
// font name to uppercase
|
||||||
std::string name(face.wx_name.ToUTF8().data());
|
std::string name(face.wx_name.ToUTF8().data());
|
||||||
std::transform(name.begin(), name.end(), name.begin(), ::toupper);
|
std::transform(name.begin(), name.end(), name.begin(), ::toupper);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user