ramensoftware / windows-11-taskbar-styling-guide

A collection of commonly requested taskbar styling customizations for Windows 11
65 stars 6 forks source link

Hide Tray-Icons, better targets? #15

Open ghost opened 4 months ago

ghost commented 4 months ago

Hi, let me start by saying thanks for this amazing software :)

In summary, I want to hide all of these icons from my tray:

image

I hid the Control-Center Icons as described in the readme, via the targets:

systemtray:OmniButton#ControlCenterButton > Grid > ContentPresenter > ItemsPresenter > StackPanel > ContentPresenter[1] > systemtray:IconView > Grid > Grid
systemtray:OmniButton#ControlCenterButton > Grid > ContentPresenter > ItemsPresenter > StackPanel > ContentPresenter[2] > systemtray:IconView > Grid > Grid

That works for the most part, but it leaves behind a hoverable-area which also still displays a tooltip:

image

Obviously this could hardly be called an issue. Now, I wanted to hide the "mic access"-icon well. Using UWPSpy I found an approximate target systemtray:Stack#MainStack, which gives me the desired result. I then tried to simplify the target for the control-center buttons by shortening the target to systemtray:OmniButton#ControlCenterButton, and again, the desired result is achieved. Even better still: the hoverable-area disappears as well.

Now, I really don't know anything about the Win11 Taskbar and UWP in general. Would it be advisable to use these targets? Are they likely to give false-positive results, by capturing too much? Especially the target systemtray:Stack#MainStack sounds like it might be defined a bit too broadly.

For now, I'll use the settings posted below and see if anything comes up.

image
m417z commented 4 months ago

Are they likely to give false-positive results, by capturing too much? Especially the target systemtray:Stack#MainStack sounds like it might be defined a bit too broadly.

It's hard to say without a careful study of the taskbar code and/or the element tree. I agree that it "sounds like it might be defined a bit too broadly", and to be on the safe side, you can make it more specific by adding things such as parent element(s) and/or additional attributes.

MuscularPuky commented 2 months ago

it's not hard. just think easy

image image