New size calculation algo (from LXPanel)