https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6988b4e2c4cfd27cbe70066c11b5f9a2112ecea9

commit 6988b4e2c4cfd27cbe70066c11b5f9a2112ecea9
Author:     Miguel Almeida <miguelbarraalme...@gmail.com>
AuthorDate: Sun Mar 2 19:56:30 2025 +0000
Commit:     GitHub <nore...@github.com>
CommitDate: Sun Mar 2 20:56:30 2025 +0100

    [EXPLORER] Add Show Desktop button to taskbar customization preview (#7727)
    
    Use a 4D lookup table for the notification area settings preview, instead 
of many if cases.
    
    CORE-19738
---
 base/shell/explorer/explorer.rc     |  18 ++++++++++------
 base/shell/explorer/res/bmp/184.bmp | Bin 0 -> 12554 bytes
 base/shell/explorer/res/bmp/185.bmp | Bin 0 -> 12014 bytes
 base/shell/explorer/res/bmp/186.bmp | Bin 0 -> 12014 bytes
 base/shell/explorer/res/bmp/187.bmp | Bin 0 -> 12014 bytes
 base/shell/explorer/res/bmp/188.bmp | Bin 0 -> 12554 bytes
 base/shell/explorer/res/bmp/189.bmp | Bin 0 -> 12550 bytes
 base/shell/explorer/resource.h      |  18 ++++++++++------
 base/shell/explorer/trayprop.cpp    |  41 ++++++++++++++++++++++++------------
 9 files changed, 51 insertions(+), 26 deletions(-)

diff --git a/base/shell/explorer/explorer.rc b/base/shell/explorer/explorer.rc
index c27464aebbc..8cafd263310 100644
--- a/base/shell/explorer/explorer.rc
+++ b/base/shell/explorer/explorer.rc
@@ -49,15 +49,21 @@ IDB_TASKBARPROP_LOCK_GROUP_NOQL     BITMAP "res/bmp/150.bmp"
 IDB_TASKBARPROP_NOLOCK_GROUP_NOQL   BITMAP "res/bmp/151.bmp"
 IDB_TASKBARPROP_LOCK_NOGROUP_NOQL   BITMAP "res/bmp/152.bmp"
 IDB_TASKBARPROP_NOLOCK_NOGROUP_NOQL BITMAP "res/bmp/153.bmp"
-IDB_SYSTRAYPROP_SHOW_SECONDS        BITMAP "res/bmp/154.bmp"
-IDB_SYSTRAYPROP_HIDE_SECONDS        BITMAP "res/bmp/155.bmp"
+IDB_SYSTRAYPROP_SHOW_SECONDS_NODESK BITMAP "res/bmp/154.bmp"
+IDB_SYSTRAYPROP_HIDE_SECONDS_NODESK BITMAP "res/bmp/155.bmp"
 IDB_STARTMENU                       BITMAP "res/bmp/158.bmp"
 IDB_STARTPREVIEW                    BITMAP "res/bmp/170.bmp"
 IDB_STARTPREVIEW_CLASSIC            BITMAP "res/bmp/171.bmp"
-IDB_SYSTRAYPROP_HIDE_CLOCK          BITMAP "res/bmp/180.bmp"
-IDB_SYSTRAYPROP_HIDE_NOCLOCK        BITMAP "res/bmp/181.bmp"
-IDB_SYSTRAYPROP_SHOW_CLOCK          BITMAP "res/bmp/182.bmp"
-IDB_SYSTRAYPROP_SHOW_NOCLOCK        BITMAP "res/bmp/183.bmp"
+IDB_SYSTRAYPROP_HIDE_CLOCK_NODESK   BITMAP "res/bmp/180.bmp"
+IDB_SYSTRAYPROP_HIDE_NOCLOCK_NODESK BITMAP "res/bmp/181.bmp"
+IDB_SYSTRAYPROP_SHOW_CLOCK_NODESK   BITMAP "res/bmp/182.bmp"
+IDB_SYSTRAYPROP_SHOW_NOCLOCK_NODESK BITMAP "res/bmp/183.bmp"
+IDB_SYSTRAYPROP_SHOW_SECONDS_DESK   BITMAP "res/bmp/184.bmp"
+IDB_SYSTRAYPROP_HIDE_SECONDS_DESK   BITMAP "res/bmp/185.bmp"
+IDB_SYSTRAYPROP_HIDE_CLOCK_DESK     BITMAP "res/bmp/186.bmp"
+IDB_SYSTRAYPROP_HIDE_NOCLOCK_DESK   BITMAP "res/bmp/187.bmp"
+IDB_SYSTRAYPROP_SHOW_CLOCK_DESK     BITMAP "res/bmp/188.bmp"
+IDB_SYSTRAYPROP_SHOW_NOCLOCK_DESK   BITMAP "res/bmp/189.bmp"
 
 CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "explorer.exe.manifest"
 
diff --git a/base/shell/explorer/res/bmp/184.bmp 
b/base/shell/explorer/res/bmp/184.bmp
new file mode 100644
index 00000000000..866e364ab12
Binary files /dev/null and b/base/shell/explorer/res/bmp/184.bmp differ
diff --git a/base/shell/explorer/res/bmp/185.bmp 
b/base/shell/explorer/res/bmp/185.bmp
new file mode 100644
index 00000000000..7767600156d
Binary files /dev/null and b/base/shell/explorer/res/bmp/185.bmp differ
diff --git a/base/shell/explorer/res/bmp/186.bmp 
b/base/shell/explorer/res/bmp/186.bmp
new file mode 100644
index 00000000000..4499898262d
Binary files /dev/null and b/base/shell/explorer/res/bmp/186.bmp differ
diff --git a/base/shell/explorer/res/bmp/187.bmp 
b/base/shell/explorer/res/bmp/187.bmp
new file mode 100644
index 00000000000..f81efb188cc
Binary files /dev/null and b/base/shell/explorer/res/bmp/187.bmp differ
diff --git a/base/shell/explorer/res/bmp/188.bmp 
b/base/shell/explorer/res/bmp/188.bmp
new file mode 100644
index 00000000000..7ed2f228ea0
Binary files /dev/null and b/base/shell/explorer/res/bmp/188.bmp differ
diff --git a/base/shell/explorer/res/bmp/189.bmp 
b/base/shell/explorer/res/bmp/189.bmp
new file mode 100644
index 00000000000..62a0837fb5e
Binary files /dev/null and b/base/shell/explorer/res/bmp/189.bmp differ
diff --git a/base/shell/explorer/resource.h b/base/shell/explorer/resource.h
index 72b3456270b..d0253e7e9da 100644
--- a/base/shell/explorer/resource.h
+++ b/base/shell/explorer/resource.h
@@ -39,15 +39,21 @@
 #define IDB_TASKBARPROP_NOLOCK_GROUP_NOQL   151
 #define IDB_TASKBARPROP_LOCK_NOGROUP_NOQL   152
 #define IDB_TASKBARPROP_NOLOCK_NOGROUP_NOQL 153
-#define IDB_SYSTRAYPROP_SHOW_SECONDS        154
-#define IDB_SYSTRAYPROP_HIDE_SECONDS        155
+#define IDB_SYSTRAYPROP_SHOW_SECONDS_NODESK 154
+#define IDB_SYSTRAYPROP_HIDE_SECONDS_NODESK 155
 #define IDB_STARTMENU                       158
 #define IDB_STARTPREVIEW                    170
 #define IDB_STARTPREVIEW_CLASSIC            171
-#define IDB_SYSTRAYPROP_HIDE_CLOCK          180
-#define IDB_SYSTRAYPROP_HIDE_NOCLOCK        181
-#define IDB_SYSTRAYPROP_SHOW_CLOCK          182
-#define IDB_SYSTRAYPROP_SHOW_NOCLOCK        183
+#define IDB_SYSTRAYPROP_HIDE_CLOCK_NODESK   180
+#define IDB_SYSTRAYPROP_HIDE_NOCLOCK_NODESK 181
+#define IDB_SYSTRAYPROP_SHOW_CLOCK_NODESK   182
+#define IDB_SYSTRAYPROP_SHOW_NOCLOCK_NODESK 183
+#define IDB_SYSTRAYPROP_SHOW_SECONDS_DESK   184
+#define IDB_SYSTRAYPROP_HIDE_SECONDS_DESK   185
+#define IDB_SYSTRAYPROP_HIDE_CLOCK_DESK     186
+#define IDB_SYSTRAYPROP_HIDE_NOCLOCK_DESK   187
+#define IDB_SYSTRAYPROP_SHOW_CLOCK_DESK     188
+#define IDB_SYSTRAYPROP_SHOW_NOCLOCK_DESK   189
 
 
/*******************************************************************************\
 |*                                Menu Resources                               
*|
diff --git a/base/shell/explorer/trayprop.cpp b/base/shell/explorer/trayprop.cpp
index 99983402bc9..875334bf340 100644
--- a/base/shell/explorer/trayprop.cpp
+++ b/base/shell/explorer/trayprop.cpp
@@ -230,13 +230,14 @@ class CNotifySettingsPage : public 
CPropertyPageImpl<CNotifySettingsPage>
 private:
     HBITMAP m_hbmpTray;
     HWND m_hwndTaskbar;
+    static const WORD wImageIdLookupTable[2][2][2][2];
 
     void _UpdateDialog()
     {
         BOOL bShowClock = IsDlgButtonChecked(IDC_TASKBARPROP_CLOCK);
         BOOL bShowSeconds = IsDlgButtonChecked(IDC_TASKBARPROP_SECONDS);
         BOOL bHideInactive = IsDlgButtonChecked(IDC_TASKBARPROP_HIDEICONS);
-        UINT uImageId;
+        BOOL bShowDesktopButton = IsDlgButtonChecked(IDC_TASKBARPROP_DESKTOP);
 
         HWND hwndCustomizeNotifyButton = GetDlgItem(IDC_TASKBARPROP_ICONCUST);
         HWND hwndSeconds = GetDlgItem(IDC_TASKBARPROP_SECONDS);
@@ -246,19 +247,7 @@ private:
         ::EnableWindow(hwndSeconds, bShowClock);
         if (!bShowSeconds)
             CheckDlgButton(IDC_TASKBARPROP_SECONDS, BST_UNCHECKED);
-
-        if (bHideInactive && bShowClock && bShowSeconds)
-            uImageId = IDB_SYSTRAYPROP_HIDE_SECONDS;
-        else if (bHideInactive && bShowClock && !bShowSeconds)
-            uImageId = IDB_SYSTRAYPROP_HIDE_CLOCK;
-        else if (bHideInactive && !bShowClock)
-            uImageId = IDB_SYSTRAYPROP_HIDE_NOCLOCK;
-        else if (!bHideInactive && bShowClock && bShowSeconds)
-            uImageId = IDB_SYSTRAYPROP_SHOW_SECONDS;
-        else if (!bHideInactive && bShowClock && !bShowSeconds)
-            uImageId = IDB_SYSTRAYPROP_SHOW_CLOCK;
-        else if (!bHideInactive && !bShowClock)
-            uImageId = IDB_SYSTRAYPROP_SHOW_NOCLOCK;
+        UINT uImageId = 
wImageIdLookupTable[bShowClock][bShowSeconds][bHideInactive][bShowDesktopButton];
 
         SetBitmap(hwndTrayBitmap, &m_hbmpTray, uImageId);
     }
@@ -324,6 +313,30 @@ public:
     }
 };
 
+const WORD CNotifySettingsPage::wImageIdLookupTable[2][2][2][2] =
+{
+    {
+        {
+            {IDB_SYSTRAYPROP_SHOW_NOCLOCK_NODESK, 
IDB_SYSTRAYPROP_SHOW_NOCLOCK_DESK},
+            {IDB_SYSTRAYPROP_HIDE_NOCLOCK_NODESK, 
IDB_SYSTRAYPROP_HIDE_NOCLOCK_DESK}
+        },
+        {
+            {IDB_SYSTRAYPROP_SHOW_NOCLOCK_NODESK, 
IDB_SYSTRAYPROP_SHOW_NOCLOCK_DESK},
+            {IDB_SYSTRAYPROP_HIDE_NOCLOCK_NODESK, 
IDB_SYSTRAYPROP_HIDE_NOCLOCK_DESK}
+        }
+    },
+    {
+        {
+            {IDB_SYSTRAYPROP_SHOW_CLOCK_NODESK, 
IDB_SYSTRAYPROP_SHOW_CLOCK_DESK},
+            {IDB_SYSTRAYPROP_HIDE_CLOCK_NODESK, 
IDB_SYSTRAYPROP_HIDE_CLOCK_DESK}
+        },
+        {
+            {IDB_SYSTRAYPROP_SHOW_SECONDS_NODESK, 
IDB_SYSTRAYPROP_SHOW_SECONDS_DESK},
+            {IDB_SYSTRAYPROP_HIDE_SECONDS_NODESK, 
IDB_SYSTRAYPROP_HIDE_SECONDS_DESK}
+        }
+    }
+};
+
 static int CALLBACK
 PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
 {

Reply via email to