Add support for smaller displays and fix right offset calculation for context panel