Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Src/StartMenu/StartMenuDLL/SettingsUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4456,6 +4456,7 @@ CSetting g_Settings[]={
{L"CustomButton",CSetting::TYPE_RADIO,IDS_CUSTOM_BUTTON,IDS_CUSTOM_BUTTON_TIP},
{L"StartButtonPath",CSetting::TYPE_BITMAP,IDS_BUTTON_IMAGE,IDS_BUTTON_IMAGE_TIP,L"",0,L"#StartButtonType=2",L"CustomButton"},
{L"StartButtonSize",CSetting::TYPE_INT,IDS_BUTTON_SIZE,IDS_BUTTON_SIZE_TIP2,0,0,L"#StartButtonType=2",L"CustomButton"},
{L"StartButtonOffset",CSetting::TYPE_INT,IDS_BUTTON_OFFSET,IDS_BUTTON_OFFSET_TIP,0,0,L"#StartButtonType=2",L"CustomButton"},
{L"StartButtonAlign",CSetting::TYPE_BOOL,IDS_BUTTON_ALIGN,IDS_BUTTON_ALIGN_TIP,0,0,L"#StartButtonType=2",L"CustomButton"},
{L"StartButtonIcon",CSetting::TYPE_ICON,IDS_BUTTON_ICON,IDS_BUTTON_ICON_TIP,L",1",0,L"#StartButtonType=1",L"ClasicButton"},
{L"StartButtonIconSize",CSetting::TYPE_INT,IDS_BUTTON_ICON_SIZE,IDS_BUTTON_ICON_SIZE_TIP,0,0,L"#StartButtonType=1",L"ClasicButton"},
Expand Down Expand Up @@ -5157,7 +5158,7 @@ void InitSettings( void )
InitSettings(g_Settings,COMPONENT_MENU,&g_CustomSettings);
}

static int g_ButtonPath, g_ButtonSize, g_ButtonIcon, g_ButtonIconSize, g_ButtonText, g_ButtonTip;
static int g_ButtonPath, g_ButtonSize, g_ButtonIcon, g_ButtonOffset, g_ButtonIconSize, g_ButtonText, g_ButtonTip;
static bool g_bButtonEnable, g_bTaskbarsChanged, g_bTaskbarsUpdated;

static void StoreButtonSettings( void )
Expand All @@ -5175,6 +5176,7 @@ static void StoreButtonSettings( void )
if (g_ButtonPath==START_BUTTON_CUSTOM)
g_ButtonPath=CalcFNVHash(GetSettingString(L"StartButtonPath"));
g_ButtonSize=GetSettingInt(L"StartButtonSize");
g_ButtonOffset = GetSettingInt(L"StartButtonOffset");
g_ButtonIconSize=GetSettingInt(L"StartButtonIconSize");
}

Expand All @@ -5191,7 +5193,7 @@ static void UpdateButtons( bool bForce )
}
if (path==START_BUTTON_CUSTOM)
path=CalcFNVHash(GetSettingString(L"StartButtonPath"));
bool bRecreate=(g_bButtonEnable!=GetSettingBool(L"EnableStartButton") || path!=g_ButtonPath || g_ButtonSize!=GetSettingInt(L"StartButtonSize")
bool bRecreate = (g_bButtonEnable != GetSettingBool(L"EnableStartButton") || path != g_ButtonPath || g_ButtonSize != GetSettingInt(L"StartButtonSize") || g_ButtonOffset != GetSettingInt(L"StartButtonOffset")
|| g_ButtonIcon!=icon || g_ButtonIconSize!=GetSettingInt(L"StartButtonIconSize") || g_ButtonText!=text || g_ButtonTip!=tip);
if ((g_bTaskbarsChanged && !g_bTaskbarsUpdated) || bForce || bRecreate)
{
Expand Down
17 changes: 11 additions & 6 deletions Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@ class CStartMenuTarget: public IDropTarget
return E_NOINTERFACE;
}

virtual ULONG STDMETHODCALLTYPE AddRef( void )
{
virtual ULONG STDMETHODCALLTYPE AddRef( void )

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove these unintentional whitespace changes? They are not related to changes in this PR.
There are some more below.

{
return InterlockedIncrement(&m_RefCount);
}

Expand Down Expand Up @@ -1345,8 +1345,13 @@ static void UpdateStartButtonPosition(const TaskbarInfo* taskBar, const WINDOWPO

// Start button on Win11 is a bit shifted to the right
// We will shift our Aero button to cover original button
if (IsWin11() && (x == info.rcMonitor.left) && (GetStartButtonType() == START_BUTTON_AERO) && !g_epTaskbar)
x += ScaleForDpi(taskBar->taskBar, 6);
if (IsWin11() && (x == info.rcMonitor.left) && !g_epTaskbar) {
if (GetStartButtonType() == START_BUTTON_AERO)
x += ScaleForDpi(taskBar->taskBar, 6);
// we should also be able to shift our custom icon, as it's also incorrectly aligned to the left edge on Windows 11
else if (GetStartButtonType() == START_BUTTON_CUSTOM)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this code is restricted only for Win11 without ExplorerPatcher.
I guess the offset setting should be more generic.

I'd move this outside of the if section.
By default the offset is 0 so it won't affect anything.
If user changes the setting, it would apply no matter of OS and other things.

x += ScaleForDpi(taskBar->taskBar, GetSettingInt(L"StartButtonOffset"));
}
}

RECT rcButton = { x, y, x + taskBar->startButtonSize.cx, y + taskBar->startButtonSize.cy };
Expand Down Expand Up @@ -2389,7 +2394,7 @@ void UpdateTaskBars( TUpdateTaskbar update )
{
if (bDefColor && GetWinVersion()>WIN_VER_WIN7)
{
if (IsAppThemed())
if (IsAppThemed())
{
color=GetSystemGlassColor8();
color=((color&0xFF)<<16)|(color&0xFF00)|((color>>16)&0xFF);
Expand Down Expand Up @@ -4306,7 +4311,7 @@ HBITMAP GetStartScreenIcon( int size )
}
SelectObject(hDst,bmp0);
DeleteDC(hDst);

int i=0;
int n=size*rc.top;
for (;i<n;i++)
Expand Down
2 changes: 2 additions & 0 deletions Src/StartMenu/StartMenuDLL/StartMenuDLL.rc
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,8 @@ BEGIN
IDS_MENU_GLASS "Enable Aero Glass (requires Aero Glass mod)"
IDS_MENU_GLASS_TIP "Check this to use glass transparency (requires the Aero Glass mod to be installed)"
IDS_MAIN_MENU_SETTINGS "Main Menu"
IDS_BUTTON_OFFSET "Button left offset"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd name it just Button offset.
The tooltip explains what kind of offset it means.

IDS_BUTTON_OFFSET_TIP "Offset the start button horizontally by the amount of pixels specified"
END

STRINGTABLE
Expand Down
2 changes: 2 additions & 0 deletions Src/StartMenu/StartMenuDLL/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,8 @@
#define IDS_ENABLE_ACCELERATORS_TIP 3687
#define IDS_ALT_ACCELERATORS 3688
#define IDS_ALT_ACCELERATORS_TIP 3689
#define IDS_BUTTON_OFFSET 3690
#define IDS_BUTTON_OFFSET_TIP 3691
#define IDS_STRING7001 7001
#define IDS_STRING7002 7002
#define IDS_STRING7003 7003
Expand Down