Fixes issues #4602, #4870 and #4869

Rebased:

Fix for issue 4602.

Fix for issue 4602.

Fixed overflow when pagination is present.

Little fix for no-pagination case, so there's no space reserved for pagination.

Only searched text is contracting now with ellipsis.

Moved layout back to strings.

Little more refactoring.

Few more changes according code review.

Few more changes according code review. #2

Fixes #4870

Fixed duplicate ID

Remove IDs used for summaries.

Fixes #4869

Refactored according to code-review.

Fixes case when scope is a long filename.

Minor refactoring
Merge pull request #4661 from zaggino/issue4602

Fix for issue 4602.