mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-06-14 03:16:38 +10:00
Added option to use a custom search hint
If set, intercepts the search hint's DrawText function and swaps out the default text for user-defined text. Leaving the text blank results in an empty search box.
This commit is contained in:
committed by
Ibuprophen
parent
68379f4098
commit
5399e3ad8c
@@ -444,7 +444,10 @@ LRESULT CALLBACK CMenuContainer::SubclassSearchBox( HWND hWnd, UINT uMsg, WPARAM
|
|||||||
SetBkColor(hdc,GetSysColor(COLOR_WINDOW));
|
SetBkColor(hdc,GetSysColor(COLOR_WINDOW));
|
||||||
SetBkMode(hdc,TRANSPARENT);
|
SetBkMode(hdc,TRANSPARENT);
|
||||||
SetTextColor(hdc,s_Skin.Search_text_colors[1]);
|
SetTextColor(hdc,s_Skin.Search_text_colors[1]);
|
||||||
DrawText(hdc,pParent->m_Items[pParent->m_SearchIndex].name,-1,&rc,DT_SINGLELINE|DT_EDITCONTROL|(s_bRTL?DT_RIGHT:DT_LEFT));
|
if (GetSettingBool(L"SearchHint"))
|
||||||
|
DrawText(hdc,GetSettingString(L"SearchHintText"),-1,&rc,DT_SINGLELINE|DT_EDITCONTROL|(s_bRTL?DT_RIGHT:DT_LEFT));
|
||||||
|
else
|
||||||
|
DrawText(hdc,pParent->m_Items[pParent->m_SearchIndex].name,-1,&rc,DT_SINGLELINE|DT_EDITCONTROL|(s_bRTL?DT_RIGHT:DT_LEFT));
|
||||||
SelectObject(hdc,font0);
|
SelectObject(hdc,font0);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@@ -4343,6 +4343,8 @@ CSetting g_Settings[]={
|
|||||||
{L"Normal",CSetting::TYPE_RADIO,IDS_SEARCH_BOX_SHOW,IDS_SEARCH_BOX_SHOW_TIP},
|
{L"Normal",CSetting::TYPE_RADIO,IDS_SEARCH_BOX_SHOW,IDS_SEARCH_BOX_SHOW_TIP},
|
||||||
{L"Tab",CSetting::TYPE_RADIO,IDS_SEARCH_BOX_TAB,IDS_SEARCH_BOX_TAB_TIP},
|
{L"Tab",CSetting::TYPE_RADIO,IDS_SEARCH_BOX_TAB,IDS_SEARCH_BOX_TAB_TIP},
|
||||||
{L"SearchSelect",CSetting::TYPE_BOOL,IDS_SEARCH_BOX_SEL,IDS_SEARCH_BOX_SEL_TIP,1,0,L"SearchBox=1",L"Normal"},
|
{L"SearchSelect",CSetting::TYPE_BOOL,IDS_SEARCH_BOX_SEL,IDS_SEARCH_BOX_SEL_TIP,1,0,L"SearchBox=1",L"Normal"},
|
||||||
|
{L"SearchHint",CSetting::TYPE_BOOL,IDS_SEARCH_HINT,IDS_SEARCH_HINT_TIP,0,0,L"SearchBox"},
|
||||||
|
{L"SearchHintText",CSetting::TYPE_STRING,IDS_NEW_SEARCH_HINT,IDS_NEW_SEARCH_HINT_TIP,L"",0,L"#SearchHint",L"SearchHint"},
|
||||||
{L"SearchTrack",CSetting::TYPE_BOOL,IDS_SEARCH_TRACK,IDS_SEARCH_TRACK_TIP,1,0,L"SearchBox"},
|
{L"SearchTrack",CSetting::TYPE_BOOL,IDS_SEARCH_TRACK,IDS_SEARCH_TRACK_TIP,1,0,L"SearchBox"},
|
||||||
{L"SearchResults",CSetting::TYPE_INT,IDS_SEARCH_MAX2,IDS_SEARCH_MAX_TIP2,5,CSetting::FLAG_MENU_CLASSIC_BOTH,L"SearchBox"},
|
{L"SearchResults",CSetting::TYPE_INT,IDS_SEARCH_MAX2,IDS_SEARCH_MAX_TIP2,5,CSetting::FLAG_MENU_CLASSIC_BOTH,L"SearchBox"},
|
||||||
{L"SearchResultsMax",CSetting::TYPE_INT,IDS_SEARCH_MAX3,IDS_SEARCH_MAX_TIP3,20,CSetting::FLAG_MENU_CLASSIC_BOTH,L"SearchBox"},
|
{L"SearchResultsMax",CSetting::TYPE_INT,IDS_SEARCH_MAX3,IDS_SEARCH_MAX_TIP3,20,CSetting::FLAG_MENU_CLASSIC_BOTH,L"SearchBox"},
|
||||||
|
|||||||
@@ -1301,6 +1301,10 @@ BEGIN
|
|||||||
IDS_NO_DBLCLICK_TIP "When this is checked, single-clicking shortcuts (links) to folders will open them in explorer. Hovering over the shortcut will still expand sub-menus"
|
IDS_NO_DBLCLICK_TIP "When this is checked, single-clicking shortcuts (links) to folders will open them in explorer. Hovering over the shortcut will still expand sub-menus"
|
||||||
IDS_BOLD_SETTINGS "Highlight modified settings"
|
IDS_BOLD_SETTINGS "Highlight modified settings"
|
||||||
IDS_BOLD_SETTINGS_TIP "When this is checked, settings that have been modified from their defaults will be highlighted in bold"
|
IDS_BOLD_SETTINGS_TIP "When this is checked, settings that have been modified from their defaults will be highlighted in bold"
|
||||||
|
IDS_SEARCH_HINT "Custom search hint"
|
||||||
|
IDS_SEARCH_HINT_TIP "When this is checked, the hint text in the search box will be replaced"
|
||||||
|
IDS_NEW_SEARCH_HINT "Custom search hint text"
|
||||||
|
IDS_NEW_SEARCH_HINT_TIP "The text to replace the search hint with. Empty text is a valid option"
|
||||||
END
|
END
|
||||||
|
|
||||||
#endif // English (U.S.) resources
|
#endif // English (U.S.) resources
|
||||||
|
|||||||
@@ -764,6 +764,10 @@
|
|||||||
#define IDS_NO_DBLCLICK_TIP 3667
|
#define IDS_NO_DBLCLICK_TIP 3667
|
||||||
#define IDS_BOLD_SETTINGS 3668
|
#define IDS_BOLD_SETTINGS 3668
|
||||||
#define IDS_BOLD_SETTINGS_TIP 3669
|
#define IDS_BOLD_SETTINGS_TIP 3669
|
||||||
|
#define IDS_SEARCH_HINT 3670
|
||||||
|
#define IDS_SEARCH_HINT_TIP 3671
|
||||||
|
#define IDS_NEW_SEARCH_HINT 3672
|
||||||
|
#define IDS_NEW_SEARCH_HINT_TIP 3673
|
||||||
#define IDS_STRING7001 7001
|
#define IDS_STRING7001 7001
|
||||||
#define IDS_STRING7002 7002
|
#define IDS_STRING7002 7002
|
||||||
#define IDS_STRING7003 7003
|
#define IDS_STRING7003 7003
|
||||||
|
|||||||
Reference in New Issue
Block a user