1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2025-02-10 16:02:59 +01:00

StartUI: Implemented docked rounded corners style

This commit is contained in:
Valentin Radu 2022-03-02 00:48:35 +02:00
parent 43acfc1235
commit 79a0b75327
3 changed files with 49 additions and 18 deletions

View File

@ -92,7 +92,7 @@ Windows_UI_Xaml_IDependencyObject* LVT_FindChildByName(Windows_UI_Xaml_IDependen
} }
// Referenece: https://www.reddit.com/r/Windows10/comments/nvcrie/windows_11_start_menu_how_to_temporary_make_your/ // Referenece: https://www.reddit.com/r/Windows10/comments/nvcrie/windows_11_start_menu_how_to_temporary_make_your/
void LVT_StartUI_EnableRoundedCorners(HWND hWnd, BOOL bApply) void LVT_StartUI_EnableRoundedCorners(HWND hWnd, DWORD dwReceipe)
{ {
WCHAR wszDebug[MAX_PATH]; WCHAR wszDebug[MAX_PATH];
HRESULT hr = S_OK; HRESULT hr = S_OK;
@ -159,7 +159,7 @@ void LVT_StartUI_EnableRoundedCorners(HWND hWnd, BOOL bApply)
{ {
int location = LVT_LOC_NONE; int location = LVT_LOC_NONE;
if (bApply) if (dwReceipe)
{ {
Windows_UI_Xaml_Thickness drc; Windows_UI_Xaml_Thickness drc;
drc.Left = 0.0; drc.Right = 0.0; drc.Top = 0.0; drc.Bottom = 0.0; drc.Left = 0.0; drc.Right = 0.0; drc.Top = 0.0; drc.Bottom = 0.0;
@ -228,7 +228,7 @@ void LVT_StartUI_EnableRoundedCorners(HWND hWnd, BOOL bApply)
pDropShadow->lpVtbl->QueryInterface(pDropShadow, &IID_Windows_UI_Xaml_IUIElement, &pIUIElement); pDropShadow->lpVtbl->QueryInterface(pDropShadow, &IID_Windows_UI_Xaml_IUIElement, &pIUIElement);
if (pIUIElement) if (pIUIElement)
{ {
if (bApply) if (dwReceipe)
{ {
pIUIElement->lpVtbl->put_Visibility(pIUIElement, Windows_UI_Xaml_Visibility_Collapsed); pIUIElement->lpVtbl->put_Visibility(pIUIElement, Windows_UI_Xaml_Visibility_Collapsed);
} }
@ -253,28 +253,28 @@ void LVT_StartUI_EnableRoundedCorners(HWND hWnd, BOOL bApply)
{ {
double pad = 12.0; double pad = 12.0;
Windows_UI_Xaml_Thickness th; Windows_UI_Xaml_Thickness th;
if (location) if (location && dwReceipe == 1)
{ {
if (location == LVT_LOC_BOTTOMLEFT) if (location == LVT_LOC_BOTTOMLEFT)
{ {
th.Left = bApply ? pad : 0.0; th.Left = dwReceipe ? pad : 0.0;
th.Bottom = bApply ? pad : 0.0; th.Bottom = dwReceipe ? pad : 0.0;
th.Right = 0.0; th.Right = 0.0;
th.Top = 0.0; th.Top = 0.0;
} }
else if (location == LVT_LOC_TOPLEFT) else if (location == LVT_LOC_TOPLEFT)
{ {
th.Left = bApply ? pad : 0.0; th.Left = dwReceipe ? pad : 0.0;
th.Bottom = 0.0; th.Bottom = 0.0;
th.Right = 0.0; th.Right = 0.0;
th.Top = bApply ? pad : 0.0; th.Top = dwReceipe ? pad : 0.0;
} }
else if (location == LVT_LOC_TOPRIGHT) else if (location == LVT_LOC_TOPRIGHT)
{ {
th.Left = 0.0; th.Left = 0.0;
th.Bottom = 0.0; th.Bottom = 0.0;
th.Right = bApply ? pad : 0.0; th.Right = dwReceipe ? pad : 0.0;
th.Top = bApply ? pad : 0.0; th.Top = dwReceipe ? pad : 0.0;
} }
} }
else else
@ -304,11 +304,39 @@ void LVT_StartUI_EnableRoundedCorners(HWND hWnd, BOOL bApply)
pAcrylicBorder->lpVtbl->QueryInterface(pAcrylicBorder, &IID_Windows_UI_Xaml_Controls_IBorder, &pIBorder); pAcrylicBorder->lpVtbl->QueryInterface(pAcrylicBorder, &IID_Windows_UI_Xaml_Controls_IBorder, &pIBorder);
if (pIBorder) if (pIBorder)
{ {
double pad = 10.0;
Windows_UI_Xaml_CornerRadius cr; Windows_UI_Xaml_CornerRadius cr;
cr.BottomLeft = (bApply ? 10.0 : 0.0); if (location && dwReceipe == 2)
{
if (location == LVT_LOC_BOTTOMLEFT)
{
cr.BottomLeft = 0.0;
cr.BottomRight = 0.0;
cr.TopLeft = 0.0;
cr.TopRight = dwReceipe ? pad : 0.0;
}
else if (location == LVT_LOC_TOPLEFT)
{
cr.BottomLeft = 0.0;
cr.BottomRight = dwReceipe ? pad : 0.0;
cr.TopLeft = 0.0;
cr.TopRight = 0.0;
}
else if (location == LVT_LOC_TOPRIGHT)
{
cr.BottomLeft = dwReceipe ? pad : 0.0;
cr.BottomRight = 0.0;
cr.TopLeft = 0.0;
cr.TopRight = 0.0;
}
}
else
{
cr.BottomLeft = (dwReceipe ? 10.0 : 0.0);
cr.BottomRight = cr.BottomLeft; cr.BottomRight = cr.BottomLeft;
cr.TopLeft = cr.BottomLeft; cr.TopLeft = cr.BottomLeft;
cr.TopRight = cr.BottomLeft; cr.TopRight = cr.BottomLeft;
}
pIBorder->lpVtbl->put_CornerRadius(pIBorder, cr); pIBorder->lpVtbl->put_CornerRadius(pIBorder, cr);
pIBorder->lpVtbl->Release(pIBorder); pIBorder->lpVtbl->Release(pIBorder);
} }
@ -409,7 +437,7 @@ void LVT_StartUI_EnableRoundedCorners(HWND hWnd, BOOL bApply)
if (pIGrid2) if (pIGrid2)
{ {
Windows_UI_Xaml_CornerRadius cr; Windows_UI_Xaml_CornerRadius cr;
cr.BottomLeft = (bApply ? 5.0 : 0.0); cr.BottomLeft = (dwReceipe ? 5.0 : 0.0);
cr.BottomRight = cr.BottomLeft; cr.BottomRight = cr.BottomLeft;
cr.TopLeft = cr.BottomLeft; cr.TopLeft = cr.BottomLeft;
cr.TopRight = cr.BottomLeft; cr.TopRight = cr.BottomLeft;

View File

@ -1022,7 +1022,7 @@ Windows_UI_Xaml_IDependencyObject* LVT_FindChildByClassName(Windows_UI_Xaml_IDep
Windows_UI_Xaml_IDependencyObject* LVT_FindChildByName(Windows_UI_Xaml_IDependencyObject* pRootDependencyObject, Windows_UI_Xaml_IVisualTreeHelperStatics* pVisualTreeHelperStatics, LPCWSTR pwszRefName); Windows_UI_Xaml_IDependencyObject* LVT_FindChildByName(Windows_UI_Xaml_IDependencyObject* pRootDependencyObject, Windows_UI_Xaml_IVisualTreeHelperStatics* pVisualTreeHelperStatics, LPCWSTR pwszRefName);
void LVT_StartUI_EnableRoundedCorners(HWND, BOOL); void LVT_StartUI_EnableRoundedCorners(HWND, DWORD);
void LVT_StartDocked_DisableRecommendedSection(HWND, BOOL); void LVT_StartDocked_DisableRecommendedSection(HWND, BOOL);

View File

@ -228,10 +228,13 @@
"TaskbarAl"=dword:00000001 "TaskbarAl"=dword:00000001
;t The following settings only apply to the Windows 10 Start menu: ;t The following settings only apply to the Windows 10 Start menu:
[HKEY_CURRENT_USER\Software\ExplorerPatcher] [HKEY_CURRENT_USER\Software\ExplorerPatcher]
;b Enable rounded corners
;"Virtualized_{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}_StartUI_EnableRoundedCorners"=dword:00000000
;b Show more tiles ;b Show more tiles
;"Virtualized_{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}_StartUI_ShowMoreTiles"=dword:00000000 ;"Virtualized_{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}_StartUI_ShowMoreTiles"=dword:00000000
;c 3 Corner preference
;x 1 Rounded corners, floating menu
;x 2 Rounded corners, docked menu
;x 0 Not rounded
;"Virtualized_{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}_StartUI_EnableRoundedCorners"=dword:00000000
[HKEY_CURRENT_USER\Software\ExplorerPatcher] [HKEY_CURRENT_USER\Software\ExplorerPatcher]
;c 3 Display mode ;c 3 Display mode
;x 0 Default ;x 0 Default