lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [PATCH] Skin appearance improvements


From: Greg Chicares
Subject: Re: [lmi] [PATCH] Skin appearance improvements
Date: Sun, 3 Jul 2016 12:04:00 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0

On 2016-07-02 22:46, Vadim Zeitlin wrote:
> On Sat, 2 Jul 2016 22:24:52 +0000 Greg Chicares <address@hidden> wrote:
[...]
> GC> I know we've discussed this
> GC> before, but I've re-read everything on this mailing list that contains
> GC> the string "dialog unit" and I'm still unsure. This documentation:
> GC>   
> http://docs.wxwidgets.org/trunk/overview_xrcformat.html#overview_xrcformat_type_size
> GC> says that "90" above represents DPI-independent pixel units.
> 
>  Without "d" this would be correct. Some time ago we decided that it made
> sense to use DPI-independent pixels in XRC because it's impossible to
> implement proper scaling in XRC otherwise, so it's the only way for
> XRC-based layouts to look right in high DPI. Note that this does *not*
> apply to the pixel values used in C++ code because there it is possible
> (and even quite common, although not universal) to use already scaled
> values, e.g. anything based on GetCharWidth() would already scale with DPI.

Okay, so...

(1) "100" in C++ code means real pixels, with no adjustment for either
DPI or dialog font;

(2) "100" in XRC code means DPI-independent pixels, with no adjustment
for the dialog font; and

(3) "100d" in XRC code means dialog units, which adjust for the dialog
font...and also for DPI, because that affects the font.

I'm not using themes, and lmi doesn't override the default font, so
I notice DPI dependence, but not font dependence. End users generally
use themes, so they notice font-size dependence. But everything should
look right to everyone if lmi uses only dialog units in XRC files.
Now, lmi rarely specifies sizes in dialog units, but it should use
them generally, in preference to DIPs, right?

> GC> BTW, why did you suggest
> GC> >         <size>50,-1d</size>
> GC> above, with 'd' only on the second element?
> 
>  This is just how XRC syntax works, quoting the very same URL mentioned
> above the grammar is
> 
>       size := x "," y ["d"]
> 
> and "d", if specified, applies to both x and y.

Aha. When I read
  
http://docs.wxwidgets.org/trunk/overview_xrcformat.html#overview_xrcformat_type_size
| Semi-formally the format is:
|   size := x "," y ["d"]
I interpreted "Semi-formally" as meaning the grammar is not rigorous,
so I read further (on the same screen, but in a later section):
| When "d" suffix is used, the integer preceding it is interpreted as
| dialog units in the parent window, otherwise it's a DPI-independent
| pixel value
and concluded that the "formal" grammar was perhaps
  size := x ["d"] "," y ["d"]
and that in "<size>50,-1d</size>" the "d" applied only to "-1", which
is "the integer preceding it". Would a change like
- Semi-formally the format is:
+ Formally the format is:
make sense?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]