Win 8 toolbar toggle is awfully funny looking (checker background, etc.)

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Mick P.
Earned some good credits
Earned some good credits
Posts: 127
Joined: Thu Jun 06, 2019 3:41 am
Contact:

Win 8 toolbar toggle is awfully funny looking (checker background, etc.)

Post by Mick P. » Wed Dec 11, 2019 12:57 am

A Windows 8 user has pointed out to me their toolbar looks unusual. I've added wxTB_FLAT to get it too look more correct, however the toggled button-like tools still look really strange. I'm not sure if there are any more wxToolBar styles but it would be hard for me to test, so I wonder if anyone here has experience.

How it looks is the background of the tool icon is a checkerboard kind of like you'd expect from an image editing software to fill in transparent regions, but I can't fathom why Microsoft would style a selected tool this way. It seems to have some kind of button like bevel effect too, but maybe it's cut off since I've set it up to have smallest possible margin.

I describe it because the screenshot is huge (https://github.com/zturtleman/mm3d/issu ... -562690012) if you want to look.

P.S. The linked thread has to do with some wxWidgets application code I've been able to publish. Since the regulars here regularly ask me for sources, etc. here's (https://github.com/mick-p1982/mm3d/rele ... win32-demo) your chance. I had to rush to publish so it only has wxGTK3 support tested with styling and must be built on Linux, but it should be easy to build, other than the UI framework is a separate project that must be built/installed also.

EDITED: I just double-checked the EXE has common-controls "manifest" with a resource inspector to be sure it wasn't overridden by a leftover manifest file in the project's source tree. I mention it since I expect Visual Styles is the first explanation someone might give. (Though oddly it seems to have two near identical declarations in there.)

Code: Select all

<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level='asInvoker' uiAccess='false' />
      </requestedPrivileges>
    </security>
  </trustInfo>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*' />
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*' />
    </dependentAssembly>
  </dependency>
</assembly>

User avatar
doublemax
Moderator
Moderator
Posts: 14630
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Win 8 toolbar toggle is awfully funny looking (checker background, etc.)

Post by doublemax » Wed Dec 11, 2019 6:18 am

Do you mean the dark grey background of the icons?

As the title bar is black and the grey is the same color as the menu bar, i assume the user is using a very unusual color theme.

Here's what it looks on a "normal" Windows 8.1, seems ok to me:
w81screen.png
w81screen.png (17.7 KiB) Viewed 295 times
(There are some redraw problems when resizing the window, but i guess that's a different issue)
Use the source, Luke!

Mick P.
Earned some good credits
Earned some good credits
Posts: 127
Joined: Thu Jun 06, 2019 3:41 am
Contact:

Re: Win 8 toolbar toggle is awfully funny looking (checker background, etc.)

Post by Mick P. » Wed Dec 11, 2019 5:04 pm

Thank you! It does look normal for you, so my guess like yours is something about this user's theme. I don't think it's a Classic/Contrast theme, but it's hard to imagine what the strategy is there for Win32.
Do you mean the dark grey background of the icons?
Well, no, that's to match the rest of the program, but it could be a factor that the background color is set.

I will take this up with them to see if they will play with their theme settings.
(There are some redraw problems when resizing the window, but i guess that's a different issue)
Can you elaborate please? I don't have problems on Windows 10, other than the usual Windows resize problems... that are temporary. I think I can borrow a Win 8 laptop to try to do some tests. (Edited: to be more specific resizing on my Win 10 system has artifacts in the repainted regions on the edges, that are typical of a Windows app that can't keep up with the refresh-rate.)

Minor thing: The way your Win 8 tool highlight extends down extra pixel and gets cutoff isn't a wxWidgets thing since a Win32 API is used to tighten them up. (I wonder what's going on at Microsoft that that's inconsistent.) Otherwise it's pixel perfect with Win 10!

Mick P.
Earned some good credits
Earned some good credits
Posts: 127
Joined: Thu Jun 06, 2019 3:41 am
Contact:

Re: Win 8 toolbar toggle is awfully funny looking (checker background, etc.)

Post by Mick P. » Wed Dec 11, 2019 5:51 pm

EDITED: I added a test model (https://github.com/mick-p1982/mm3d/rele ... _test.mm3d) to the demo set with animations in case anyone cares to see the software in action.

One of its images (https://github.com/mick-p1982/mm3d/rele ... uncomp.tga) fails to load in my Linux environment (CentOS7 EPEL wxGTK3) but I can't see any obvious reason for that, so I assume it's something that happened to be broken when that package was prepared.

For completeness there is another image (https://github.com/mick-p1982/mm3d/rele ... b_comp.tga) that does load. Note, one uses a compressed path, but the compression is just run/length compression.

All files available here (https://github.com/mick-p1982/mm3d/rele ... win32-demo) with test file information.

User avatar
doublemax
Moderator
Moderator
Posts: 14630
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Win 8 toolbar toggle is awfully funny looking (checker background, etc.)

Post by doublemax » Wed Dec 11, 2019 6:20 pm

Here two screenshots with the resize issue:
mm3d_2.png
mm3d_2.png (13.9 KiB) Viewed 255 times
mm3d_1.png
mm3d_1.png (16.81 KiB) Viewed 255 times
While resizing it switches quickly between the black and the correct redraw. If i had to guess i'd say it depends on whether the dimensions of the indiviual panels are odd or even numbers.
Use the source, Luke!

Mick P.
Earned some good credits
Earned some good credits
Posts: 127
Joined: Thu Jun 06, 2019 3:41 am
Contact:

Re: Win 8 toolbar toggle is awfully funny looking (checker background, etc.)

Post by Mick P. » Fri Dec 13, 2019 2:33 am

Thank you Image I think this must be a driver difference since everything looks normal except for the backgrounds.

I haven't updated the demo or anything but the simplest explanation is the glClear (background fill) call is done before glViewport. (They're not supposed to be related but maybe your driver is over correcting since programmers often get this wrong. I think I reversed them to keep a user hook from clobbering the state. It's more natural to do them the other way.)

EDITED: I guess I should test this. Give me a second to prepare a new build if you don't mind.

EDITED: Here (https://github.com/mick-p1982/mm3d/rele ... rtable.zip) is an updated EXE although I'm only 50% confident this is a fix since the viewport shape should survive resize events and context switches. I don't want to impose but I also don't want to seem like I'm not doing everything I can in kind [-o<

User avatar
doublemax
Moderator
Moderator
Posts: 14630
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Win 8 toolbar toggle is awfully funny looking (checker background, etc.)

Post by doublemax » Fri Dec 13, 2019 7:45 pm

No more redraw issues with that new version.
Use the source, Luke!

Post Reply