Misaligned background of colored tabs

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Misaligned background of colored tabs

Post by *Sob »

Currently when TC draws background gradient for tabs (for view modes), it always uses fixed size and position (same as tab). But depending on neigboring tabs, it does not always look good:
http://web.hisoftware.cz/sob/tc/tc9-tab-color-background.png

On the left are unmodified screenshots with standard themes, where each line represents following layout :
1) inactive | inactive colored | inactive
2) ACTIVE | inactive colored | inactive
3) inactive | ACTIVE COLORED | inactive
4) inactive | inactive colored | ACTIVE

There are following problems:

a) Clearly wrong with all themes is case 2, because gradient overlaps left tab. This should be fixed (indicated by red numbers). The same happens with case 4 on the right, but it's not possible to see, because the gradient is almost transparent there. So unless there would be some future option to have solid color background, it should not matter.

b) A little less clear (it's wrong, but it does not look too bad; indicated by blue numbers) is gradient over tab's own borders. Fixing this would look better for all except Windows 10, where inactive tab after another inactive tab does not have left border, which would make the gradient look like it's shifted to right.

c) Background of active tab is special case 3. I don't know how much it was intended, but for themes other than Classic, I actually like that 1px white line around gradient. Classic would look better without it (indicated by green numbers).

Right side of image shows how it would look, if all changes were applied.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50550
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC uses the rectangle it gets from TCM_GETITEMRECT call. Here is what I call:

GetClientRect(handle,clientrect);
for i:=0 to tabs.count-1 do begin
SendMessage(Handle, TCM_GETITEMRECT, i, Integer(@r));
if intersectrect(ir,r,clientrect) then begin
// draw gradient in rectangle r
Author of Total Commander
https://www.ghisler.com
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

Hmm, it really returns fixed rectangle, no matter if the tab is active or not, or next to active tab. And it even seems to use this rectangle internally, so if you click on two left or right pixels of active tab, it activates the other tab on left/right.

I'll try to find if there's better way than checking tab position (in relation to active tab) and changing the rectangle manually in some cases.
Post Reply