Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
5b8fdb97
Commit
5b8fdb97
authored
May 17, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecfg: Keep metrics in DPI-relative format when saving the theme.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5f494bfe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
26 deletions
+33
-26
theme.c
programs/winecfg/theme.c
+33
-26
No files found.
programs/winecfg/theme.c
View file @
5b8fdb97
...
...
@@ -1011,35 +1011,42 @@ static void read_sysparams(HWND hDlg)
static
void
apply_sysparams
(
void
)
{
NONCLIENTMETRICSW
n
onclient_metrics
;
NONCLIENTMETRICSW
n
cm
;
int
i
,
cnt
=
0
;
int
colors_idx
[
sizeof
(
metrics
)
/
sizeof
(
metrics
[
0
])];
COLORREF
colors
[
sizeof
(
metrics
)
/
sizeof
(
metrics
[
0
])];
nonclient_metrics
.
cbSize
=
sizeof
(
nonclient_metrics
);
SystemParametersInfoW
(
SPI_GETNONCLIENTMETRICS
,
sizeof
(
nonclient_metrics
),
&
nonclient_metrics
,
0
);
nonclient_metrics
.
iMenuWidth
=
nonclient_metrics
.
iMenuHeight
=
metrics
[
IDC_SYSPARAMS_MENU
-
IDC_SYSPARAMS_BUTTON
].
size
;
nonclient_metrics
.
iCaptionWidth
=
nonclient_metrics
.
iCaptionHeight
=
metrics
[
IDC_SYSPARAMS_ACTIVE_TITLE
-
IDC_SYSPARAMS_BUTTON
].
size
;
nonclient_metrics
.
iScrollWidth
=
nonclient_metrics
.
iScrollHeight
=
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
,
HDC
hdc
;
int
dpi
;
hdc
=
GetDC
(
0
);
dpi
=
GetDeviceCaps
(
hdc
,
LOGPIXELSY
);
ReleaseDC
(
0
,
hdc
);
ncm
.
cbSize
=
sizeof
(
ncm
);
SystemParametersInfoW
(
SPI_GETNONCLIENTMETRICS
,
sizeof
(
ncm
),
&
ncm
,
0
);
/* convert metrics back to twips */
ncm
.
iMenuWidth
=
ncm
.
iMenuHeight
=
MulDiv
(
metrics
[
IDC_SYSPARAMS_MENU
-
IDC_SYSPARAMS_BUTTON
].
size
,
-
1440
,
dpi
);
ncm
.
iCaptionWidth
=
ncm
.
iCaptionHeight
=
MulDiv
(
metrics
[
IDC_SYSPARAMS_ACTIVE_TITLE
-
IDC_SYSPARAMS_BUTTON
].
size
,
-
1440
,
dpi
);
ncm
.
iScrollWidth
=
ncm
.
iScrollHeight
=
MulDiv
(
metrics
[
IDC_SYSPARAMS_SCROLLBAR
-
IDC_SYSPARAMS_BUTTON
].
size
,
-
1440
,
dpi
);
ncm
.
iSmCaptionWidth
=
MulDiv
(
ncm
.
iSmCaptionWidth
,
-
1440
,
dpi
);
ncm
.
iSmCaptionHeight
=
MulDiv
(
ncm
.
iSmCaptionHeight
,
-
1440
,
dpi
);
ncm
.
lfMenuFont
=
metrics
[
IDC_SYSPARAMS_MENU_TEXT
-
IDC_SYSPARAMS_BUTTON
].
lf
;
ncm
.
lfCaptionFont
=
metrics
[
IDC_SYSPARAMS_ACTIVE_TITLE_TEXT
-
IDC_SYSPARAMS_BUTTON
].
lf
;
ncm
.
lfStatusFont
=
metrics
[
IDC_SYSPARAMS_TOOLTIP_TEXT
-
IDC_SYSPARAMS_BUTTON
].
lf
;
ncm
.
lfMessageFont
=
metrics
[
IDC_SYSPARAMS_MSGBOX_TEXT
-
IDC_SYSPARAMS_BUTTON
].
lf
;
ncm
.
lfMenuFont
.
lfHeight
=
MulDiv
(
ncm
.
lfMenuFont
.
lfHeight
,
-
72
,
dpi
);
ncm
.
lfCaptionFont
.
lfHeight
=
MulDiv
(
ncm
.
lfCaptionFont
.
lfHeight
,
-
72
,
dpi
);
ncm
.
lfStatusFont
.
lfHeight
=
MulDiv
(
ncm
.
lfStatusFont
.
lfHeight
,
-
72
,
dpi
);
ncm
.
lfMessageFont
.
lfHeight
=
MulDiv
(
ncm
.
lfMessageFont
.
lfHeight
,
-
72
,
dpi
);
ncm
.
lfSmCaptionFont
.
lfHeight
=
MulDiv
(
ncm
.
lfSmCaptionFont
.
lfHeight
,
-
72
,
dpi
);
SystemParametersInfoW
(
SPI_SETNONCLIENTMETRICS
,
sizeof
(
ncm
),
&
ncm
,
SPIF_UPDATEINIFILE
|
SPIF_SENDCHANGE
);
for
(
i
=
0
;
i
<
sizeof
(
metrics
)
/
sizeof
(
metrics
[
0
]);
i
++
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment