clock: Fix calendar popup positioning
This fixes the problem that the calendar popup jumps into wrong position in some specific cases on update:
-
When the position is right or bottom, use the window size rather than the preferred size to calculate the distance from the panel.
-
When the position is right or left, always use north gravity.