mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-06-14 03:16:38 +10:00
Added option to hide "see more results" in search
Hides the item in both start menu styles and adjusts search height to ensure the empty space is used. Partially fixes #660, but currently does not honor group policy settings.
This commit is contained in:
committed by
Ibuprophen
parent
5399e3ad8c
commit
be8568ce00
@@ -335,6 +335,7 @@ bool CMenuContainer::s_bDragMovable;
|
||||
bool CMenuContainer::s_bRightDrag;
|
||||
bool CMenuContainer::s_bLockWorkArea;
|
||||
bool CMenuContainer::s_bPendingSearchEnter;
|
||||
bool CMenuContainer::s_bMoreResults;
|
||||
std::vector<CMenuContainer*> CMenuContainer::s_Menus;
|
||||
volatile HWND CMenuContainer::s_FirstMenu, CMenuContainer::s_SearchMenu;
|
||||
CSearchManager::SearchResults CMenuContainer::s_SearchResults;
|
||||
@@ -2745,9 +2746,9 @@ bool CMenuContainer::InitSearchItems( void )
|
||||
{
|
||||
sepHeight=s_Skin.ItemSettings[s_Skin.More_bitmap_Size.cx?MenuSkin::LIST_SEPARATOR_SPLIT:MenuSkin::LIST_SEPARATOR].itemHeight;
|
||||
itemHeight=s_Skin.ItemSettings[MenuSkin::LIST_ITEM].itemHeight;
|
||||
// total height minus the search box and the "more results"/"search internet"
|
||||
// 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-=itemHeight*(m_SearchItemCount-1);
|
||||
maxHeight-=itemHeight*(m_SearchItemCount-(s_bMoreResults?1:2));
|
||||
if (!s_SearchResults.bSearching && !HasMoreResults())
|
||||
maxHeight+=itemHeight;
|
||||
}
|
||||
@@ -2941,25 +2942,28 @@ bool CMenuContainer::InitSearchItems( void )
|
||||
if (s_bWin7Style)
|
||||
{
|
||||
UpdateAccelerators(m_OriginalCount,(int)m_Items.size());
|
||||
MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1];
|
||||
if (s_SearchResults.bSearching)
|
||||
if (s_bMoreResults)
|
||||
{
|
||||
item.id=MENU_SEARCH_EMPTY;
|
||||
item.name=FindTranslation(L"Menu.Searching",L"Searching...");
|
||||
item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,8",CItemManager::ICON_SIZE_TYPE_SMALL);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.id=MENU_MORE_RESULTS;
|
||||
item.name=FindTranslation(L"Menu.MoreResults",L"See more results");
|
||||
item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,177",CItemManager::ICON_SIZE_TYPE_SMALL);
|
||||
MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1];
|
||||
if (s_SearchResults.bSearching)
|
||||
{
|
||||
item.id=MENU_SEARCH_EMPTY;
|
||||
item.name=FindTranslation(L"Menu.Searching",L"Searching...");
|
||||
item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,8",CItemManager::ICON_SIZE_TYPE_SMALL);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.id=MENU_MORE_RESULTS;
|
||||
item.name=FindTranslation(L"Menu.MoreResults",L"See more results");
|
||||
item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,177",CItemManager::ICON_SIZE_TYPE_SMALL);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ScrollCount=(int)m_Items.size();
|
||||
bool bInternet=GetSettingBool(L"SearchInternet");
|
||||
if (s_SearchResults.bSearching)
|
||||
bool bInternet=GetSettingBool(L"SearchInternet");
|
||||
if (s_bMoreResults && s_SearchResults.bSearching)
|
||||
{
|
||||
MenuItem item(MENU_SEARCH_EMPTY);
|
||||
item.name=FindTranslation(L"Menu.Searching",L"Searching...");
|
||||
@@ -2974,7 +2978,7 @@ bool CMenuContainer::InitSearchItems( void )
|
||||
item.name=FindTranslation(L"Menu.NoMatch",L"No items match your search.");
|
||||
m_Items.push_back(item);
|
||||
}
|
||||
if (HasMoreResults())
|
||||
if (s_bMoreResults && HasMoreResults())
|
||||
{
|
||||
{
|
||||
MenuItem item(MENU_SEPARATOR);
|
||||
@@ -5062,7 +5066,7 @@ void CMenuContainer::UpdateSearchResults( bool bForceShowAll )
|
||||
g_SearchManager.BeginSearch(s_SearchResults.currentString);
|
||||
s_SearchResults.bSearching=true;
|
||||
s_bPendingSearchEnter=false;
|
||||
if (s_bWin7Style)
|
||||
if (s_bWin7Style && s_bMoreResults)
|
||||
{
|
||||
MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1];
|
||||
item.id=MENU_SEARCH_EMPTY;
|
||||
@@ -7694,6 +7698,7 @@ HWND CMenuContainer::ToggleStartMenu( int taskbarId, bool bKeyboard, bool bAllPr
|
||||
s_bDisableHover=false;
|
||||
s_bDragClosed=false;
|
||||
s_bPendingSearchEnter=false;
|
||||
s_bMoreResults=GetSettingBool(L"MoreResults");
|
||||
InitTouchHelper();
|
||||
|
||||
bool bRemote=GetSystemMetrics(SM_REMOTESESSION)!=0;
|
||||
|
||||
Reference in New Issue
Block a user