winecfg: Add menu font settings to desktop integration tab.

This commit is contained in:
Nigel Liang 2007-07-30 21:06:44 -07:00 committed by Alexandre Julliard
parent e027f0297e
commit a4d8f32d55
12 changed files with 66 additions and 1 deletions

View File

@ -311,4 +311,5 @@ BEGIN
IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "Písmo titulku aktivního okna" IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "Písmo titulku aktivního okna"
IDC_SYSPARAMS_INACTIVE_TITLE "Pozadí titulku neaktivného okna" IDC_SYSPARAMS_INACTIVE_TITLE "Pozadí titulku neaktivného okna"
IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "Písmo titulku neaktivního okna" IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "Písmo titulku neaktivního okna"
IDC_SYSPARAMS_MSGBOX_TEXT "Message Box Text"
END END

View File

@ -306,4 +306,5 @@ BEGIN
IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "Aktiver Titelleistentext" IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "Aktiver Titelleistentext"
IDC_SYSPARAMS_INACTIVE_TITLE "Inaktive Titelleiste" IDC_SYSPARAMS_INACTIVE_TITLE "Inaktive Titelleiste"
IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "Inaktiver Titelleistentext" IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "Inaktiver Titelleistentext"
IDC_SYSPARAMS_MSGBOX_TEXT "Message Box Text"
END END

View File

@ -308,4 +308,5 @@ BEGIN
IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "Active Title Text" IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "Active Title Text"
IDC_SYSPARAMS_INACTIVE_TITLE "Inactive Title Bar" IDC_SYSPARAMS_INACTIVE_TITLE "Inactive Title Bar"
IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "Inactive Title Text" IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "Inactive Title Text"
IDC_SYSPARAMS_MSGBOX_TEXT "Message Box Text"
END END

View File

@ -306,4 +306,5 @@ BEGIN
IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "Texto de barra de título activa" IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "Texto de barra de título activa"
IDC_SYSPARAMS_INACTIVE_TITLE "Barra de título inactiva" IDC_SYSPARAMS_INACTIVE_TITLE "Barra de título inactiva"
IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "Texto de barra de título inactiva" IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "Texto de barra de título inactiva"
IDC_SYSPARAMS_MSGBOX_TEXT "Message Box Text"
END END

View File

@ -306,4 +306,5 @@ BEGIN
IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "Texte de la barre de titre active" IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "Texte de la barre de titre active"
IDC_SYSPARAMS_INACTIVE_TITLE "Barre de titre inactive" IDC_SYSPARAMS_INACTIVE_TITLE "Barre de titre inactive"
IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "Texte de la barre de titre inactive" IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "Texte de la barre de titre inactive"
IDC_SYSPARAMS_MSGBOX_TEXT "Message Box Text"
END END

View File

@ -308,4 +308,5 @@ BEGIN
IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "활성된 제목 문자" IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "활성된 제목 문자"
IDC_SYSPARAMS_INACTIVE_TITLE "비활성된 제목 막대" IDC_SYSPARAMS_INACTIVE_TITLE "비활성된 제목 막대"
IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "비활성된 제목 문자" IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "비활성된 제목 문자"
IDC_SYSPARAMS_MSGBOX_TEXT "Message Box Text"
END END

View File

@ -305,4 +305,5 @@ BEGIN
IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "Aktiv titteltekst" IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "Aktiv titteltekst"
IDC_SYSPARAMS_INACTIVE_TITLE "Inaktiv tittellinje" IDC_SYSPARAMS_INACTIVE_TITLE "Inaktiv tittellinje"
IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "Inaktiv titteltekst" IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "Inaktiv titteltekst"
IDC_SYSPARAMS_MSGBOX_TEXT "Message Box Text"
END END

View File

@ -311,4 +311,5 @@ BEGIN
IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "Tytuł aktywnego okna" IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "Tytuł aktywnego okna"
IDC_SYSPARAMS_INACTIVE_TITLE "Tło nagłówka nieaktywnego okna" IDC_SYSPARAMS_INACTIVE_TITLE "Tło nagłówka nieaktywnego okna"
IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "Tytuł nieaktywnego okna" IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "Tytuł nieaktywnego okna"
IDC_SYSPARAMS_MSGBOX_TEXT "Message Box Text"
END END

View File

@ -307,6 +307,7 @@ BEGIN
IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "Text bară de titlu activă" IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "Text bară de titlu activă"
IDC_SYSPARAMS_INACTIVE_TITLE "Bară de titlu inactivă" IDC_SYSPARAMS_INACTIVE_TITLE "Bară de titlu inactivă"
IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "Text bară de titlu inactivă" IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "Text bară de titlu inactivă"
IDC_SYSPARAMS_MSGBOX_TEXT "Message Box Text"
END END
#pragma code_page(default) #pragma code_page(default)

