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

commit deccfb8c9fb860c2dcc19d28339ab9cbab2bcc8d
Author:     Jose Carlos Jesus <zecarlos1...@hotmail.com>
AuthorDate: Fri Aug 2 22:54:41 2024 +0100
Commit:     GitHub <nore...@github.com>
CommitDate: Sat Aug 3 00:54:41 2024 +0300

    [TASKMGR] Allow setting each column alignment independently (#7208)
    
    Add dwAlign attribute to the PresetColumnEntry structure to make it work.
    
    CORE-19280
---
 base/applications/taskmgr/column.c | 58 +++++++++++++++++++-------------------
 base/applications/taskmgr/column.h |  1 +
 2 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/base/applications/taskmgr/column.c 
b/base/applications/taskmgr/column.c
index b6eec0f5ec8..75d106f68e3 100644
--- a/base/applications/taskmgr/column.c
+++ b/base/applications/taskmgr/column.c
@@ -10,36 +10,36 @@
 
 UINT    ColumnDataHints[COLUMN_NMAX];
 
-#define DECLARE_COLUMN_PRESET(_name, _size, _state) \
-    { IDS_TAB_##_name, IDC_##_name, _size, _state },
+#define DECLARE_COLUMN_PRESET(_name, _size, _state, _align) \
+    { IDS_TAB_##_name, IDC_##_name, _size, _state, _align },
 
 const PresetColumnEntry ColumnPresets[COLUMN_NMAX] = {
-    DECLARE_COLUMN_PRESET(IMAGENAME,        105,  TRUE)
-    DECLARE_COLUMN_PRESET(PID,               50,  TRUE)
-    DECLARE_COLUMN_PRESET(USERNAME,         107, FALSE)
-    DECLARE_COLUMN_PRESET(SESSIONID,         70, FALSE)
-    DECLARE_COLUMN_PRESET(CPUUSAGE,          35,  TRUE)
-    DECLARE_COLUMN_PRESET(CPUTIME,           70,  TRUE)
-    DECLARE_COLUMN_PRESET(MEMORYUSAGE,       70,  TRUE)
-    DECLARE_COLUMN_PRESET(PEAKMEMORYUSAGE,  100, FALSE)
-    DECLARE_COLUMN_PRESET(MEMORYUSAGEDELTA,  70, FALSE)
-    DECLARE_COLUMN_PRESET(PAGEFAULTS,        70, FALSE)
-    DECLARE_COLUMN_PRESET(PAGEFAULTSDELTA,   70, FALSE)
-    DECLARE_COLUMN_PRESET(VIRTUALMEMORYSIZE, 70, FALSE)
-    DECLARE_COLUMN_PRESET(PAGEDPOOL,         70, FALSE)
-    DECLARE_COLUMN_PRESET(NONPAGEDPOOL,      70, FALSE)
-    DECLARE_COLUMN_PRESET(BASEPRIORITY,      60, FALSE)
-    DECLARE_COLUMN_PRESET(HANDLECOUNT,       60, FALSE)
-    DECLARE_COLUMN_PRESET(THREADCOUNT,       60, FALSE)
-    DECLARE_COLUMN_PRESET(USEROBJECTS,       60, FALSE)
-    DECLARE_COLUMN_PRESET(GDIOBJECTS,        60, FALSE)
-    DECLARE_COLUMN_PRESET(IOREADS,           70, FALSE)
-    DECLARE_COLUMN_PRESET(IOWRITES,          70, FALSE)
-    DECLARE_COLUMN_PRESET(IOOTHER,           70, FALSE)
-    DECLARE_COLUMN_PRESET(IOREADBYTES,       70, FALSE)
-    DECLARE_COLUMN_PRESET(IOWRITEBYTES,      70, FALSE)
-    DECLARE_COLUMN_PRESET(IOOTHERBYTES,      70, FALSE)
-    DECLARE_COLUMN_PRESET(COMMANDLINE,      450, FALSE)
+    DECLARE_COLUMN_PRESET(IMAGENAME,        105,  TRUE, LVCFMT_LEFT)
+    DECLARE_COLUMN_PRESET(PID,               50,  TRUE, LVCFMT_LEFT)
+    DECLARE_COLUMN_PRESET(USERNAME,         107, FALSE, LVCFMT_LEFT)
+    DECLARE_COLUMN_PRESET(SESSIONID,         70, FALSE, LVCFMT_LEFT)
+    DECLARE_COLUMN_PRESET(CPUUSAGE,          35,  TRUE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(CPUTIME,           70,  TRUE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(MEMORYUSAGE,       70,  TRUE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(PEAKMEMORYUSAGE,  100, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(MEMORYUSAGEDELTA,  70, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(PAGEFAULTS,        70, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(PAGEFAULTSDELTA,   70, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(VIRTUALMEMORYSIZE, 70, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(PAGEDPOOL,         70, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(NONPAGEDPOOL,      70, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(BASEPRIORITY,      60, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(HANDLECOUNT,       60, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(THREADCOUNT,       60, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(USEROBJECTS,       60, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(GDIOBJECTS,        60, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(IOREADS,           70, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(IOWRITES,          70, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(IOOTHER,           70, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(IOREADBYTES,       70, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(IOWRITEBYTES,      70, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(IOOTHERBYTES,      70, FALSE, LVCFMT_RIGHT)
+    DECLARE_COLUMN_PRESET(COMMANDLINE,      450, FALSE, LVCFMT_LEFT)
 };
 
 static int       InsertColumn(int nCol, LPCWSTR lpszColumnHeading, int 
nFormat, int nWidth, int nSubItem);
@@ -54,7 +54,7 @@ void AddColumns(void)
     for (n=0; n<COLUMN_NMAX; n++) {
         if (TaskManagerSettings.Columns[n]) {
             LoadStringW(hInst, ColumnPresets[n].dwIdsName, szTemp, 
_countof(szTemp));
-            InsertColumn(n, szTemp, LVCFMT_LEFT, 
TaskManagerSettings.ColumnSizeArray[n], -1);
+            InsertColumn(n, szTemp, ColumnPresets[n].dwAlign, 
TaskManagerSettings.ColumnSizeArray[n], -1);
         }
     }
 
diff --git a/base/applications/taskmgr/column.h 
b/base/applications/taskmgr/column.h
index 4ccdf36d593..de0a1e9e35d 100644
--- a/base/applications/taskmgr/column.h
+++ b/base/applications/taskmgr/column.h
@@ -60,6 +60,7 @@ typedef struct {
     DWORD   dwIdcCtrl;
     int     size;
     BOOL    bDefaults;
+    DWORD   dwAlign;
 } PresetColumnEntry;
 
 

Reply via email to