Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Some white icons for Windows apps are not visible on white background #7

Closed
bege10 opened this issue Dec 1, 2019 · 8 comments
Closed
Labels
bug Something isn't working

Comments

@bege10
Copy link

bege10 commented Dec 1, 2019

Thank you for this package!
With the standard configuration all icons are white.
To see the icons for Windows app and settings on white background I have configured preferred_contrast = white . Most icons are black and visible now.
But the icons of Maps, Print 3D, 3D Viewer and Microsoft Store are still white. Can this be changed in Keypirinha-WindowsApps?

@bege10 bege10 changed the title White icons for Windows apps and settings not visible on white background Some white icons for Windows apps are not visible on white background Dec 1, 2019
@ueffel
Copy link
Owner

ueffel commented Dec 1, 2019

It's a problem with the logo caching mechanism.
Keypirinha can only show icons that come from the package itself or from the keypirinha cache directory. So I copy the logos from the path of the windows apps to this cache. This copying is done everytime the catalog refreshes. To stop unnecessary copying the package checks if the logo already exists. This is a problem if you change the preferred_constrast setting and file name of the constrast-white- and the constrast-black-logo are the same.

Until I fix this, you can just delete the logo cache %LOCALAPPDATA%\Keypirinha\Packages\WindowsApps (installed mode) or <Keypirinha_Home>\portable\Local\Packages\WindowsApps\ (portable mode)
and execute Keypirinha: Refresh Catalog: WindowsApps in keypirinha.

@ueffel ueffel added the bug Something isn't working label Dec 1, 2019
@ueffel ueffel closed this as completed in c083717 Dec 1, 2019
@bege10
Copy link
Author

bege10 commented Dec 3, 2019

Thank you for your answer.
Your suggestion solved the problem for the apps but 3D Viewer. That icon is still white. And now the icon for settings is white.
I deleted the icon cache and changed preferred_constrast from white to black and back again and restarted KP several times. But there is no change. App icons remain black, settings icon remains white.

ueffel added a commit that referenced this issue Dec 3, 2019
removed too much of the unecessary config reading
@ueffel
Copy link
Owner

ueffel commented Dec 3, 2019

The not-changing settings-icon was my bad in the last commit. Should fine now.

As for the 3D-Viewer: As far as I can see this app does not provide constrast icons. (See C:\Program Files\WindowsApps\Microsoft.Microsoft3DViewer_7.1908.9012.0_x64__8wekyb3d8bbwe)

Normally there some constrast logos, for example for the windows weather app there are some in C:\Program Files\WindowsApps\Microsoft.BingWeather_4.33.13253.0_x64__8wekyb3d8bbwe\Assets\AppTiles\contrast-white

@bege10
Copy link
Author

bege10 commented Dec 5, 2019

I downloaded v0.8.3,

deleted the icon cache,
set settings to black,
refreshed the package catalog
= all icons white

repeated the above with settings white
= icons remain white

Which setting is correct for a white background, black or white?

@ueffel
Copy link
Owner

ueffel commented Dec 5, 2019

The background of nearly all windows default app logos is transparent. The foreground color changes.

preferred_contrast = black

means the logo has better contrast on dark backgrounds which is why the logo foreground is usally white.
image

preferred_contrast = white

means the logo has better contrast on light backgrounds which is why the logo foreground is usally black.
image

While taking these screenshots I noticed that Keypirinha seems to keep the icons, which were already displayed, cached at runtime and does not seem to refresh if the underlying file changes.
Meaning if I viewed the Weather App icon, then change the preferred_contrast and view the Weather App again, the icon does not change. But if I view some other app, like Maps, icon of that is in the preferred_contrast.

I'll need to investigate further.

@ueffel ueffel reopened this Dec 5, 2019
@ueffel
Copy link
Owner

ueffel commented Dec 5, 2019

Can you try this and see if it works for you?

WindowsApps.zip
Rename to WindowsApps.keypirinha-package

@bege10
Copy link
Author

bege10 commented Dec 6, 2019

Now both Windows apps and settings icons are correct and are being refreshed as soon as the app setting is changed. Thank you very much for your work.

@bege10 bege10 closed this as completed Dec 6, 2019
@ueffel
Copy link
Owner

ueffel commented Dec 6, 2019

Alright, I'll make a new version.

ueffel added a commit that referenced this issue Dec 6, 2019
To reliably replace icons at runtime it seems one has to free existing icons. Icon handle seems to be cached if they have aliready been displayed. Changing the underlying file of the icon handle does not change the cached icon, so they have to be freed and recreated.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants