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

The same distance of the taskbar from the edge of the screen regardless of Windows scaling and resolution #159

Open
Jaros7aw opened this issue Dec 31, 2024 · 1 comment

Comments

@Jaros7aw
Copy link

I'll start by saying that I'm not reporting a bug, but rather looking for help. I wanted to get rounded corners for the taskbar and have it be equidistant from the edge of the screen. I changed the values ​​to what suits me and it's fine. Here below:

{
"controlStyles[0].target": "Taskbar.TaskbarFrame#TaskbarFrame",
"controlStyles[0].styles[1]": "HorizontalAlignment=Center",
"controlStyles[0].styles[2]": "Width=Auto",
"controlStyles[1].target": "Taskbar.TaskbarFrame#TaskbarFrame > Grid#RootGrid",
"controlStyles[1].styles[0]": "Padding=0,-1,0,-1",
"controlStyles[1].styles[1]": "Margin=0,1,0,1",
"controlStyles[1].styles[2]": "BorderThickness=1",
"controlStyles[1].styles[3]": "BorderBrush:=<SolidColorBrush Color="{ThemeResource SurfaceStrokeColorDefault}" Opacity="0.5" />",
"controlStyles[2].target": "Rectangle#BackgroundFill",
"controlStyles[2].styles[0]": "Visibility=Collapsed",
"controlStyles[3].target": "Rectangle#BackgroundStroke",
"controlStyles[3].styles[0]": "Visibility=Collapsed",
"controlStyles[1].styles[4]": "CornerRadius=5",
"controlStyles[1].styles[5]": "Background:=<AcrylicBrush TintColor="{ThemeResource CardStrokeColorDefaultSolid}" FallbackColor="{ThemeResource CardStrokeColorDefaultSolid}" TintOpacity="0" TintLuminosityOpacity=".55" Opacity="1"/>",
"controlStyles[0].styles[0]": "MaxWidth=2046",
"controlStyles[0].styles[3]": "MinWidth=2046"
}

Unfortunately, these settings only work for a specific resolution and screen scaling - in my case 2560 x 1600 / 125%. When changing the Windows scaling to 100% or 175%, for example, the taskbar goes beyond the visible area of ​​the screen or is squeezed in. Please look attached screenshots. This is determined by 2 parameters:

"controlStyles[0].styles[0]": "MaxWidth=2046",
"controlStyles[0].styles[3]": "MinWidth=2046",

  1. What values ​​should I change or add so that regardless of the Windows scaling setting, the Start bar is always spaced from the left and right edges by a constant pixel value (or Padding, Margin)?

  2. I would like the taskbar color to be the default used by Windows for both light and dark themes (without Acrylic Brush and others). But also after enabling transparency in windows system so that it behaves identically by default as originally before. What should I enter and change in the lines below?

"controlStyles[1].styles[3]": "BorderBrush:=<SolidColorBrush Color="{ThemeResource SurfaceStrokeColorDefault}" Opacity="0.5" />",
"controlStyles[1].styles[5]": "Background:=<AcrylicBrush TintColor="{ThemeResource CardStrokeColorDefaultSolid}" FallbackColor="{ThemeResource CardStrokeColorDefaultSolid}" TintOpacity="0" TintLuminosityOpacity=".55" Opacity="1"/>",

Thank for your help and best regards
100
125
175

@bbmaster123
Copy link
Collaborator

No worries, you're absolutely welcome to ask for help here :)

  1. Width or Padding.
    Min/MaxWidth sets an upper and lower bound to the taskbar's calculated width in pixels, while width sets exactly the the width of the taskbar (or any element) at all times. This of course means the taskbar itself will never expand or squish.

Padding adds a border to the inside of an element, at all times, regardless of what its width currently is. for example, lets go with your resolution of 2560x1600 and your desired width of 2046px.

( 2560 total pixel wide) - (2046 desired taskbar pixels) = 514
514/2 = 257
so you'd set Padding=257,0,257,0

Either Width or padding should work in this case, but its still good to be aware of both options

  1. ah so the issue with the background color is that most elements accept a background parameter (Background=X) but some elements like Rectangle for example use Fill instead, just change background to fill and the style should work just fine.
    For border, sometimes its necessary to also set BorderThickness=X as a lot of elements have this set to 0 by default.

cheers!

@Jaros7aw
Copy link
Author

Jaros7aw commented Dec 31, 2024

Problem was solved. Im looking only default values for Windows 11 (TintOpacity="0" TintLuminosityOpacity=".55"):

}
"controlStyles[1].styles[5]": "Background:=",
{

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

2 participants