Conversation
A-R-C-A
commented
Aug 15, 2016
- Font and dimension adjustments
- Icons centered properly
| winVer ver = (NppParameters::getInstance())->getWinVersion(); | ||
| _rc.bottom += (ver <= WV_XP && ver != WV_UNKNOWN)?xpBottomMarge:w7BottomMarge; | ||
| // ::GetSystemMetrics(SM_CYFRAME) returns 1px more than actually is ? | ||
| _rc.bottom += (::GetSystemMetrics(SM_CYFRAME) - true) * 2; |
There was a problem hiding this comment.
Then why decrease with 'true' instead of '1'?
|
it's the same |
|
Low level yes but...
|
|
OK, I'll change this tomorrow. |
|
Why the weird return value? In addition to 'true' vs '1': Could be written as... or as... |
This is the correct metric for the WS_THICKFRAME Style. The return value is correct for other windows with this style. For the Task List dialog I get this values: The Task List border is 1px smaller, so I assume it is safe to simply decrement the return value.
I don't see the point here. I'm aware of this all. There is no 'bad' with the code above. It is absolutely safe to replace 1 with true. |
I have no idea, yet. Makes it a bigger challenge finding out though ;)
Assumptions are always BAD, at some point in time they will bite you in the a...
I was not sure you were aware, just discard it. |
| _rc.top = 0; | ||
| _rc.bottom = 0; | ||
| _rc = { 0, 0, 0, 0 }; | ||
| TCHAR * buf = new TCHAR[MAX_PATH]; |
There was a problem hiding this comment.
What's the advantage to allocate a string dynamically, whereas we can have an automatic variable here?
There was a problem hiding this comment.
Because potentially allocating 32k on the stack is probably not a good idea. MS tries to fix their crap in their API and the real limit of a path is 32k. So this value may change in the future and there is no good reason to use a static buffer for a path.
(but this has nothing to do with this commit, so it should be a separate commit)
|
Heap vs. stack, leads to a better performance. But in this case there is probably no difference. |