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

Authored by huoni on Apr 22 2018, 3:24 AM.

Details

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.

Diff Detail

Repository
R260 Gwenview
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
huoni requested review of this revision.Apr 22 2018, 3:24 AM
huoni created this revision.
huoni edited the summary of this revision. (Show Details)Apr 22 2018, 3:28 AM
huoni added a project: Gwenview.
rkflx accepted this revision.Apr 22 2018, 11:30 AM
rkflx added a subscriber: rkflx.

Cool, works great! Perfection level 99% in the code ;)

app/fullscreencontent.cpp
162–164

Spelling: Containter

This revision is now accepted and ready to land.Apr 22 2018, 11:30 AM

Cool, works great! Perfection level 99% in the code ;)

I was so close! :)

This revision was automatically updated to reflect the committed changes.
huoni marked an inline comment as done.