ramensoftware / windows-11-taskbar-styling-guide

A collection of commonly requested taskbar styling customizations for Windows 11
151 stars 12 forks source link

(Docklike) Empty space when only 2 apps are open #101

Open e391hed12 opened 1 week ago

e391hed12 commented 1 week ago

image

Is there a way to eliminate that space to the right of the Opera icon?

bbmaster123 commented 1 week ago

try this?

{
  "theme": "DockLike",
  "controlStyles[0].target": "Microsoft.UI.Xaml.Controls.ItemsRepeater#TaskbarFrameRepeater",
  "controlStyles[0].styles[0]": "HorizontalAlignment=1",
  "controlStyles[0].styles[1]": "Margin=0"
}

image

looks correct to me but I didn't measure it haha cheers :)

e391hed12 commented 1 week ago

Thanks a lot!!

LeChocolatChaud commented 1 week ago

After some investigations with UWPSpy, I found this element set to a fixed width:

Taskbar.Gripper#GripperControl

Taskbar.Gripper#GripperControl

Setting its width to Auto completely eliminated the empty space.

Result effect

bbmaster123 commented 1 week ago

very interesting, it does work, and also, setting its width to a static value seems to set a minimum width for the dock, while still letting it expand: image image Thanks for sharing!!

m417z commented 1 week ago

@bbmaster123 @AmberWat how about setting width to Auto in the theme? Any downsides?

AmberWat commented 1 week ago

I'm not sure what the gripper does, if anything. It looks like it's meant to be some sort of handle for dragging but it seems to be left unused. If we wanted to be super safe we could probably do Width=Auto and combine it with something like MinWidth=24 so that it's still there if something needs it.

m417z commented 1 week ago

I suspect it might be the tablet mode thing. Should be possible to verify with the tablet posture registry option.

image

bbmaster123 commented 1 week ago

@m417z

Yes it looks like the gripper is specifically the grey horizontal line in the tablet mode taskbar: image

shouldn't be a problem as long as we include MinWidth. Without it, the horizontal grey line is missing. Other than that, it makes it a bit hard to right click the taskbar. We could also add a 5px margin to the framerepeater to mitigate this:

{
  "theme": "DockLike",
  "controlStyles[0].target": "Taskbar.Gripper#GripperControl",
  "controlStyles[0].styles[0]": "Width=Auto",
  "controlStyles[0].styles[1]": "MinWidth=24",
  "controlStyles[1].target": "Microsoft.UI.Xaml.Controls.ItemsRepeater#TaskbarFrameRepeater",
  "controlStyles[1].styles[0]": "Margin=5,0,5,0"
}

Otherwise, we could change the BackgroundFill in the theme from Collapsed to Opacity=0

m417z commented 1 week ago

Otherwise, we could change the BackgroundFill in the theme from Collapsed to Opacity=0

I think that's fine, the taskbar is not clickthrough anyway (https://github.com/ramensoftware/windhawk-mods/issues/805), at least the empty space could be used for the menu and perhaps click actions with the mod.

bbmaster123 commented 1 week ago

Fair enough. Thoughts on 5px on each side vs 0px or some other value? I can push it through tonight

AmberWat commented 1 week ago

@m417z

Otherwise, we could change the BackgroundFill in the theme from Collapsed to Opacity=0

That doesn't work, at least when I test it. RootGrid is the element that controls where right clicking summons the menu.

Other than that, it makes it a bit hard to right click the taskbar. We could also add a 5px margin to the framerepeater to mitigate this

Well, I actually did put a slight padding on RootGrid. It doesn't make sense to have properties on multiple elements working towards the same thing. Maybe get rid of the margin on TaskbarFrameRepeater and instead up the padding on Taskbar.TaskbarFrame#TaskbarFrame > Grid#RootGrid to Padding=6,0,6,0? (I think a total padding of 6 looks best)

bbmaster123 commented 1 week ago

@AmberWat done! feel free to ping me if any more changes are needed :)

ksb2311 commented 1 week ago

image Is there any way to separate widget to left from dock in DockLike