Skip to content

Commit c517e21

Browse files
committed
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.
1 parent 8f1a696 commit c517e21

File tree

2 files changed

+16
-22
lines changed

2 files changed

+16
-22
lines changed

Src/StartMenu/StartMenuDLL/MenuContainer.cpp

+16-21
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ bool CMenuContainer::s_bDragMovable;
335335
bool CMenuContainer::s_bRightDrag;
336336
bool CMenuContainer::s_bLockWorkArea;
337337
bool CMenuContainer::s_bPendingSearchEnter;
338-
bool CMenuContainer::s_bMoreResults;
339338
std::vector<CMenuContainer*> CMenuContainer::s_Menus;
340339
volatile HWND CMenuContainer::s_FirstMenu, CMenuContainer::s_SearchMenu;
341340
CSearchManager::SearchResults CMenuContainer::s_SearchResults;
@@ -2770,7 +2769,7 @@ bool CMenuContainer::InitSearchItems( void )
27702769
// total height minus the search box and the "more results"/"search internet", if present
27712770
maxHeight=m_Items[m_SearchIndex].itemRect.top-s_Skin.Main_search_padding.top-s_Skin.Search_padding.top;
27722771
maxHeight-=itemHeight*(m_SearchItemCount-1);
2773-
if (!s_bMoreResults || (!s_SearchResults.bSearching && !HasMoreResults()))
2772+
if (!s_SearchResults.bSearching && !HasMoreResults())
27742773
maxHeight+=itemHeight;
27752774
}
27762775
if (bAutoComlpete)
@@ -2963,28 +2962,25 @@ bool CMenuContainer::InitSearchItems( void )
29632962
if (s_bWin7Style)
29642963
{
29652964
UpdateAccelerators(m_OriginalCount,(int)m_Items.size());
2966-
if (s_bMoreResults)
2965+
MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1];
2966+
if (s_SearchResults.bSearching)
29672967
{
2968-
MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1];
2969-
if (s_SearchResults.bSearching)
2970-
{
2971-
item.id=MENU_SEARCH_EMPTY;
2972-
item.name=FindTranslation(L"Menu.Searching",L"Searching...");
2973-
item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,8",CItemManager::ICON_SIZE_TYPE_SMALL);
2974-
}
2975-
else
2976-
{
2977-
item.id=MENU_MORE_RESULTS;
2978-
item.name=FindTranslation(L"Menu.MoreResults",L"See more results");
2979-
item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,177",CItemManager::ICON_SIZE_TYPE_SMALL);
2980-
}
2968+
item.id=MENU_SEARCH_EMPTY;
2969+
item.name=FindTranslation(L"Menu.Searching",L"Searching...");
2970+
item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,8",CItemManager::ICON_SIZE_TYPE_SMALL);
2971+
}
2972+
else
2973+
{
2974+
item.id=MENU_MORE_RESULTS;
2975+
item.name=FindTranslation(L"Menu.MoreResults",L"See more results");
2976+
item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,177",CItemManager::ICON_SIZE_TYPE_SMALL);
29812977
}
29822978
}
29832979
else
29842980
{
29852981
m_ScrollCount=(int)m_Items.size();
29862982
bool bInternet=GetSettingBool(L"SearchInternet");
2987-
if (s_bMoreResults && s_SearchResults.bSearching)
2983+
if (s_SearchResults.bSearching)
29882984
{
29892985
MenuItem item(MENU_SEARCH_EMPTY);
29902986
item.name=FindTranslation(L"Menu.Searching",L"Searching...");
@@ -2999,7 +2995,7 @@ bool CMenuContainer::InitSearchItems( void )
29992995
item.name=FindTranslation(L"Menu.NoMatch",L"No items match your search.");
30002996
m_Items.push_back(item);
30012997
}
3002-
if (s_bMoreResults && HasMoreResults())
2998+
if (HasMoreResults())
30032999
{
30043000
{
30053001
MenuItem item(MENU_SEPARATOR);
@@ -5087,7 +5083,7 @@ void CMenuContainer::UpdateSearchResults( bool bForceShowAll )
50875083
g_SearchManager.BeginSearch(s_SearchResults.currentString);
50885084
s_SearchResults.bSearching=true;
50895085
s_bPendingSearchEnter=false;
5090-
if (s_bWin7Style && s_bMoreResults)
5086+
if (s_bWin7Style)
50915087
{
50925088
MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1];
50935089
item.id=MENU_SEARCH_EMPTY;
@@ -7437,7 +7433,7 @@ static void CreateStartScreenFile( const wchar_t *fname )
74377433
bool CMenuContainer::HasMoreResults( void )
74387434
{
74397435
if (s_HasMoreResults==-1)
7440-
s_HasMoreResults=(GetSettingBool(L"SearchFiles") && HasSearchService())?1:0;
7436+
s_HasMoreResults=(GetSettingBool(L"MoreResults") && GetSettingBool(L"SearchFiles") && HasSearchService())?1:0;
74417437
return s_HasMoreResults!=0;
74427438
}
74437439

@@ -7713,7 +7709,6 @@ HWND CMenuContainer::ToggleStartMenu( int taskbarId, bool bKeyboard, bool bAllPr
77137709
s_bDisableHover=false;
77147710
s_bDragClosed=false;
77157711
s_bPendingSearchEnter=false;
7716-
s_bMoreResults=GetSettingBool(L"MoreResults");
77177712
InitTouchHelper();
77187713

77197714
bool bRemote=GetSystemMetrics(SM_REMOTESESSION)!=0;

Src/StartMenu/StartMenuDLL/MenuContainer.h

-1
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,6 @@ class CMenuContainer: public IDropTarget, public IFrameworkInputPaneHandler, pub
896896
static bool s_bRightDrag; // dragging with the right mouse button
897897
static bool s_bLockWorkArea; // changes to the work area are ignored
898898
static bool s_bPendingSearchEnter; // Enter was pressed before the search results were ready
899-
static bool s_bMoreResults; // shows the "Show More Results" item at the bottom of searches
900899
static RECT s_MenuLimits; // area of the main monitor accessible to all menus
901900
static RECT s_MainMenuLimits; // area of the main monitor accessible by the main menu
902901
static DWORD s_TaskbarState; // the state of the taskbar (ABS_AUTOHIDE and ABS_ALWAYSONTOP)

0 commit comments

Comments
 (0)