Give yourself a little more credit here. At a basic functional level she was comfortable in that attire around you, which all else being equal is a sign that she trusts you enough for you to not be a creep around her wearing a skirt. It doesn't matter to her whether you glanced at all, and it doesn't matter whether it was accidental or intentional. She was probably expecting a glance, and it doesn't mean she's flattered or wants the attention, just that a glance was not going to ruin her day.
But, what will make her panic is if you do pretty much any of the following:
- try apologizing to her 7 times
- and then ask 14 more times if your apology was properly accepted
- think you're friends now, now that she was near you in a skirt
- ask her out on a date because she was near you in a skirt
- act overly cold around her to prove your lack of attraction (...and therefore become a colleague who is impossible to function with)
- go to other coworkers, boss, HR, etc. making it out to be some spectacle or disaster that her skirt was attractive to you
Is a glance okay?
Honestly I think so, and for what it's worth I'm pretty much a feminist card-carrying SJW (political campaigning, rallies, fundraisers for Planned Parenthood, arguing on the internet...)
One reason women like dressing like this is because sometimes women like working for companies where they can wear what they are just most comfortable in. This means if you work at a somewhat progressive company you're going to deal with guys being comfortable wearing t-shirts and girls being comfortable wearing skirts. You're also going to deal with some guys who look damn good wearing a suit and some women who look damn good in a form-fitting business outfit. There is a line culturally (no speedos or bikinis at present) but the trend right now might be for short skirts to be no big deal, and if it means she doesn't have to change to go out that night then I'm sure she appreciates it.
A woman is going to expect glances from time to time. I would not say she is "flattered" or "complimented" but just that a glance from a colleague of the respective gender and orientation is going to be part of her life sometimes. You can do her a favor by just handling it when you do.
You can handle glancing at a woman's chest/butt/etc. with the following three easy steps:
- Feel a little embarrassed or ashamed. (But not too much, you're going to put this all behind you very soon.)
- Say nothing or possibly give a micro-apology like "my bad" or "sorry can we go over that one more time?" [implying you dozed off and were not being intentional]
- Return to the topic at hand while making eye contact.
This is important: leering, gawking, staring, etc. are not okay. You have "permission" to glance at a colleague because you weren't paying attention for 2 seconds, or something. You do not at all have permission to knowingly look, or to communicate to her that you feel comfortable looking. Roughly speaking if it wasn't intentional it's fine, but that's more because doing so intentionally is quite a strong statement to make to her, and one that you do not want to be making.