Skip to content
Commit 8f2997b9 authored by Huon Imberger's avatar Huon Imberger
Browse files

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:
{F5817145, size=full}

Breeze style, minimum configurable size:
{F5817146 size=full}

Fusion style, default size:
{F5817148 size=full}

Fusion style, minimum configurable size:
{F5817147 size=full}

## After

Breeze, default and minimum:
{F5817149 size=full}

Fusion, default and minimum:
{F5817150 size=full}

Test Plan:
Delete `~/.config/gwenviewrc` or the `FullScreenBarHeight=XX` entry from it.
Start Gwenview and open a file with a long filename in {nav Full Screen View}.
-> Exactly two lines of filename should be visible. The second line should align
with the document count label.
Change to {nav 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
parent 14199f3b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment