https://git.reactos.org/?p=reactos.git;a=commitdiff;h=acc25ce9145688cac8f6a…
commit acc25ce9145688cac8f6aef26e648ce6dd130d75
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Thu Dec 30 20:17:32 2021 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Fri Dec 31 21:27:48 2021 +0100
[RAPPS] Show the user that there are no search results
CORE-17944
---
base/applications/rapps/appview.cpp | 37 ++++++++++++++++++++++++++++++
base/applications/rapps/gui.cpp | 8 +++++++
base/applications/rapps/include/appview.h | 13 ++++++++++-
base/applications/rapps/include/resource.h | 1 +
base/applications/rapps/lang/bg-BG.rc | 1 +
base/applications/rapps/lang/cs-CZ.rc | 1 +
base/applications/rapps/lang/de-DE.rc | 1 +
base/applications/rapps/lang/en-US.rc | 1 +
base/applications/rapps/lang/es-ES.rc | 1 +
base/applications/rapps/lang/et-EE.rc | 1 +
base/applications/rapps/lang/fr-FR.rc | 1 +
base/applications/rapps/lang/he-IL.rc | 1 +
base/applications/rapps/lang/hu-HU.rc | 1 +
base/applications/rapps/lang/id-ID.rc | 1 +
base/applications/rapps/lang/it-IT.rc | 1 +
base/applications/rapps/lang/ja-JP.rc | 1 +
base/applications/rapps/lang/no-NO.rc | 1 +
base/applications/rapps/lang/pl-PL.rc | 1 +
base/applications/rapps/lang/pt-BR.rc | 1 +
base/applications/rapps/lang/pt-PT.rc | 1 +
base/applications/rapps/lang/ro-RO.rc | 1 +
base/applications/rapps/lang/ru-RU.rc | 1 +
base/applications/rapps/lang/sk-SK.rc | 1 +
base/applications/rapps/lang/sq-AL.rc | 1 +
base/applications/rapps/lang/sv-SE.rc | 1 +
base/applications/rapps/lang/tr-TR.rc | 1 +
base/applications/rapps/lang/uk-UA.rc | 1 +
base/applications/rapps/lang/zh-CN.rc | 1 +
base/applications/rapps/lang/zh-HK.rc | 1 +
base/applications/rapps/lang/zh-TW.rc | 1 +
30 files changed, 84 insertions(+), 1 deletion(-)
diff --git a/base/applications/rapps/appview.cpp b/base/applications/rapps/appview.cpp
index 09bbb178a9a..7cffc3748bb 100644
--- a/base/applications/rapps/appview.cpp
+++ b/base/applications/rapps/appview.cpp
@@ -1127,6 +1127,30 @@ CAppsListView::~CAppsListView()
}
}
+LRESULT
+CAppsListView::OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled)
+{
+ LRESULT lRes = this->DefWindowProc(uMsg, wParam, lParam);
+ if (!m_Watermark.IsEmpty())
+ {
+ RECT rc;
+ GetClientRect(&rc);
+ HGDIOBJ oldFont = SelectFont(HDC(wParam), GetStockFont(DEFAULT_GUI_FONT));
+ DrawShadowText(
+ HDC(wParam), m_Watermark.GetString(), m_Watermark.GetLength(), &rc,
+ DT_CENTER | DT_VCENTER | DT_NOPREFIX | DT_SINGLELINE,
GetSysColor(COLOR_GRAYTEXT),
+ GetSysColor(COLOR_GRAYTEXT), 1, 1);
+ SelectFont(HDC(wParam), oldFont);
+ }
+ return lRes;
+}
+
+VOID CAppsListView::SetWatermark(const CStringW& Text)
+{
+ m_Watermark = Text;
+}
+
+
VOID CAppsListView::SetCheckboxesVisible(BOOL bIsVisible)
{
if (bIsVisible)
@@ -1279,6 +1303,12 @@ HWND CAppsListView::Create(HWND hwndParent)
SetImageList(m_hImageListView, LVSIL_SMALL);
SetImageList(m_hImageListView, LVSIL_NORMAL);
+#pragma push_macro("SubclassWindow")
+#undef SubclassWindow
+ m_hWnd = NULL;
+ SubclassWindow(hwnd);
+#pragma pop_macro("SubclassWindow")
+
return hwnd;
}
@@ -2015,6 +2045,13 @@ BOOL
CApplicationView::AddAvailableApplication(CAvailableApplicationInfo *AvlbAp
return m_ListView->AddAvailableApplication(AvlbAppInfo, InitCheckState, param);
}
+VOID CApplicationView::SetWatermark(const CStringW& Text)
+{
+ ATLASSERT(GetItemCount() == 0);
+
+ m_ListView->SetWatermark(Text);
+}
+
void CApplicationView::CheckAll()
{
m_ListView->CheckAll();
diff --git a/base/applications/rapps/gui.cpp b/base/applications/rapps/gui.cpp
index 8b26bc2a2f1..a7590e51a43 100644
--- a/base/applications/rapps/gui.cpp
+++ b/base/applications/rapps/gui.cpp
@@ -706,6 +706,14 @@ VOID CMainWindow::UpdateApplicationsList(INT EnumType)
m_ApplicationView->SetRedraw(TRUE);
m_ApplicationView->RedrawWindow(0, 0, RDW_INVALIDATE | RDW_ALLCHILDREN); // force
the child window to repaint
UpdateStatusBarText();
+
+ CStringW text;
+ if (m_ApplicationView->GetItemCount() == 0 && !szSearchPattern.IsEmpty())
+ {
+ text.LoadString(IDS_NO_SEARCH_RESULTS);
+ }
+ m_ApplicationView->SetWatermark(text);
+
bUpdating = FALSE;
}
diff --git a/base/applications/rapps/include/appview.h
b/base/applications/rapps/include/appview.h
index 7a6374ccafa..206f99e37ab 100644
--- a/base/applications/rapps/include/appview.h
+++ b/base/applications/rapps/include/appview.h
@@ -201,7 +201,7 @@ public:
};
class CAppsListView :
- public CUiWindow<CListView>
+ public CUiWindow<CWindowImpl<CAppsListView, CListView>>
{
struct SortContext
{
@@ -221,11 +221,20 @@ class CAppsListView :
APPLICATION_VIEW_TYPE ApplicationViewType = AppViewTypeEmpty;
HIMAGELIST m_hImageListView = NULL;
+ CStringW m_Watermark;
+
+ BEGIN_MSG_MAP(CAppsListView)
+ MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)
+ END_MSG_MAP()
+
+
+ LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled);
public:
CAppsListView();
~CAppsListView();
+ VOID SetWatermark(const CStringW& Text);
VOID SetCheckboxesVisible(BOOL bIsVisible);
VOID ColumnClick(LPNMLISTVIEW pnmv);
@@ -372,6 +381,8 @@ public:
BOOL AddInstalledApplication(CInstalledApplicationInfo *InstAppInfo, LPVOID param);
BOOL AddAvailableApplication(CAvailableApplicationInfo *AvlbAppInfo, BOOL
InitCheckState, LPVOID param);
+ VOID SetWatermark(const CStringW& Text);
+
void CheckAll();
PVOID GetFocusedItemData();
diff --git a/base/applications/rapps/include/resource.h
b/base/applications/rapps/include/resource.h
index 023fcdda882..bb4249cedc1 100644
--- a/base/applications/rapps/include/resource.h
+++ b/base/applications/rapps/include/resource.h
@@ -123,6 +123,7 @@
#define IDS_APP_DISPLAY_DETAILS 133
#define IDS_APP_DISPLAY_LIST 134
#define IDS_APP_DISPLAY_TILE 135
+#define IDS_NO_SEARCH_RESULTS 136
/* Tooltips */
#define IDS_TOOLTIP_INSTALL 200
diff --git a/base/applications/rapps/lang/bg-BG.rc
b/base/applications/rapps/lang/bg-BG.rc
index 82f7814246e..f81020f4310 100644
--- a/base/applications/rapps/lang/bg-BG.rc
+++ b/base/applications/rapps/lang/bg-BG.rc
@@ -218,6 +218,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/cs-CZ.rc
b/base/applications/rapps/lang/cs-CZ.rc
index e29d47af284..e2670f3ac0c 100644
--- a/base/applications/rapps/lang/cs-CZ.rc
+++ b/base/applications/rapps/lang/cs-CZ.rc
@@ -219,6 +219,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/de-DE.rc
b/base/applications/rapps/lang/de-DE.rc
index 93ebd353bf0..476cd6d086e 100644
--- a/base/applications/rapps/lang/de-DE.rc
+++ b/base/applications/rapps/lang/de-DE.rc
@@ -214,6 +214,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "Liste"
IDS_APP_DISPLAY_TILE "Kacheln"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/en-US.rc
b/base/applications/rapps/lang/en-US.rc
index 3f151c10dab..4c4c8bff35f 100644
--- a/base/applications/rapps/lang/en-US.rc
+++ b/base/applications/rapps/lang/en-US.rc
@@ -214,6 +214,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/es-ES.rc
b/base/applications/rapps/lang/es-ES.rc
index 6bbec17dd19..12c7aa808a5 100644
--- a/base/applications/rapps/lang/es-ES.rc
+++ b/base/applications/rapps/lang/es-ES.rc
@@ -217,6 +217,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/et-EE.rc
b/base/applications/rapps/lang/et-EE.rc
index 659c28d953b..8db73934252 100644
--- a/base/applications/rapps/lang/et-EE.rc
+++ b/base/applications/rapps/lang/et-EE.rc
@@ -222,6 +222,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/fr-FR.rc
b/base/applications/rapps/lang/fr-FR.rc
index 6ee794799b9..499cdda5851 100644
--- a/base/applications/rapps/lang/fr-FR.rc
+++ b/base/applications/rapps/lang/fr-FR.rc
@@ -214,6 +214,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Détails"
IDS_APP_DISPLAY_LIST "Liste"
IDS_APP_DISPLAY_TILE "Tuile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/he-IL.rc
b/base/applications/rapps/lang/he-IL.rc
index 306fe22928f..ff689d5a33a 100644
--- a/base/applications/rapps/lang/he-IL.rc
+++ b/base/applications/rapps/lang/he-IL.rc
@@ -220,6 +220,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/hu-HU.rc
b/base/applications/rapps/lang/hu-HU.rc
index 2e1bb14b662..50c6ae4e7cf 100644
--- a/base/applications/rapps/lang/hu-HU.rc
+++ b/base/applications/rapps/lang/hu-HU.rc
@@ -216,6 +216,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Részletek"
IDS_APP_DISPLAY_LIST "Lista"
IDS_APP_DISPLAY_TILE "Csempe"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/id-ID.rc
b/base/applications/rapps/lang/id-ID.rc
index 4907c52af91..c8b11ebd592 100644
--- a/base/applications/rapps/lang/id-ID.rc
+++ b/base/applications/rapps/lang/id-ID.rc
@@ -214,6 +214,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/it-IT.rc
b/base/applications/rapps/lang/it-IT.rc
index ebe78af30e9..1ca702e8d1c 100644
--- a/base/applications/rapps/lang/it-IT.rc
+++ b/base/applications/rapps/lang/it-IT.rc
@@ -214,6 +214,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/ja-JP.rc
b/base/applications/rapps/lang/ja-JP.rc
index 7c26a55f3e7..6d11465afa1 100644
--- a/base/applications/rapps/lang/ja-JP.rc
+++ b/base/applications/rapps/lang/ja-JP.rc
@@ -214,6 +214,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/no-NO.rc
b/base/applications/rapps/lang/no-NO.rc
index 043f551ae6c..605c223fd29 100644
--- a/base/applications/rapps/lang/no-NO.rc
+++ b/base/applications/rapps/lang/no-NO.rc
@@ -214,6 +214,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/pl-PL.rc
b/base/applications/rapps/lang/pl-PL.rc
index 3b82b312267..c32f17306d3 100644
--- a/base/applications/rapps/lang/pl-PL.rc
+++ b/base/applications/rapps/lang/pl-PL.rc
@@ -223,6 +223,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Szczegóły"
IDS_APP_DISPLAY_LIST "Lista"
IDS_APP_DISPLAY_TILE "Kafelki"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/pt-BR.rc
b/base/applications/rapps/lang/pt-BR.rc
index d507c54b8f3..1bd4c71f3b2 100644
--- a/base/applications/rapps/lang/pt-BR.rc
+++ b/base/applications/rapps/lang/pt-BR.rc
@@ -216,6 +216,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/pt-PT.rc
b/base/applications/rapps/lang/pt-PT.rc
index c9cf992be2c..c7c0fbded2f 100644
--- a/base/applications/rapps/lang/pt-PT.rc
+++ b/base/applications/rapps/lang/pt-PT.rc
@@ -216,6 +216,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/ro-RO.rc
b/base/applications/rapps/lang/ro-RO.rc
index c958987a43b..cfd6b0e4aec 100644
--- a/base/applications/rapps/lang/ro-RO.rc
+++ b/base/applications/rapps/lang/ro-RO.rc
@@ -223,6 +223,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/ru-RU.rc
b/base/applications/rapps/lang/ru-RU.rc
index 0ae6e33e89b..71efe6844ef 100644
--- a/base/applications/rapps/lang/ru-RU.rc
+++ b/base/applications/rapps/lang/ru-RU.rc
@@ -214,6 +214,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/sk-SK.rc
b/base/applications/rapps/lang/sk-SK.rc
index 1b261b21feb..f029af632ee 100644
--- a/base/applications/rapps/lang/sk-SK.rc
+++ b/base/applications/rapps/lang/sk-SK.rc
@@ -219,6 +219,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/sq-AL.rc
b/base/applications/rapps/lang/sq-AL.rc
index 0ee3a66f24c..99b28381606 100644
--- a/base/applications/rapps/lang/sq-AL.rc
+++ b/base/applications/rapps/lang/sq-AL.rc
@@ -218,6 +218,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/sv-SE.rc
b/base/applications/rapps/lang/sv-SE.rc
index 5c3800d4200..46c7a7df733 100644
--- a/base/applications/rapps/lang/sv-SE.rc
+++ b/base/applications/rapps/lang/sv-SE.rc
@@ -221,6 +221,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/tr-TR.rc
b/base/applications/rapps/lang/tr-TR.rc
index 53b348f1fb2..a03094e8896 100644
--- a/base/applications/rapps/lang/tr-TR.rc
+++ b/base/applications/rapps/lang/tr-TR.rc
@@ -216,6 +216,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Detaylar"
IDS_APP_DISPLAY_LIST "Liste"
IDS_APP_DISPLAY_TILE "Karo"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/uk-UA.rc
b/base/applications/rapps/lang/uk-UA.rc
index 46bfb100389..c618712d4a4 100644
--- a/base/applications/rapps/lang/uk-UA.rc
+++ b/base/applications/rapps/lang/uk-UA.rc
@@ -222,6 +222,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "Details"
IDS_APP_DISPLAY_LIST "List"
IDS_APP_DISPLAY_TILE "Tile"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/zh-CN.rc
b/base/applications/rapps/lang/zh-CN.rc
index f82334fa9d0..3cec27c9b99 100644
--- a/base/applications/rapps/lang/zh-CN.rc
+++ b/base/applications/rapps/lang/zh-CN.rc
@@ -217,6 +217,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "细节"
IDS_APP_DISPLAY_LIST "列表"
IDS_APP_DISPLAY_TILE "卡片"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/zh-HK.rc
b/base/applications/rapps/lang/zh-HK.rc
index 24552ce79f8..a259434899c 100644
--- a/base/applications/rapps/lang/zh-HK.rc
+++ b/base/applications/rapps/lang/zh-HK.rc
@@ -222,6 +222,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "詳細資料"
IDS_APP_DISPLAY_LIST "列表"
IDS_APP_DISPLAY_TILE "並排"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE
diff --git a/base/applications/rapps/lang/zh-TW.rc
b/base/applications/rapps/lang/zh-TW.rc
index ecec54fadf4..fa25f1c619a 100644
--- a/base/applications/rapps/lang/zh-TW.rc
+++ b/base/applications/rapps/lang/zh-TW.rc
@@ -222,6 +222,7 @@ BEGIN
IDS_APP_DISPLAY_DETAILS "詳情"
IDS_APP_DISPLAY_LIST "列表"
IDS_APP_DISPLAY_TILE "卡片"
+ IDS_NO_SEARCH_RESULTS "No search results"
END
STRINGTABLE