Bug 334271 - Status bar widgets size hardcoded
Summary: Status bar widgets size hardcoded
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: bars: status (show other bugs)
Version: 4.11.5
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2014-05-03 08:30 UTC by Maxim Vasilyev
Modified: 2014-08-14 16:12 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.14.1


Attachments
Comparison of Dolphin with standard and increased DPI (368.39 KB, image/png)
2014-05-03 13:39 UTC, Maxim Vasilyev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Vasilyev 2014-05-03 08:30:58 UTC
Status bar widgets "Zoom Slider" and "Free Space" do not scale according to general dpi setting. The actual result is:

1. These elements are too small to use on modern HiDPI (Retina) screens.
2. The text in "Free Space" does not fit the widget, since the text does scale.

Reproducible: Always

Steps to Reproduce:
1. Set DPI to a higher value, for example 192
2. Open Dolphin
3. Enable show free space and zoom slider in status bar by right-clicking it
Actual Results:  
The widgets are too small and text in free space doesn't fit in it.

Expected Results:  
Widgets scale according to DPI setting
Comment 1 Frank Reininghaus 2014-05-03 08:45:45 UTC
Thanks for the bug report. Actually, the size is not hardcoded any more since bug 319373 is fixed, but there is still a hardcoded maximum size of 150 pixels.

(In reply to comment #0)
> 1. Set DPI to a higher value, for example 192

Where can I change this setting?

> Expected Results:  
> Widgets scale according to DPI setting

Do you (or anyone else) know how applications can access this setting?
Comment 2 Christoph Feck 2014-05-03 10:49:58 UTC
The established practice is to make pixel values proportional to fontmetrics.height(). This way, when the user either increases font size, or increases DPI, the layout will adapt to those changes. It also means that users with high DPI, but small fonts, will not be surprised by bigger layouts.
Comment 3 Maxim Vasilyev 2014-05-03 13:39:12 UTC
Created attachment 86426 [details]
Comparison of Dolphin with standard and increased DPI
Comment 4 Maxim Vasilyev 2014-05-03 13:52:29 UTC
>Thanks for the bug report. Actually, the size is not hardcoded any more since bug 319373 is fixed, but there is still a hardcoded maximum size of 150 pixels.

No, it is hardcoded. You can see it for yourself on a provided screenshot.

>Where can I change this setting?

There are multiple ways to do that:

1. You can change it on a client side in System Settings, fonts configuration.
2. You can set it on a server side (system-wide) by passing argument to x server -dpi <value>.
I have chosen the second option by appending "xserver-command=X -dpi 192" to my /etc/lightdm/lightdm.conf

>Do you (or anyone else) know how applications can access this setting?

My guess, it's the internal ABI of xserver, that allows the applications to be aware of such settings. The problem is that some apps do not use it correctly or do not use it at all. Actually, I'm not much of a tech pro, so you better ask someone else. If I were one, I wouldn't report bugs, i'd fix them right away. :)
Comment 5 Frank Reininghaus 2014-05-03 23:56:42 UTC
Thanks for the additional information, Christoph and Maxim.

(In reply to comment #4)
> >Thanks for the bug report. Actually, the size is not hardcoded any more since bug 319373 is fixed, but there is still a hardcoded maximum size of 150 pixels.
> 
> No, it is hardcoded. You can see it for yourself on a provided screenshot.

As I said, only the *maximum* size is hardcoded, not the size itself. If you make the window more narrow, the zoom slider will become more narrow (the "free space" widget probably not because it notices that it cannot make itself any smaller because the text doesn't fit).

But let us please not continue to argue about this detail - I think we all agree that there is a bug, and that the maximum size of the status bar widgets should depend on the font size.
Comment 6 Maxim Vasilyev 2014-05-04 09:56:28 UTC
>But let us please not continue to argue about this detail - I think we all agree that there is a bug, and that the maximum size of the status bar widgets should depend on the font size.

Of course. No offense was intended. English is not my native language. I'm looking forward to hearing from you.
Comment 7 Emmanuel Pescosta 2014-05-13 09:17:24 UTC
The maximum width calculation of some status bar widgets (zoom slider, space info and progress bar) needs adjustments.

Try to reproduce the problem by setting the font dpi to 192 or higher. (System settings -> Application appearance -> Font)

Coding (code can be found in dolphin/src/statusbar):

1. You will need the font metrics of the current font. (Have a look at views/tooltips/filemetadatatooltip.cpp how it works)

2. We want to calculate the maximum width of these widgets by multiplying the average char width by an factor (try to find a suitable factor for this).

While you are testing with high dpi you will recognize that there is still a layouting problem with the zoom slider under high dpi, the vertical alignment isn't correct. This should also be fixed.

3. Try to fix the alignment problem of the zoom slider (hint: Why do we set a fixed height for the zoom slider? The zoom slider has always the same vertical size, we only add an empty space underneath.)

4. Submit your patch, thanks! :)
Comment 8 Emmanuel Pescosta 2014-08-14 16:12:25 UTC
Git commit 1b6ce8a9e55ba64a574ca1dd21e6369ba5c50e6f by Emmanuel Pescosta, on behalf of Mathieu Tarral.
Committed on 10/08/2014 at 20:40.
Pushed by emmanuelp into branch 'KDE/4.14'.

Fixes display issues of Dolphin statusbar widgets when a high DPI value is used (>= 196 for example).
REVIEW: 119701
FIXED-IN: 4.14.1

M  +5    -4    dolphin/src/statusbar/dolphinstatusbar.cpp

http://commits.kde.org/kde-baseapps/1b6ce8a9e55ba64a574ca1dd21e6369ba5c50e6f