HiDPI support

Giuseppe Bilotta giuseppe.bilotta at gmail.com
Tue Oct 14 05:03:20 PDT 2014


Hello Thiago,

On Tue, Oct 14, 2014 at 12:52 PM, Thiago Macieira <thiago at macieira.org> wrote:
> On Tuesday 14 October 2014 10:32:33 Giuseppe Bilotta wrote:
>> * the UI is largely designed through .ui files, which means hard-coded
>> sizes all around; there's no trivial way that I know of to obviate
>> this issue, so a conversion to a different approach would be needed;
>> we have essentially two options::
>>
>> a) convert everything to C++ and ork with that;
>> b) keep a more dynamic-ish approach and switch from .ui files to QML files.

> On the subject of the UIs in .ui files, I would hope that they scale
> automatically for HiDPI screens. All the dialogs and windows should be using
> layouts, which will automatically increase in size due to the increased size
> constraints of the text and images. The only two things that come to mind that
> will not automatically scale are:
>
> 1) the total size of the dialogs and windows (they will only grow to the
> minimum size, which may look ugly)
>
> 2) the graph widget and the table column widths
>
> The graph widget should be modified to realise it's in HiDPI and draw things
> twice as big; the column widths should be modified to have a width proportional
> to the font size (i.e., measured in ems instead of pixels).

The table column widths are handled in the C++ files, so I've already
managed to set them up to use ems instead of pixels (in fact, I've
done something slightly more sophisticated, and numerical columns
actually scale according to the width of the '0' character, but that's
just me). I might have forgotten some places though (I haven't
explored all the dialogs/options yet), and I might not have done it in
the cleanest of ways.

The graph widget _mostly_ seems to behave correctly. I had to fix the
default height for the Information tooltip, which is again handled at
the C++ level. There's a few extra things I have to check (like the
icons and the placement of the bottom text), but I think it's all
handled at the C++ level so it should be doable without big efforts.

What I'm seeing troubles with is the dialogs. They don't seem to be
scaling correctly. This is _possibly_ an issue due to the Qt version
I'm compiling this with (4.8 rather than 5.x), and/or an interaction
with the window manager I'm using (Awesome WM, version 3.4). But for
example, if I open the Preferences dialog, or the Survey, then I see
things like this: http://i.imgur.com/3haff17.png
http://i.imgur.com/JVVVVjT.png where you can notice stuff such as the
checkboxes and textboxes being a little too small and/or with not
enough descending room, or the icon column on the left having all
things mashed together. (I haven't looked at the other dialogs yet.)

Also, the toolbar at the split between the main tab and the graph view
is fixed at a QSize(24,24) iconSize regardless of DPI (the fact that
most of its icons are 24x24 PNGs doesn't help here, obviously). I
suspect this is more of a Qt 4.8 issue than a .ui file issue though.

Additionally, the main tab view in the application window doesn't grow
enough to hold all the columns in the Equipment tab, even though there
is enough room, but by looking better at the code I see that this is
actually due to the default 3/7 spit preference.

-- 
Giuseppe "Oblomov" Bilotta


More information about the subsurface mailing list