View File

@ -307,4 +307,5 @@ BEGIN
IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD>" IDC_SYSPARAMS_ACTIVE_TITLE_TEXT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD>"
IDC_SYSPARAMS_INACTIVE_TITLE "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>" IDC_SYSPARAMS_INACTIVE_TITLE "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"
IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD>" IDC_SYSPARAMS_INACTIVE_TITLE_TEXT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD>"
IDC_SYSPARAMS_MSGBOX_TEXT "Message Box Text"
END END

View File

@ -231,3 +231,4 @@
#define IDC_SYSPARAMS_ACTIVE_TITLE_TEXT 8413 #define IDC_SYSPARAMS_ACTIVE_TITLE_TEXT 8413
#define IDC_SYSPARAMS_INACTIVE_TITLE 8414 #define IDC_SYSPARAMS_INACTIVE_TITLE 8414
#define IDC_SYSPARAMS_INACTIVE_TITLE_TEXT 8415 #define IDC_SYSPARAMS_INACTIVE_TITLE_TEXT 8415
#define IDC_SYSPARAMS_MSGBOX_TEXT 8416

View File

@ -835,6 +835,7 @@ static struct
const char *color_reg; const char *color_reg;
int size; int size;
COLORREF color; COLORREF color;
LOGFONTW lf;
} metrics[] = } metrics[] =
{ {
{-1, COLOR_BTNFACE, "ButtonFace" }, /* IDC_SYSPARAMS_BUTTON */ {-1, COLOR_BTNFACE, "ButtonFace" }, /* IDC_SYSPARAMS_BUTTON */
@ -852,7 +853,8 @@ static struct
{SM_CXSIZE, COLOR_ACTIVECAPTION, "ActiveTitle" }, /* IDC_SYSPARAMS_ACTIVE_TITLE */ {SM_CXSIZE, COLOR_ACTIVECAPTION, "ActiveTitle" }, /* IDC_SYSPARAMS_ACTIVE_TITLE */
{-1, COLOR_CAPTIONTEXT, "TitleText" }, /* IDC_SYSPARAMS_ACTIVE_TITLE_TEXT */ {-1, COLOR_CAPTIONTEXT, "TitleText" }, /* IDC_SYSPARAMS_ACTIVE_TITLE_TEXT */
{-1, COLOR_INACTIVECAPTION, "InactiveTitle" }, /* IDC_SYSPARAMS_INACTIVE_TITLE */ {-1, COLOR_INACTIVECAPTION, "InactiveTitle" }, /* IDC_SYSPARAMS_INACTIVE_TITLE */
{-1, COLOR_INACTIVECAPTIONTEXT,"InactiveTitleText" } /* IDC_SYSPARAMS_INACTIVE_TITLE_TEXT */ {-1, COLOR_INACTIVECAPTIONTEXT,"InactiveTitleText" }, /* IDC_SYSPARAMS_INACTIVE_TITLE_TEXT */
{-1, -1, "MsgBoxText" } /* IDC_SYSPARAMS_MSGBOX_TEXT */
}; };
static void save_sys_color(int idx, COLORREF clr) static void save_sys_color(int idx, COLORREF clr)
@ -867,6 +869,7 @@ static void read_sysparams(HWND hDlg)
{ {
WCHAR buffer[256]; WCHAR buffer[256];
HWND list = GetDlgItem(hDlg, IDC_SYSPARAM_COMBO); HWND list = GetDlgItem(hDlg, IDC_SYSPARAM_COMBO);
NONCLIENTMETRICSW nonclient_metrics;
int i, idx; int i, idx;
for (i = 0; i < sizeof(metrics) / sizeof(metrics[0]); i++) for (i = 0; i < sizeof(metrics) / sizeof(metrics[0]); i++)
@ -881,6 +884,18 @@ static void read_sysparams(HWND hDlg)
if (metrics[i].color_idx != -1) if (metrics[i].color_idx != -1)
metrics[i].color = GetSysColor(metrics[i].color_idx); metrics[i].color = GetSysColor(metrics[i].color_idx);
} }
nonclient_metrics.cbSize = sizeof(NONCLIENTMETRICSW);
SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSW), &nonclient_metrics, 0);
memcpy(&(metrics[IDC_SYSPARAMS_MENU_TEXT - IDC_SYSPARAMS_BUTTON].lf),
&(nonclient_metrics.lfMenuFont), sizeof(LOGFONTW));
memcpy(&(metrics[IDC_SYSPARAMS_ACTIVE_TITLE_TEXT - IDC_SYSPARAMS_BUTTON].lf),
&(nonclient_metrics.lfCaptionFont), sizeof(LOGFONTW));
memcpy(&(metrics[IDC_SYSPARAMS_TOOLTIP_TEXT - IDC_SYSPARAMS_BUTTON].lf),
&(nonclient_metrics.lfStatusFont), sizeof(LOGFONTW));
memcpy(&(metrics[IDC_SYSPARAMS_MSGBOX_TEXT - IDC_SYSPARAMS_BUTTON].lf),
&(nonclient_metrics.lfMessageFont), sizeof(LOGFONTW));
} }
static void apply_sysparams(void) static void apply_sysparams(void)
@ -900,6 +915,19 @@ static void apply_sysparams(void)
nonclient_metrics.iScrollWidth = nonclient_metrics.iScrollHeight = nonclient_metrics.iScrollWidth = nonclient_metrics.iScrollHeight =
metrics[IDC_SYSPARAMS_SCROLLBAR - IDC_SYSPARAMS_BUTTON].size; metrics[IDC_SYSPARAMS_SCROLLBAR - IDC_SYSPARAMS_BUTTON].size;
memcpy(&(nonclient_metrics.lfMenuFont),
&(metrics[IDC_SYSPARAMS_MENU_TEXT - IDC_SYSPARAMS_BUTTON].lf),
sizeof(LOGFONTW));
memcpy(&(nonclient_metrics.lfCaptionFont),
&(metrics[IDC_SYSPARAMS_ACTIVE_TITLE_TEXT - IDC_SYSPARAMS_BUTTON].lf),
sizeof(LOGFONTW));
memcpy(&(nonclient_metrics.lfStatusFont),
&(metrics[IDC_SYSPARAMS_TOOLTIP_TEXT - IDC_SYSPARAMS_BUTTON].lf),
sizeof(LOGFONTW));
memcpy(&(nonclient_metrics.lfMessageFont),
&(metrics[IDC_SYSPARAMS_MSGBOX_TEXT - IDC_SYSPARAMS_BUTTON].lf),
sizeof(LOGFONTW));
SystemParametersInfoW(SPI_SETNONCLIENTMETRICS, sizeof(nonclient_metrics), &nonclient_metrics, SystemParametersInfoW(SPI_SETNONCLIENTMETRICS, sizeof(nonclient_metrics), &nonclient_metrics,
SPIF_UPDATEINIFILE | SPIF_SENDCHANGE); SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);
@ -932,6 +960,13 @@ static void on_sysparam_change(HWND hDlg)
else else
set_text(hDlg, IDC_SYSPARAM_SIZE, ""); set_text(hDlg, IDC_SYSPARAM_SIZE, "");
EnableWindow(GetDlgItem(hDlg, IDC_SYSPARAM_FONT),
index == IDC_SYSPARAMS_MENU_TEXT-IDC_SYSPARAMS_BUTTON ||
index == IDC_SYSPARAMS_ACTIVE_TITLE_TEXT-IDC_SYSPARAMS_BUTTON ||
index == IDC_SYSPARAMS_TOOLTIP_TEXT-IDC_SYSPARAMS_BUTTON ||
index == IDC_SYSPARAMS_MSGBOX_TEXT-IDC_SYSPARAMS_BUTTON
);
updating_ui = FALSE; updating_ui = FALSE;
} }
@ -970,6 +1005,21 @@ static void on_draw_item(HWND hDlg, WPARAM wParam, LPARAM lParam)
} }
} }
static void on_select_font(HWND hDlg)
{
CHOOSEFONTW cf;
int index = SendDlgItemMessageW(hDlg, IDC_SYSPARAM_COMBO, CB_GETCURSEL, 0, 0);
index = SendDlgItemMessageW(hDlg, IDC_SYSPARAM_COMBO, CB_GETITEMDATA, index, 0);
ZeroMemory(&cf, sizeof(cf));
cf.lStructSize = sizeof(CHOOSEFONTW);
cf.hwndOwner = hDlg;
cf.lpLogFont = &(metrics[index].lf);
cf.Flags = CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT | CF_NOSCRIPTSEL;
ChooseFontW(&cf);
}
INT_PTR CALLBACK INT_PTR CALLBACK
ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
@ -1030,6 +1080,10 @@ ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
on_theme_install (hDlg); on_theme_install (hDlg);
break; break;
case IDC_SYSPARAM_FONT:
on_select_font(hDlg);
break;
case IDC_BROWSE_SFPATH: case IDC_BROWSE_SFPATH:
if (browse_for_unix_folder(hDlg, psfiSelected->szLinkTarget)) { if (browse_for_unix_folder(hDlg, psfiSelected->szLinkTarget)) {
update_shell_folder_listview(hDlg); update_shell_folder_listview(hDlg);