[vlc-devel] [PATCH] draw the toolbar with DPI-aware dimensions
jarrad.whitaker at gmail.com
Fri Nov 7 05:38:31 CET 2014
Forgot to mention, the reason for the hardcoded number 96 is simply
that this is used as our "baseline" scaling factor of 1 (so we are
saying that the existing pixel lengths in VLC are correct for a user
at 96 DPI, which is the case), and the user's current DPI is
interpreted as a multiple of that; this multiple is what what we use
to scale all our dimensions.
The alternative to this is to write that we want all our dimensions in
some physical unit (say points or cm) and then work out the pixels
from there. This is also perfectly valid, but given all this scaling
is linear the results will be identical for a lot more work, and
furthermore it would be very easy to muck up the current pixel-perfect
rendering at 96DPI with this approach.
On 7 November 2014 15:31, Jarrad Whitaker <jarrad.whitaker at gmail.com> wrote:
> My current method should work with Qt4 (though I haven't tested, it
> was pain enough getting the current build environment set up)
> WRT the "recommended HDPI way", Qt's current advice is to "use Qt
> Quick", which of course would involve re-writing the whole interface.
> You may call me lazy but I have no intention of doing this! Qt does
> have some hi-dpi patches incoming with better support for Qt Widgets,
> but it looks like they'll be in Qt 5.5 at the earliest. The method I
> am using is a very small change, and I would hazard that given it
> actually gives perfectly good results (assuming we do it properly with
> some high-res assets), it's probably not worth making more fundamental
> changes until the promised proper DPI awareness is built into Qt.
> I've actually just tried to get the qsvg library built as well, as it
> would be required for vector toolbar icons, but I'm not having much
> luck. It's building statically but the qt gui is not linking against
> it, and my makespec to get it into contribs is a horrible mess that
> doesn't deserve to see the light of day. Could I ask if someone more
> familiar with the build system could have a look at this? once it
> builds and links, it should be a simple matter of just adding some
> SVGs into vlc.qrc and then adding them to the icons.
> For now, I shall make up the SVGs themselves and export some high
> resolution png icons from them. These can be put in with no changes to
> the contribs and should still look decent. Also, the groundwork for
> this will be required for later SVG support anyway.
More information about the vlc-devel