mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 21:15:52 +08:00
Reorder font list by draging font
This commit is contained in:
parent
3e0bc4a529
commit
734026bf96
@ -655,6 +655,15 @@ void GLGizmoEmboss::draw_font_list()
|
|||||||
} else if (ImGui::IsItemHovered())
|
} else if (ImGui::IsItemHovered())
|
||||||
ImGui::SetTooltip("%s", f.name.c_str());
|
ImGui::SetTooltip("%s", f.name.c_str());
|
||||||
|
|
||||||
|
// reorder items
|
||||||
|
if (ImGui::IsItemActive() && !ImGui::IsItemHovered()) {
|
||||||
|
int other_index = index + (ImGui::GetMouseDragDelta(0).y < 0.f ? -1 : 1);
|
||||||
|
if (other_index >= 0 && other_index < m_font_list.size()) {
|
||||||
|
std::swap(m_font_list[index], m_font_list[other_index]);
|
||||||
|
ImGui::ResetMouseDragDelta();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// draw buttons rename and delete
|
// draw buttons rename and delete
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::SetCursorPosX(m_gui_cfg->rename_pos_x);
|
ImGui::SetCursorPosX(m_gui_cfg->rename_pos_x);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user