Ensure full screen info label shows at least two lines of text

Authored by huoni on Apr 22 2018, 1:21 AM.

Description

Ensure full screen info label shows at least two lines of text

Summary:
The minimum thumbnail bar height (which controls the height of the
autohide container) was being set to the size hint of the right hand
tool bar. This meant that depending on the widget style, the info
label could show partial lines. Furthermore, the default height of the
bar was 75px, only big enough to show one full line of info text.

This patch removes the 75px hardcoded default, and on startup calculates
a minimum thumbnail bar height using font metrics. This ensures that
no matter what widget style you are using, the minimum height is such
that the info label shows exactly two lines of text. This also means that
the second line aligns with the document count label.

This calculated minimum is used when:

  • The config has no value (default)
  • The config has a lower value (can happen if swithing widget styles)

Depends on D12301

Before

Breeze style, default size:

Breeze style, minimum configurable size:

Fusion style, default size:

Fusion style, minimum configurable size:

After

Breeze, default and minimum:

Fusion, default and minimum:

Test Plan:
Delete ~/.config/gwenviewrc or the FullScreenBarHeight=XX entry from it.
Start Gwenview and open a file with a long filename in Full Screen View.
-> Exactly two lines of filename should be visible. The second line should align
with the document count label.
Change to Fusion widget style (Settings > Application Style).
Re-open Gwenview as above.
-> Exactly two lines of filename should be visible. The second line should align
with the document count label.
Open Full Screen options, and ensure minimum thumbnail height is the same as the
default.

Reviewers: Gwenview, rkflx

Reviewed By: Gwenview, rkflx

Subscribers: rkflx

Tags: Gwenview

Differential Revision: https://phabricator.kde.org/D12429