Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Customizing tasks background: Differentiate tasks state (not opened, flashing, minimized, hover) #3

Closed
Nojevah opened this issue Dec 21, 2023 · 15 comments

Comments

@Nojevah
Copy link

Nojevah commented Dec 21, 2023

Thanks for the nice guide, taskbar is always improving.

I know we can change background of tasks thanks to
Target: taskbar:TaskListLabeledButtonPanel > Border#BackgroundElement
(style: Background=#5000F000)

Is there a way to have different background for

  1. Pinned apps not opened
  2. Tasks which have an alert (called "RequestingAttentionRunningIndicator" for Runningindicator element)
  3. All other normal windows (if possible, distinguish minimized tasks but maybe it's not possible)
  4. And all these without losing "hover" effect
    ?
@Nojevah Nojevah changed the title Customizing tasks background: Differentiate tasks state (not opened, flashing, minimized) Customizing tasks background: Differentiate tasks state (not opened, flashing, minimized, hover) Dec 21, 2023
@m417z
Copy link
Member

m417z commented Dec 21, 2023

From the visual states listed in the XAML file which is linked in the mod description, you can find the following visual state group for taskbar:TaskListButtonPanel:

CommonStates

Which has the following states:

RequestingAttentionMultiWindowSharingPressed
RequestingAttentionMultiWindowSharingPointerOver
RequestingAttentionMultiWindowSharing
RequestingAttentionMultiPressed
RequestingAttentionMultiPointerOver
RequestingAttentionMulti
MultiWindowSharingPressed
MultiWindowSharingPointerOver
MultiWindowSharingActive
MultiWindowSharingNormal
MultiWindowPressed
MultiWindowPointerOver
MultiWindowActive
MultiWindowNormal
ActivePressed
ActivePointerOver
WindowSharingRequestingAttentionPressed
WindowSharingRequestingAttentionPointerOver
WindowSharingRequestingAttention
RequestingAttentionPressed
RequestingAttentionPointerOver
RequestingAttention
WindowSharingActivePressed
WindowSharingActivePointerOver
WindowSharingActive
WindowSharingPressed
WindowSharingPointerOver
WindowSharingNormal
ActiveNormal
InactivePressed
InactivePointerOver
InactiveNormal
  1. Perhaps inactive means pinned and active means running.
  2. Everything with RequestingAttention.
  3. I assume it's not possible to distinguish minimized items.
  4. You have PointerOver.

That's a quick reply, I didn't have time to test it yet. Try it and let me know whether it addresses you questions.

@Nojevah
Copy link
Author

Nojevah commented Dec 21, 2023

I've tried Background@ActiveNormal=#5000F000 and a lot of them, but it doesn't work (whereas Background=#5000F000 works).
Maybe it doesn't apply with this target (taskbar:TaskListLabeledButtonPanel > Border#BackgroundElement).

@m417z
Copy link
Member

m417z commented Dec 21, 2023

Yes, you must specify the visual state group, CommonStates, in the target. Something like:

taskbar:TaskListLabeledButtonPanel@CommonStates > Border#BackgroundElement

Without specifying the visual state group in the target, adding a visual state in the styles has no effect.

@Nojevah
Copy link
Author

Nojevah commented Dec 21, 2023

Thanks for the info. Unfortunately, with this method, style is applied as soon as I save it in Windhawk, it does not consider states (like if I didn't put @RequestingAttention in the line).

@m417z
Copy link
Member

m417z commented Dec 21, 2023

Post you target and the list of styles.

@Nojevah
Copy link
Author

Nojevah commented Dec 21, 2023

I use:
Target: taskbar:TaskListLabeledButtonPanel@RequestingAttention > Border#BackgroundElement
Style: Background=#a000F000

And I end up with:
image

Whereas I should have:
image
And only windows with alert (or other CommonStates I've tried) should be displayed differently.

@m417z
Copy link
Member

m417z commented Dec 21, 2023

Try this:
Target: taskbar:TaskListLabeledButtonPanel@CommonStates > Border#BackgroundElement
Style: Background@RequestingAttention=#a000F000

CommonStates is the visual state group. RequestingAttention is the visual state.

@Nojevah
Copy link
Author

Nojevah commented Dec 21, 2023

Thank you, it works with your solution. Some example:

Target: taskbar:TaskListLabeledButtonPanel@CommonStates > Border#BackgroundElement
Styles:
Background@ActiveNormal=#3000ff00
Background@ActivePointerOver=#5000ff00
Background@ActivePressed=#5000ff00
Background@RequestingAttention=#80ff0000
Background@RequestingAttentionPointerOver=#a0ff0000
Background@InactivePointerOver=#30ffffff
Background@InactiveNormal=#10ffffff

RequestingAttention is for flashing windows like anticipated.
Inactive is for background for all tasks... and pinned apps (unfortunately)
Active is for focused app.

It works very well.

I've tried to search for "hover" for SystemTray icons, but I didn't manage to succeed, despite spending hours on UWPSpy and SystemTrayResources.xbf. If you find something, I'm interested, but I guess it's another issue so I'll open it in the future if necessary.

@Imold
Copy link

Imold commented Dec 23, 2023

I've tried to search for "hover" for SystemTray icons, but I didn't manage to succeed, despite spending hours on UWPSpy and SystemTrayResources.xbf. If you find something, I'm interested, but I guess it's another issue so I'll open it in the future if necessary.

For the ControlCenterButton and Clock/NotificationCenterButton

Target:
systemtray:OmniButton > Grid@CommonStates > Border#BackgroundBorder

Styles
Background@Normal=
Background@PointerOver=
Background@Pressed=
Background@Checked=
Background@CheckedPointerOver=
Background@CheckedPressed=
Background@Disabled=

Unfortunately the visual state groups for everything else in the SystemTray are unnamed making them impossible to style based on visual state, unless support is added for unnamed visual state groups.

@m417z
Copy link
Member

m417z commented Dec 24, 2023

@Imold interesting, I didn't know that there are unnamed visual state groups. Can you try forking the mod and removing the following two lines:

(removed)

Edit: I see that it requires more changes. Please try this version:
https://gist.github.com/m417z/77e80ed8d9651a57ec30f4bbc54f127d

Let me know whether it works, if it is, I'll make the change in the mod for the next version.

@Imold
Copy link

Imold commented Dec 24, 2023

@m417z It works. :)
The background for "Show hidden icons" button is available as SystemTray.ChevronIconView > Grid@ > Border#BackgroundBorder and regular SystemTray icons as SystemTray.NotifyIconView > Grid@ > Border#BackgroundBorder both have the visual states Normal, PointerOver, Pressed, CheckedNormal, CheckedPointerOver, and CheckedPressed.
The "Show desktop" button is SystemTray.IconView > Grid@ > Border and has the visual states Normal, PointerOver, and Pressed.

@m417z
Copy link
Member

m417z commented Jan 1, 2024

Happy New Year!

@Imold A slightly delayed update: the 1.2.3 update contains support for unnamed visual state groups.

Also, if you guys have anything interesting to show, post it and perhaps I'll add it to the themes section in the guide.

@Nojevah
Copy link
Author

Nojevah commented Jan 1, 2024

I will put a screenshot if someone had questions, but thanks to WH, we can do some things that were only possible with Litestep shell back in the old time...
image

In this screenshot, I have what looks like a bug/limitation: "UWPSpy" tasks don't have a background despite having a generic "Background" for backup in case I would enter in no "CommonStates". Why UWPSpy only ? Can't tell, these are the only tasks for which I noticed this behavior.
The "RequestionAttention" windows don't have background either during flashing, but it is not really problematic, it may be a Windows way of flashing which is especially noticeable because I have a transparent taskbar.

Here is the code concerning this item:
Target: taskbar:TaskListLabeledButtonPanel@CommonStates > Border#BackgroundElement
Styles:
Background=#df002020
Background@InactiveNormal=#df002020
Background@InactivePointerOver=#ff004040
Background@InactivePressed=#ff004040
Background@ActiveNormal=#ef004020
Background@ActivePointerOver=#ff007020
Background@ActivePressed=#ff007020
Background@RequestingAttention=#ff900000
Background@RequestingAttentionPointerOver=#ffb00000
Background@RequestingAttentionPressed=#ffb00000

For systray, I have nothing particular, just the "hover" which works well (but needs generic background to avoid a visual glitch).
Target: SystemTray.NotifyIconView > Grid@ > Border#BackgroundBorder
Styles:
Background@PointerOver=#ff006060
Background=#00000000

Here are my complete settings in case some would be interested.
PL_W11_Taskbar_Styler_Custom.zip

Or in JSON format that can be imported in the mod's advanced tab: (added by @m417z)
windows-11-taskbar-styler-settings.json

@m417z
Copy link
Member

m417z commented Jan 1, 2024

In this screenshot, I have what looks like a bug/limitation: "UWPSpy" tasks don't have a background despite having a generic "Background" for backup in case I would enter in no "CommonStates". Why UWPSpy only ?

There's a known limitation: UWPSpy and the mod conflict with each other, and when one of them is activated, the other stops receiving notifications about elements. Perhaps that's what causes the issue. Try restarting explorer, and let me know if you see it in a session in which UWPSpy wasn't used.

Regarding the settings, thanks, it's cool but I think it's too specific for a theme entry. Still, somebody who stumbles upon it here may find it useful.

@Nojevah
Copy link
Author

Nojevah commented Jan 1, 2024

OK, thanks for information, like I said, I only saw it with UWPSpy so I'm OK with the explanation.
And yes, I've just put my settings here for people which would end up here by a search engine.

@Nojevah Nojevah closed this as completed Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants