ramensoftware / windows-11-taskbar-styling-guide

A collection of commonly requested taskbar styling customizations for Windows 11
61 stars 5 forks source link

Replacing Tray Icons #28

Open Minlor opened 1 month ago

Minlor commented 1 month ago

I'm wondering if there would be a possible way to replace the tray icons, so far currently what I'm doing is just putting a background but the icon is still visible. image For example the volume icon. (The other one is me attempting to replace the network one but failing 😂)

m417z commented 1 month ago

Where did you set the background? The icon is set by an InnerTextBlock element, you can try replacing the text with spaces.

image

Minlor commented 4 weeks ago

Hello,

So the way I ended up settings the background is by doing the following: Target: SystemTray.OmniButton#ControlCenterButton > Grid > ContentPresenter > ItemsPresenter > StackPanel > ContentPresenter[1] > SystemTray.IconView > Grid > Grid Value: Background:=<ImageBrush Stretch="Uniform" ImageSource="E:\Windows\Icons\Lumicons\Icons\System\Network and Sharing.ico" />

Also I now removed the icon with the following Target: SystemTray.OmniButton#ControlCenterButton > Grid > ContentPresenter > ItemsPresenter > StackPanel > ContentPresenter[1] > SystemTray.IconView > Grid > Grid > SystemTray.TextIconContent > Grid > SystemTray.AdaptiveTextBlock[2] > TextBlock Value: Text=

Though I'm not sure how can I add multiple spaces or just make it empty and not null? Using UWPSpy it just works but with Windhawk it always just adds null instead

Kind regards.

m417z commented 4 weeks ago

Though I'm not sure how can I add multiple spaces or just make it empty and not null? Using UWPSpy it just works but with Windhawk it always just adds null instead

Windhawk strips spaces, so it doesn't work. Maybe I need to lift this limitation, or add an option for quotes like Text=" ". For now, I believe you can set the text to empty and in addition set the width.

Minlor commented 4 weeks ago

Though I'm not sure how can I add multiple spaces or just make it empty and not null? Using UWPSpy it just works but with Windhawk it always just adds null instead

Windhawk strips spaces, so it doesn't work. Maybe I need to lift this limitation, or add an option for quotes like Text=" ". For now, I believe you can set the text to empty and in addition set the width.

Yup, adding width helped out! Thank you so much for your help! 😄

Also, would probably be a good idea for the quotes (that's also the first thing which I tried) but then I'm wondering what if a user is trying to add quotes for some reason so maybe an escape character.