[Qgis-developer] Layers and Browser dock widget icons

Matthias Kuhn matthias at opengis.ch
Sat May 30 01:07:41 PDT 2015


Hi Larry,

Actually I haven't written these lines, they come from the GSoC 2012
work by Ramón Carillo on QGIS for Android.

I think the fixed number there relates to the "/ 160" from the following
page which takes a 160 dpi screen as reference [1] while our code uses a
130 dpi screen as reference.

Anyway, multiplying a size with dp afterwards gives a number of pixels
which is larger on denser displays.

Thinking about it now, we should probably try to be compatible with the
value returned by the corresponding Qt5 method. [2]

Best,
Matthias

[1] http://stackoverflow.com/a/8478997/2319028
[2] http://doc.qt.io/qt-5/qwindow.html#devicePixelRatio

On 05/29/2015 05:53 PM, Larry Shaffer wrote:
> Hi Matthias,
>
> I'm not understanding that referenced calculation. The fixed number
> you multiply the dpi against is platform-specific, yes?
>
> I would be interested in a Qt4-based black box function to manage this
> high-rez scaling.
>
> For reference, though a bit dated:
> http://blog.qt.io/blog/2013/04/25/retina-display-support-for-mac-os-ios-and-x11/
>
> Regards,
>
> Larry Shaffer
> Dakota Cartography
> Black Hills, South Dakota
>
> On Fri, May 29, 2015 at 5:16 AM, Matthias Kuhn <matthias at opengis.ch
> <mailto:matthias at opengis.ch>> wrote:
>
>     Having more SVG icons helps a lot to make the interface look good
>     (despite the fact that some graphics designer may object that
>     there's no hinting)
>
>     For reference, this code is used in QField to calculate button
>     sizes and may as well be used to calculate the default icon size
>     device independently:
>     https://github.com/opengisch/QField/blob/master/src/qgismobileapp.cpp#L110-L113
>
>     Cheers
>
>
>     On 05/29/2015 01:08 PM, Mathieu Pellerin wrote:
>>     I'd say the related changes committed within the last 72 hours
>>     helped a lot in that regard. For one, the icon refresh moved away
>>     from 16 x 16 png icons to SVG graphics. In addition, the icon
>>     size for dock tool buttons are now taking into account the user
>>     preferred icon size.
>>
>>     On Fri, May 29, 2015 at 3:05 PM, Alessandro Pasotti
>>     <apasotti at gmail.com <mailto:apasotti at gmail.com>> wrote:
>>
>>         Please consider HiDPI screens when planning icon sizes, at
>>         least they should be configurable, there is still a settings
>>         option for icon sizes.
>>
>>         At the HF we discussed about the different options, one is to
>>         add options like
>>
>>         very small
>>         small
>>         normal
>>         big
>>         huge
>>
>>         instead of the px size, this should scale nicely converting
>>         sizes to actual pixels according to DPI.
>>
>>
>>
>>
>>         2015-05-29 2:34 GMT+02:00 Mathieu Pellerin
>>         <nirvn.asia at gmail.com <mailto:nirvn.asia at gmail.com>>:
>>
>>             Larry,
>>
>>             As Nyall mentioned, icon size of the dock tool button
>>             will go back to 16 x 16 by default. That'll make things
>>             look the same as before.
>>
>>             That said, the border on the buttons (no present on other
>>             OSes) aren't very nice. It might be worth adding a style
>>             specifically for os x to remove those.
>>
>>             On 29 May 2015 05:37, "Nyall Dawson"
>>             <nyall.dawson at gmail.com <mailto:nyall.dawson at gmail.com>>
>>             wrote:
>>
>>
>>                 On 29 May 2015 5:55 am, "Larry Shaffer"
>>                 <larrys at dakotacarto.com
>>                 <mailto:larrys at dakotacarto.com>> wrote:
>>                 >
>>                 > Hi,
>>                 >
>>                 > The new icons for the Layers and Browser docks look
>>                 good, but now the sizing and spacing looks awkward
>>                 when compared to the main toolbars (see 0, 1 screen
>>                 snaps), especially on Mac. What's the likelihood that
>>                 we can switch those over from QToolButtons to a
>>                 actions on a QToolBar instead for the upcoming
>>                 release? These docks would then look similar to the
>>                 Console's QToolBar (see either screen snap).
>>
>>                 There's some discussion on the pull request regarding
>>                 this, see:
>>
>>                 https://github.com/qgis/QGIS/pull/2071#issuecomment-106283486
>>
>>                 The plan is to drop the icon/button sizes down a
>>                 level (should then match the previous appearance).
>>
>>                 Nyall
>>
>>
>>                 _______________________________________________
>>                 Qgis-developer mailing list
>>                 Qgis-developer at lists.osgeo.org
>>                 <mailto:Qgis-developer at lists.osgeo.org>
>>                 http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>>
>>             _______________________________________________
>>             Qgis-developer mailing list
>>             Qgis-developer at lists.osgeo.org
>>             <mailto:Qgis-developer at lists.osgeo.org>
>>             http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>>
>>
>>
>>         -- 
>>         Alessandro Pasotti
>>         w3:   www.itopen.it <http://www.itopen.it>
>>
>>
>>
>>
>>     _______________________________________________
>>     Qgis-developer mailing list
>>     Qgis-developer at lists.osgeo.org <mailto:Qgis-developer at lists.osgeo.org>
>>     http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>     _______________________________________________
>     Qgis-developer mailing list
>     Qgis-developer at lists.osgeo.org <mailto:Qgis-developer at lists.osgeo.org>
>     http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150530/f655609d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150530/f655609d/attachment-0001.pgp>


More information about the Qgis-developer mailing list