9 Commits

Author SHA1 Message Date
ge0rdi
c517e21465 Display "Searching..." progress always
Commit be8568c that introduced option to disable "See more results" also
changed behavior of "Searching..." item that indicates search in progress.

We will now make sure that the search progress indicator is displayed
always. No matter of options.
2023-08-16 15:39:47 +02:00
ge0rdi
8f1a696e94 Fix search results overlapping (#1648)
Changes in be8568 commit caused that under certain circumstances search
results may overlap "Search the Internet" item.
2023-08-16 15:39:47 +02:00
ge0rdi
4047d726ac Fix checkboxes in settings dialog with custom themes (#1630) 2023-08-16 15:39:47 +02:00
ge0rdi
4b26b4d9e6 Allow negative horizontal/vertical menu offsets (#1629)
Menu offsets were previously applied to s_MainMenuLimits.
Though when deciding where to put start menu (CalculateCorner) we are
now taking into account also position of start button (as since Win11 it
may not be in corner of the screen).

This broke negative menu offsets.

We will fix it by applying menu offsets in CalculateCorner as a last
step once we have determined start menu position.
This should make even more sense than previous approach.
2023-08-16 15:39:47 +02:00
ge0rdi
2f251c4f63 Separate taskbar icon for Open-Shell menu settings dialog
It will be now separate from Explorer's icons in taskbar.
Open-Shell icon will be displayed for better clarity.

https://github.com/Open-Shell/Open-Shell-Menu/issues/31#issuecomment-1656611895
2023-08-16 15:39:47 +02:00
RaNo99
d2985bab88 Update README.md
Works well on windows 11 already.
2023-07-31 18:02:32 +02:00
ge0rdi
f897241a08 Use nlohmann.json NuGet package instead of direct file
This way it will be easier to update to new version (when released).
And it will be also clear that we have dependency on this 3rd party
library.
2023-07-26 12:05:44 +02:00
ge0rdi
8f26cae3f0 Update bug_report.yml 2023-07-26 09:18:10 +02:00
ge0rdi
bbe2aa5d2f Setup: Change symbols package name to OpenShellSymbols_*
This way it will be nicely sorted after main OpenShellSetup_* package in assets page.
2023-07-24 18:37:35 +02:00
14 changed files with 67 additions and 24665 deletions

View File

@@ -7,7 +7,7 @@ body:
attributes: attributes:
value: | value: |
**Please, make sure you are using [latest](https://github.com/Open-Shell/Open-Shell-Menu/releases) `Open-Shell` build before reporting a bug.** **Please, make sure you are using [latest](https://github.com/Open-Shell/Open-Shell-Menu/releases) `Open-Shell` build before reporting a bug.**
Especially on `Windows 11` as official release (4.4.170) doesn't support it yet. Especially on `Windows 11` you should use 4.4.190 (or newer).
- type: textarea - type: textarea
attributes: attributes:
label: Describe the bug label: Describe the bug

View File

@@ -12,7 +12,7 @@ A collection of utilities bringing back classic features to Windows.
[Open-Shell Homepage](https://open-shell.github.io/Open-Shell-Menu) [Open-Shell Homepage](https://open-shell.github.io/Open-Shell-Menu)
### Features ### Features
- Classic style Start menu for Windows 7, 8, 8.1, 10 - Classic style Start menu for Windows 7, 8, 8.1, 10, and 11
- Toolbar for Windows Explorer - Toolbar for Windows Explorer
- Explorer status bar with file size and disk space - Explorer status bar with file size and disk space
- Classic copy UI (Windows 7 only) - Classic copy UI (Windows 7 only)

View File

@@ -13,7 +13,7 @@
#include "FNVHash.h" #include "FNVHash.h"
#include "StringUtils.h" #include "StringUtils.h"
#include "Translations.h" #include "Translations.h"
#include "json.hpp" #include <nlohmann/json.hpp>
#include <wininet.h> #include <wininet.h>
#include <softpub.h> #include <softpub.h>

View File

@@ -101,7 +101,17 @@
<ClCompile Include="TrackResources.cpp" /> <ClCompile Include="TrackResources.cpp" />
<ClCompile Include="Translations.cpp" /> <ClCompile Include="Translations.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets" Condition="Exists('..\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets')" />
</ImportGroup> </ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets'))" />
</Target>
</Project> </Project>

View File

@@ -149,4 +149,7 @@
<Filter>Lib</Filter> <Filter>Lib</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project> </Project>

View File

@@ -13,6 +13,7 @@
#include <Uxtheme.h> #include <Uxtheme.h>
#include <VSStyle.h> #include <VSStyle.h>
#include <propkey.h> #include <propkey.h>
#include <propvarutil.h>
#include <htmlhelp.h> #include <htmlhelp.h>
#include <vector> #include <vector>
#include <map> #include <map>
@@ -978,7 +979,7 @@ void CSettingsManager::ResetSettings( void )
HIMAGELIST CSettingsManager::GetImageList( HWND tree ) HIMAGELIST CSettingsManager::GetImageList( HWND tree )
{ {
if (m_ImageList) return m_ImageList; if (m_ImageList) return m_ImageList;
HTHEME theme=OpenThemeData(tree,L"button"); HTHEME theme=OpenThemeData(GetParent(tree),L"button");
HDC hdc=CreateCompatibleDC(NULL); HDC hdc=CreateCompatibleDC(NULL);
int iconSize=(TreeView_GetItemHeight(tree)<32)?16:32; int iconSize=(TreeView_GetItemHeight(tree)<32)?16:32;
int checkSize=16; int checkSize=16;
@@ -1108,7 +1109,7 @@ class CSettingsDlg: public CResizeableDlg<CSettingsDlg>
{ {
public: public:
CSettingsDlg( void ); CSettingsDlg( void );
void Init( CSetting *pSettings, ICustomSettings *pCustom, int tab ); void Init( CSetting *pSettings, ICustomSettings *pCustom, int tab, const wchar_t* appId );
BEGIN_MSG_MAP( CSettingsDlg ) BEGIN_MSG_MAP( CSettingsDlg )
MESSAGE_HANDLER( WM_INITDIALOG, OnInitDialog ) MESSAGE_HANDLER( WM_INITDIALOG, OnInitDialog )
@@ -1182,6 +1183,7 @@ private:
bool m_bIgnoreEdit; bool m_bIgnoreEdit;
bool m_bDirty; bool m_bDirty;
CString m_FilterText; CString m_FilterText;
const wchar_t* m_AppId;
void AddTabs( int name, const CSetting *pSelect=NULL ); void AddTabs( int name, const CSetting *pSelect=NULL );
void SetCurTab( int index, bool bReset, const CSetting *pSelect=NULL ); void SetCurTab( int index, bool bReset, const CSetting *pSelect=NULL );
@@ -1214,15 +1216,17 @@ CSettingsDlg::CSettingsDlg( void )
m_bOnTop=false; m_bOnTop=false;
m_bIgnoreEdit=false; m_bIgnoreEdit=false;
m_bDirty=false; m_bDirty=false;
m_AppId=NULL;
} }
void CSettingsDlg::Init( CSetting *pSettings, ICustomSettings *pCustom, int tab ) void CSettingsDlg::Init( CSetting *pSettings, ICustomSettings *pCustom, int tab, const wchar_t* appId )
{ {
m_pSettings=pSettings; m_pSettings=pSettings;
m_pCustom=pCustom; m_pCustom=pCustom;
m_InitialTab=tab; m_InitialTab=tab;
m_FilterText.Empty(); m_FilterText.Empty();
m_bDirty=false; m_bDirty=false;
m_AppId=appId;
} }
// Subclass the tooltip to delay the tip when the mouse moves from one tree item to the next // Subclass the tooltip to delay the tip when the mouse moves from one tree item to the next
@@ -1246,17 +1250,19 @@ LRESULT CSettingsDlg::OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOO
#ifdef _DEBUG #ifdef _DEBUG
g_bUIThread=true; g_bUIThread=true;
#endif #endif
/*
// attempt to make the dialog have its own icon. doesn't work though. the icon changes, but to the default folder icon if (m_AppId)
{
// attempt to make the dialog have its own icon
CComPtr<IPropertyStore> pStore; CComPtr<IPropertyStore> pStore;
if (SUCCEEDED(SHGetPropertyStoreForWindow(m_hWnd,IID_IPropertyStore,(void**)&pStore))) if (SUCCEEDED(SHGetPropertyStoreForWindow(m_hWnd,IID_IPropertyStore,(void**)&pStore)))
{ {
PROPVARIANT val; PROPVARIANT val;
val.vt=VT_LPWSTR; InitPropVariantFromString(m_AppId,&val);
val.pwszVal=L"OpenShell.Settings.Dialog";
pStore->SetValue(PKEY_AppUserModel_ID,val); pStore->SetValue(PKEY_AppUserModel_ID,val);
} }
*/ }
InitResize(MOVE_MODAL); InitResize(MOVE_MODAL);
HMENU menu=GetSystemMenu(FALSE); HMENU menu=GetSystemMenu(FALSE);
bool bAdded=false; bool bAdded=false;
@@ -1840,7 +1846,7 @@ bool CSettingsDlg::IsTabValid( void )
static CSettingsDlg g_SettingsDlg; static CSettingsDlg g_SettingsDlg;
void EditSettings( const wchar_t *title, bool bModal, int tab ) void EditSettings( const wchar_t *title, bool bModal, int tab, const wchar_t* appId )
{ {
if (g_SettingsDlg.m_hWnd) if (g_SettingsDlg.m_hWnd)
{ {
@@ -1858,7 +1864,7 @@ void EditSettings( const wchar_t *title, bool bModal, int tab )
} }
DLGTEMPLATE *pTemplate=LoadDialogEx(IDD_SETTINGS); DLGTEMPLATE *pTemplate=LoadDialogEx(IDD_SETTINGS);
g_SettingsManager.ResetImageList(); g_SettingsManager.ResetImageList();
g_SettingsDlg.Init(g_SettingsManager.GetSettings(),g_SettingsManager.GetCustom(),tab); g_SettingsDlg.Init(g_SettingsManager.GetSettings(),g_SettingsManager.GetCustom(),tab,appId);
g_SettingsDlg.Create(NULL,pTemplate); g_SettingsDlg.Create(NULL,pTemplate);
g_SettingsDlg.SetWindowText(title); g_SettingsDlg.SetWindowText(title);
g_SettingsDlg.SetWindowPos(HWND_TOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|(g_SettingsDlg.GetOnTop()?0:SWP_NOZORDER)|SWP_SHOWWINDOW); g_SettingsDlg.SetWindowPos(HWND_TOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|(g_SettingsDlg.GetOnTop()?0:SWP_NOZORDER)|SWP_SHOWWINDOW);

View File

@@ -129,7 +129,7 @@ void InitSettings( CSetting *pSettings, TSettingsComponent component, ICustomSet
void LoadSettings( void ); void LoadSettings( void );
void SaveSettings( void ); void SaveSettings( void );
void UpdateDefaultSettings( void ); void UpdateDefaultSettings( void );
void EditSettings( const wchar_t *title, bool bModal, int tab ); void EditSettings( const wchar_t *title, bool bModal, int tab, const wchar_t *appId = nullptr );
void CloseSettings( void ); void CloseSettings( void );
void SetSettingsDirty( void ); void SetSettingsDirty( void );
void SelectSettingsTab( int tab, bool bAdvanced, const CSetting *pSelect ); void SelectSettingsTab( int tab, bool bAdvanced, const CSetting *pSelect );

File diff suppressed because it is too large Load Diff

4
Src/Lib/packages.config Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="nlohmann.json" version="3.11.2" targetFramework="native" />
</packages>

View File

@@ -1,7 +1,7 @@
REM ***** Collect PDBs REM ***** Collect PDBs
echo -- Creating symbols package echo -- Creating symbols package
set CS_SYMBOLS_NAME=OpenShellPDB_%CS_VERSION_STR%.7z set CS_SYMBOLS_NAME=OpenShellSymbols_%CS_VERSION_STR%.7z
7z a -mx9 .\Final\%CS_SYMBOLS_NAME% .\Output\symbols\* > nul 7z a -mx9 .\Final\%CS_SYMBOLS_NAME% .\Output\symbols\* > nul

View File

@@ -6,6 +6,9 @@ echo -- Compiling
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do set MSBuildDir=%%i\MSBuild\Current\Bin\ for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do set MSBuildDir=%%i\MSBuild\Current\Bin\
REM Restore NuGet packages
"%MSBuildDir%MSBuild.exe" ..\OpenShell.sln /m /t:Restore -p:RestorePackagesConfig=true /verbosity:quiet /nologo
REM ********* Build 64-bit solution REM ********* Build 64-bit solution
echo --- 64bit echo --- 64bit
"%MSBuildDir%MSBuild.exe" ..\OpenShell.sln /m /t:Rebuild /p:Configuration="Setup" /p:Platform="x64" /verbosity:quiet /nologo "%MSBuildDir%MSBuild.exe" ..\OpenShell.sln /m /t:Rebuild /p:Configuration="Setup" /p:Platform="x64" /verbosity:quiet /nologo

View File

@@ -335,7 +335,6 @@ bool CMenuContainer::s_bDragMovable;
bool CMenuContainer::s_bRightDrag; bool CMenuContainer::s_bRightDrag;
bool CMenuContainer::s_bLockWorkArea; bool CMenuContainer::s_bLockWorkArea;
bool CMenuContainer::s_bPendingSearchEnter; bool CMenuContainer::s_bPendingSearchEnter;
bool CMenuContainer::s_bMoreResults;
std::vector<CMenuContainer*> CMenuContainer::s_Menus; std::vector<CMenuContainer*> CMenuContainer::s_Menus;
volatile HWND CMenuContainer::s_FirstMenu, CMenuContainer::s_SearchMenu; volatile HWND CMenuContainer::s_FirstMenu, CMenuContainer::s_SearchMenu;
CSearchManager::SearchResults CMenuContainer::s_SearchResults; CSearchManager::SearchResults CMenuContainer::s_SearchResults;
@@ -2769,7 +2768,7 @@ bool CMenuContainer::InitSearchItems( void )
itemHeight=s_Skin.ItemSettings[MenuSkin::LIST_ITEM].itemHeight; itemHeight=s_Skin.ItemSettings[MenuSkin::LIST_ITEM].itemHeight;
// total height minus the search box and the "more results"/"search internet", if present // total height minus the search box and the "more results"/"search internet", if present
maxHeight=m_Items[m_SearchIndex].itemRect.top-s_Skin.Main_search_padding.top-s_Skin.Search_padding.top; maxHeight=m_Items[m_SearchIndex].itemRect.top-s_Skin.Main_search_padding.top-s_Skin.Search_padding.top;
maxHeight-=itemHeight*(m_SearchItemCount-(s_bMoreResults?1:2)); maxHeight-=itemHeight*(m_SearchItemCount-1);
if (!s_SearchResults.bSearching && !HasMoreResults()) if (!s_SearchResults.bSearching && !HasMoreResults())
maxHeight+=itemHeight; maxHeight+=itemHeight;
} }
@@ -2963,8 +2962,6 @@ bool CMenuContainer::InitSearchItems( void )
if (s_bWin7Style) if (s_bWin7Style)
{ {
UpdateAccelerators(m_OriginalCount,(int)m_Items.size()); UpdateAccelerators(m_OriginalCount,(int)m_Items.size());
if (s_bMoreResults)
{
MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1]; MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1];
if (s_SearchResults.bSearching) if (s_SearchResults.bSearching)
{ {
@@ -2979,12 +2976,11 @@ bool CMenuContainer::InitSearchItems( void )
item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,177",CItemManager::ICON_SIZE_TYPE_SMALL); item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,177",CItemManager::ICON_SIZE_TYPE_SMALL);
} }
} }
}
else else
{ {
m_ScrollCount=(int)m_Items.size(); m_ScrollCount=(int)m_Items.size();
bool bInternet=GetSettingBool(L"SearchInternet"); bool bInternet=GetSettingBool(L"SearchInternet");
if (s_bMoreResults && s_SearchResults.bSearching) if (s_SearchResults.bSearching)
{ {
MenuItem item(MENU_SEARCH_EMPTY); MenuItem item(MENU_SEARCH_EMPTY);
item.name=FindTranslation(L"Menu.Searching",L"Searching..."); item.name=FindTranslation(L"Menu.Searching",L"Searching...");
@@ -2999,7 +2995,7 @@ bool CMenuContainer::InitSearchItems( void )
item.name=FindTranslation(L"Menu.NoMatch",L"No items match your search."); item.name=FindTranslation(L"Menu.NoMatch",L"No items match your search.");
m_Items.push_back(item); m_Items.push_back(item);
} }
if (s_bMoreResults && HasMoreResults()) if (HasMoreResults())
{ {
{ {
MenuItem item(MENU_SEPARATOR); MenuItem item(MENU_SEPARATOR);
@@ -5087,7 +5083,7 @@ void CMenuContainer::UpdateSearchResults( bool bForceShowAll )
g_SearchManager.BeginSearch(s_SearchResults.currentString); g_SearchManager.BeginSearch(s_SearchResults.currentString);
s_SearchResults.bSearching=true; s_SearchResults.bSearching=true;
s_bPendingSearchEnter=false; s_bPendingSearchEnter=false;
if (s_bWin7Style && s_bMoreResults) if (s_bWin7Style)
{ {
MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1]; MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1];
item.id=MENU_SEARCH_EMPTY; item.id=MENU_SEARCH_EMPTY;
@@ -7437,7 +7433,7 @@ static void CreateStartScreenFile( const wchar_t *fname )
bool CMenuContainer::HasMoreResults( void ) bool CMenuContainer::HasMoreResults( void )
{ {
if (s_HasMoreResults==-1) if (s_HasMoreResults==-1)
s_HasMoreResults=(GetSettingBool(L"SearchFiles") && HasSearchService())?1:0; s_HasMoreResults=(GetSettingBool(L"MoreResults") && GetSettingBool(L"SearchFiles") && HasSearchService())?1:0;
return s_HasMoreResults!=0; return s_HasMoreResults!=0;
} }
@@ -7509,31 +7505,6 @@ RECT CMenuContainer::CalculateWorkArea( const RECT &taskbarRect )
} }
} }
//calculate offsets
int xOff = GetSettingInt(L"HorizontalMenuOffset");
int yOff = GetSettingInt(L"VerticalMenuOffset");
if (s_TaskBarEdge == ABE_BOTTOM)
{
if (xOff != 0)
rc.left += xOff;
if (yOff != 0)
rc.bottom += yOff;
}
else if (s_TaskBarEdge == ABE_TOP || s_TaskBarEdge == ABE_LEFT)
{
if (xOff != 0)
rc.left += xOff;
if (yOff != 0)
rc.top += yOff;
}
else
{
if (xOff != 0)
rc.right += xOff;
if (yOff != 0)
rc.top += yOff;
}
return rc; return rc;
} }
@@ -7560,6 +7531,9 @@ POINT CMenuContainer::CalculateCorner( void )
else else
corner.y=s_MainMenuLimits.bottom+margin.bottom; corner.y=s_MainMenuLimits.bottom+margin.bottom;
corner.x+=GetSettingInt(L"HorizontalMenuOffset");
corner.y+=GetSettingInt(L"VerticalMenuOffset");
return corner; return corner;
} }
@@ -7735,7 +7709,6 @@ HWND CMenuContainer::ToggleStartMenu( int taskbarId, bool bKeyboard, bool bAllPr
s_bDisableHover=false; s_bDisableHover=false;
s_bDragClosed=false; s_bDragClosed=false;
s_bPendingSearchEnter=false; s_bPendingSearchEnter=false;
s_bMoreResults=GetSettingBool(L"MoreResults");
InitTouchHelper(); InitTouchHelper();
bool bRemote=GetSystemMetrics(SM_REMOTESESSION)!=0; bool bRemote=GetSystemMetrics(SM_REMOTESESSION)!=0;

View File

@@ -896,7 +896,6 @@ private:
static bool s_bRightDrag; // dragging with the right mouse button static bool s_bRightDrag; // dragging with the right mouse button
static bool s_bLockWorkArea; // changes to the work area are ignored static bool s_bLockWorkArea; // changes to the work area are ignored
static bool s_bPendingSearchEnter; // Enter was pressed before the search results were ready static bool s_bPendingSearchEnter; // Enter was pressed before the search results were ready
static bool s_bMoreResults; // shows the "Show More Results" item at the bottom of searches
static RECT s_MenuLimits; // area of the main monitor accessible to all menus static RECT s_MenuLimits; // area of the main monitor accessible to all menus
static RECT s_MainMenuLimits; // area of the main monitor accessible by the main menu static RECT s_MainMenuLimits; // area of the main monitor accessible by the main menu
static DWORD s_TaskbarState; // the state of the taskbar (ABS_AUTOHIDE and ABS_ALWAYSONTOP) static DWORD s_TaskbarState; // the state of the taskbar (ABS_AUTOHIDE and ABS_ALWAYSONTOP)

View File

@@ -5272,7 +5272,7 @@ void EditSettings( bool bModal, int tab )
Sprintf(title,_countof(title),LoadStringEx(IDS_SETTINGS_TITLE_VER),ver>>24,(ver>>16)&0xFF,ver&0xFFFF); Sprintf(title,_countof(title),LoadStringEx(IDS_SETTINGS_TITLE_VER),ver>>24,(ver>>16)&0xFF,ver&0xFFFF);
else else
Sprintf(title,_countof(title),LoadStringEx(IDS_SETTINGS_TITLE)); Sprintf(title,_countof(title),LoadStringEx(IDS_SETTINGS_TITLE));
EditSettings(title,bModal,tab); EditSettings(title,bModal,tab,L"OpenShell.StartMenu.Settings");
} }
bool DllImportSettingsXml( const wchar_t *fname ) bool DllImportSettingsXml( const wchar_t *fname )