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

windows-11-notification-center-styler - Always Expand / Increase Width #16

Open
AJolly opened this issue Nov 9, 2024 · 11 comments
Open

Comments

@AJolly
Copy link

AJolly commented Nov 9, 2024

@m417z

I'd love a few options to make the windows notification center more useful,

  1. letting me a default width
  2. Let the notification center be resizable.
  3. Auto expand all notifications.

(This all gets a lot more useful if you've

  1. Increased the max number of notifications sqlite3 "%USERPROFILE%\Local\Microsoft\Windows\Notifications\wpndatabase.db" "UPDATE MetaData SET value = '1500' WHERE key = 'toast:maxCount';"

  2. Set notification center to stay open, or stay open longer

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ImmersiveShell\Launcher]
"DisableLightDismiss"=dword:00000001

[HKEY_CURRENT_USER\Control Panel\Accessibility]
"MessageDuration"=dword:0000001e

I did poke around with UWPSpy to try and change the width, but I couldn't manage to figure it out for the right elements

@m417z m417z transferred this issue from ramensoftware/windhawk-mods Nov 9, 2024
@m417z
Copy link
Member

m417z commented Nov 9, 2024

Hi, since it's not a mod enhancement suggestion, I moved it to a more appropriate place - notification center styling guide. I don't have time to look at it right now, but perhaps somebody will be able to help you. You can also join our Discord server where we have a channel about styles.

@AJolly
Copy link
Author

AJolly commented Nov 9, 2024

Will check out the discord - but isn't it a feature enhancement? (Auto expand all notifications?)

@m417z
Copy link
Member

m417z commented Nov 10, 2024

Not for this mod. Windows 11 Notification Center Styler is designed to allow settings styles for UI elements, not for doing specific things like "Auto expand all notifications", which perhaps can be achieved via styles. It could be a suggestion for a new mod, though.

@bbmaster123
Copy link
Collaborator

Looks like its a visual state ExpandedStateGroup -> Expanded/Collapsed
Since we can't directly set the visual state using styles alone, we can't have the notifications appear automatically in the expanded state (unless there happens to be a style somewhere that does directly control the state, like a hypothetical "IsExpandedView" property)

However, what we can do is set how many lines of text each notification will show, and set the height of the element to a value large enough to fit the whole text. something like this for a start:

  "controlStyles[0].target": " Windows.UI.Xaml.Controls.TextBlock#Content",
  "controlStyles[0].styles[0]": "MaxLines=4",
  "controlStyles[0].styles[1]": "Padding=5",
  "controlStyles[0].styles[2]": "MinHeight=100",
  "controlStyles[0].styles[3]": "TextTrimming=0",
  "controlStyles[0].styles[4]": "TextWrapping=3",
  "controlStyles[0].styles[5]": "IsTextTrimmed=0"

this would basically show the notification details while still technically being in the collapsed state, I believe that's the best we can achieve right now

@m417z
Copy link
Member

m417z commented Nov 10, 2024

I didn't have the chance to look at it, but perhaps it'd also be possible to have a keyboard shortcut for it, similar to (from the guide):

Add accelerator key (Alt+X) to clear all notifications

Target: Button#ClearAll
Style: AccessKey=x

@AJolly
Copy link
Author

AJolly commented Nov 11, 2024

@bbmaster123 Thanks, that does help a ton
I'm using 0 for padding and removed the MinHeight.

Any chance you know how to increase the width?
I've tried defining the width on Windows.UI.Xaml.Window or Windows.UI.Xaml.Internal.RootScrollViewer but then it just ends up offscreen.

I suspect I may need to set something on the Windows.UI.Xaml.Window but all the attributes are empty when I look at it in UWPSpy.

@bbmaster123
Copy link
Collaborator

bbmaster123 commented Nov 12, 2024

@AJolly
it should be as simple as Width=value, but if that isn't working you can usually also use MinWidth depending on the target. Also make sure its parent element (if there is one) has enough space for the child element to be widened

I've tried defining the width on Windows.UI.Xaml.Window or Windows.UI.Xaml.Internal.RootScrollViewer but then it just ends up offscreen.

Unfortunately we cannot target the root window in either UWPSpy or windhawk, only the child elements.

If elements are going off screen, its likely the element you want to widen (whole notification panel?) is either being constrained by a parent element, or constrained by a bounding box. If the former, you should be able to just widen the parent element and then the desired child element. If the latter, we would need a whole new windhawk mod to deal with it.

Please check out my guide if you haven't already, I explain this and more in further detail:
https://github.com/bbmaster123/FWFU/blob/main/uwpspy.md

Let me know if you have any other questions! :)

@AJolly
Copy link
Author

AJolly commented Nov 14, 2024

Dang, I suspect its the root window that[s bounding it. If I increase width for Windows.UI.Xaml.Controls.ScrollViewer it moves to the right. Its parent element is the root.

But why does it always move right, can we force it to move left, or set the rectangle boundaries directly?
image

After increasing width:
image

The guide is useful,
I do wish that I could view the Detailed Property List but filter out 0's, or sort.
Also if the Attributes had a tooltip documenting what each did, rather than me having to always go look it up.

What would it take to hook the root element? It seems like windhawk can hook quite a lot, so its got to be possible

@bbmaster123
Copy link
Collaborator

bbmaster123 commented Nov 14, 2024

@AJolly
most likely it moves to the right due to HorizontalAlignment (not HorizontalContentAlignment), which might be set to 0 or 3 by default.
HorizontalAlignment
If its not set to center, changing the width would push it to one side or the other

Also if the Attributes had a tooltip documenting what each did, rather than me having to always go look it up.

Agreed

I'd be happy to document what each does and link it to the guide (plus default value). Maybe at some point it could be included in uwpspy as tooltips too. There are a lot though, would take some time to write out all those descriptions!

What would it take to hook the root element?
That would take a new mod, like in the case of the taskbar. It too had a bounding box preventing us from simply moving it to the top or sides without specific mod code.

Without a new mod, this is about as wide as I could get it:
image
Its clearly not that big of a difference

It seems like windhawk can hook quite a lot, so its got to be possible

Its not impossible but it would take some effort. Might be worth making a request on the discord

@AJolly
Copy link
Author

AJolly commented Nov 16, 2024

@bbmaster123 What settings did you use to get it that wide?
Or just go to advanced and copy paste the config from there.

I wouldn't expect anyone to write all that documentation, just copy the first line from the existing api docs.
For example
https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.horizontalalignment?view=winrt-26100

@bbmaster123
Copy link
Collaborator

@AJolly
I think I used

target: Windows.UI.Xaml.Controls.Frame 
style: Padding=-52,0,0,0

I'm less busy now so shoot me a ping if that doesn't work :)

I wouldn't expect anyone to write all that documentation, just copy the first line from the existing api docs.

normally I'd agree about just copying from the ms docs, but honestly I think I would need to rewrite a lot of the descriptions for clarity anyways. A lot of users need everything to be eli5. Plus I'd rather write it out once in the tooltip than 100 times in the issues section.

Indicates where an element should be displayed on the horizontal axis relative to the allocated layout slot of the parent
element.

or

Position entire element on X-Axis
0=left, 1=center, 2=right, 3=stretch

but anyway I'm happy to do it :)

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