All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad, sallallaahu 'alayhi wa sallam, is His slave and Messenger.
What you were doing by adjusting your hijab when it slipped twice during prayer is exactly what you are required to do. It is also considered a minor movement that does not invalidate the prayer.
Imam An-Nawawi said in [his commentary] al-Majmu' while discussing minor movements during prayer:
“Minor movements that people generally consider insignificant, such as gesturing to return a greeting, removing shoes, lifting or placing a turban, or putting on or taking off a light garment, do not affect the validity of the prayer.”
Allah knows best.