diff --git a/src/ui.cpp b/src/ui.cpp index c7eb4a434eeba..a0b77fa07f881 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -61,6 +61,9 @@ void uilist_impl::on_resized() void uilist_impl::draw_controls() { + float hotkey_width = + ImGui::CalcTextSize( "[X]" ).x + ImGui::GetStyle().ItemSpacing.x; + if( !parent.text.empty() ) { cataimgui::draw_colored_text( parent.text ); ImGui::Separator(); @@ -108,6 +111,8 @@ void uilist_impl::draw_controls() ImGui::SameLine( 0, 0 ); ImGui::Text( "%c", ']' ); ImGui::SameLine(); + } else { + ImGui::SetCursorPosX( hotkey_width ); } nc_color color = ( is_selected ? parent.hilight_color :