Mark Harmstone : winecfg: Refresh sys params on theme change.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Feb 24 10:33:24 CST 2015


Module: wine
Branch: master
Commit: fa685fc353adf73d8783d8d29a72a78486fd64d2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fa685fc353adf73d8783d8d29a72a78486fd64d2

Author: Mark Harmstone <hellas at burntcomma.com>
Date:   Sat Feb 21 18:55:16 2015 +0000

winecfg: Refresh sys params on theme change.

---

 programs/winecfg/theme.c | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/programs/winecfg/theme.c b/programs/winecfg/theme.c
index 79c8b7c..6db602f 100644
--- a/programs/winecfg/theme.c
+++ b/programs/winecfg/theme.c
@@ -83,6 +83,9 @@ HRESULT WINAPI CloseThemeFile (HTHEMEFILE hThemeFile);
 HRESULT WINAPI EnumThemes (LPCWSTR pszThemePath, EnumThemeProc callback,
                            LPVOID lpData);
 
+static void refresh_sysparams(HWND hDlg);
+static void on_sysparam_change(HWND hDlg);
+
 /* A struct to keep both the internal and "fancy" name of a color or size */
 typedef struct
 {
@@ -388,7 +391,7 @@ static BOOL update_color_and_size (int themeIndex, HWND comboColor,
 }
 
 /* Apply a theme from a given theme, color and size combo box item index. */
-static void do_apply_theme (int themeIndex, int colorIndex, int sizeIndex)
+static void do_apply_theme (HWND dialog, int themeIndex, int colorIndex, int sizeIndex)
 {
     static char b[] = "\0";
 
@@ -423,6 +426,8 @@ static void do_apply_theme (int themeIndex, int colorIndex, int sizeIndex)
 	    ApplyTheme (NULL, b, NULL);
 	}
     }
+
+    refresh_sysparams(dialog);
 }
 
 static BOOL updating_ui;
@@ -491,7 +496,7 @@ static void apply_theme(HWND dialog)
     sizeIndex = SendMessageW (GetDlgItem (dialog, IDC_THEME_SIZECOMBO),
         CB_GETCURSEL, 0, 0);
 
-    do_apply_theme (themeIndex, colorIndex, sizeIndex);
+    do_apply_theme (dialog, themeIndex, colorIndex, sizeIndex);
     theme_dirty = FALSE;
 }
 
@@ -956,6 +961,21 @@ static void apply_shell_folder_changes(void) {
     }
 }
 
+static void refresh_sysparams(HWND hDlg)
+{
+    int i;
+
+    for (i = 0; i < sizeof(metrics) / sizeof(metrics[0]); i++)
+    {
+        if (metrics[i].sm_idx != -1)
+            metrics[i].size = GetSystemMetrics(metrics[i].sm_idx);
+        if (metrics[i].color_idx != -1)
+            metrics[i].color = GetSysColor(metrics[i].color_idx);
+    }
+
+    on_sysparam_change(hDlg);
+}
+
 static void read_sysparams(HWND hDlg)
 {
     WCHAR buffer[256];




More information about the wine-cvs mailing list