Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
877d12f8
Commit
877d12f8
authored
Aug 24, 2021
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Aug 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uxtheme: Support more HiDPI properties.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4b2777db
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
9 deletions
+55
-9
draw.c
dlls/uxtheme/draw.c
+37
-9
stylemap.c
dlls/uxtheme/stylemap.c
+6
-0
tmschema.h
include/tmschema.h
+6
-0
vssym32.h
include/vssym32.h
+6
-0
No files found.
dlls/uxtheme/draw.c
View file @
877d12f8
...
...
@@ -144,6 +144,24 @@ HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId,
return
DrawThemeBackgroundEx
(
hTheme
,
hdc
,
iPartId
,
iStateId
,
pRect
,
&
opts
);
}
/* Map integer 1..7 to TMT_MINDPI1..TMT_MINDPI7 */
static
int
mindpi_index_to_property
(
int
index
)
{
return
index
<=
5
?
TMT_MINDPI1
+
index
-
1
:
TMT_MINDPI6
+
index
-
6
;
}
/* Map integer 1..7 to TMT_MINSIZE1..TMT_MINSIZE7 */
static
int
minsize_index_to_property
(
int
index
)
{
return
index
<=
5
?
TMT_MINSIZE1
+
index
-
1
:
TMT_MINSIZE6
+
index
-
6
;
}
/* Map integer 1..7 to TMT_IMAGEFILE1..TMT_IMAGEFILE7 */
static
int
imagefile_index_to_property
(
int
index
)
{
return
index
<=
5
?
TMT_IMAGEFILE1
+
index
-
1
:
TMT_IMAGEFILE6
+
index
-
6
;
}
/***********************************************************************
* UXTHEME_SelectImage
*
...
...
@@ -171,16 +189,20 @@ static PTHEME_PROPERTY UXTHEME_SelectImage(HTHEME hTheme, HDC hdc, int iPartId,
if
(
imageselecttype
==
IST_DPI
)
{
int
reqdpi
=
0
;
int
screendpi
=
GetDeviceCaps
(
hdc
,
LOGPIXELSX
);
for
(
i
=
4
;
i
>=
0
;
i
--
)
{
for
(
i
=
7
;
i
>=
1
;
i
--
)
{
reqdpi
=
0
;
if
(
SUCCEEDED
(
GetThemeInt
(
hTheme
,
iPartId
,
iStateId
,
i
+
TMT_MINDPI1
,
&
reqdpi
)))
{
if
(
SUCCEEDED
(
GetThemeInt
(
hTheme
,
iPartId
,
iStateId
,
mindpi_index_to_property
(
i
),
&
reqdpi
)))
{
if
(
reqdpi
!=
0
&&
screendpi
>=
reqdpi
)
{
TRACE
(
"Using %d DPI, image %d
\n
"
,
reqdpi
,
i
+
TMT_IMAGEFILE1
);
TRACE
(
"Using %d DPI, image %d
\n
"
,
reqdpi
,
i
magefile_index_to_property
(
i
)
);
if
(
imageDpi
)
*
imageDpi
=
reqdpi
;
return
MSSTYLES_FindProperty
(
hTheme
,
iPartId
,
iStateId
,
TMT_FILENAME
,
i
+
TMT_IMAGEFILE1
);
return
MSSTYLES_FindProperty
(
hTheme
,
iPartId
,
iStateId
,
TMT_FILENAME
,
imagefile_index_to_property
(
i
));
}
}
}
...
...
@@ -190,11 +212,16 @@ static PTHEME_PROPERTY UXTHEME_SelectImage(HTHEME hTheme, HDC hdc, int iPartId,
else
if
(
imageselecttype
==
IST_SIZE
)
{
POINT
size
=
{
pRect
->
right
-
pRect
->
left
,
pRect
->
bottom
-
pRect
->
top
};
POINT
reqsize
;
for
(
i
=
4
;
i
>=
0
;
i
--
)
{
PTHEME_PROPERTY
fileProp
=
MSSTYLES_FindProperty
(
hTheme
,
iPartId
,
iStateId
,
TMT_FILENAME
,
i
+
TMT_IMAGEFILE1
);
for
(
i
=
7
;
i
>=
1
;
i
--
)
{
PTHEME_PROPERTY
fileProp
;
fileProp
=
MSSTYLES_FindProperty
(
hTheme
,
iPartId
,
iStateId
,
TMT_FILENAME
,
imagefile_index_to_property
(
i
));
if
(
!
fileProp
)
continue
;
if
(
FAILED
(
GetThemePosition
(
hTheme
,
iPartId
,
iStateId
,
i
+
TMT_MINSIZE1
,
&
reqsize
)))
{
if
(
FAILED
(
GetThemePosition
(
hTheme
,
iPartId
,
iStateId
,
minsize_index_to_property
(
i
),
&
reqsize
)))
{
/* fall back to size of Nth image */
WCHAR
szPath
[
MAX_PATH
];
int
imagelayout
=
IL_HORIZONTAL
;
...
...
@@ -221,7 +248,8 @@ static PTHEME_PROPERTY UXTHEME_SelectImage(HTHEME hTheme, HDC hdc, int iPartId,
}
}
if
(
reqsize
.
x
<=
size
.
x
&&
reqsize
.
y
<=
size
.
y
)
{
TRACE
(
"Using image size %dx%d, image %d
\n
"
,
reqsize
.
x
,
reqsize
.
y
,
i
+
TMT_IMAGEFILE1
);
TRACE
(
"Using image size %dx%d, image %d
\n
"
,
reqsize
.
x
,
reqsize
.
y
,
imagefile_index_to_property
(
i
));
return
fileProp
;
}
}
...
...
dlls/uxtheme/stylemap.c
View file @
877d12f8
...
...
@@ -187,6 +187,8 @@ static const MSSTYLES_PROPERTY_MAP mapProperty[] = {
{
TMT_INT
,
TMT_MINDPI3
,
L"MINDPI3"
},
{
TMT_INT
,
TMT_MINDPI4
,
L"MINDPI4"
},
{
TMT_INT
,
TMT_MINDPI5
,
L"MINDPI5"
},
{
TMT_INT
,
TMT_MINDPI6
,
L"MINDPI6"
},
{
TMT_INT
,
TMT_MINDPI7
,
L"MINDPI7"
},
{
TMT_FONT
,
TMT_GLYPHFONT
,
L"GLYPHFONT"
},
{
TMT_FILENAME
,
TMT_IMAGEFILE
,
L"IMAGEFILE"
},
{
TMT_FILENAME
,
TMT_IMAGEFILE1
,
L"IMAGEFILE1"
},
...
...
@@ -194,6 +196,8 @@ static const MSSTYLES_PROPERTY_MAP mapProperty[] = {
{
TMT_FILENAME
,
TMT_IMAGEFILE3
,
L"IMAGEFILE3"
},
{
TMT_FILENAME
,
TMT_IMAGEFILE4
,
L"IMAGEFILE4"
},
{
TMT_FILENAME
,
TMT_IMAGEFILE5
,
L"IMAGEFILE5"
},
{
TMT_FILENAME
,
TMT_IMAGEFILE6
,
L"IMAGEFILE6"
},
{
TMT_FILENAME
,
TMT_IMAGEFILE7
,
L"IMAGEFILE7"
},
{
TMT_FILENAME
,
TMT_STOCKIMAGEFILE
,
L"STOCKIMAGEFILE"
},
{
TMT_FILENAME
,
TMT_GLYPHIMAGEFILE
,
L"GLYPHIMAGEFILE"
},
{
TMT_STRING
,
TMT_TEXT
,
L"TEXT"
},
...
...
@@ -206,6 +210,8 @@ static const MSSTYLES_PROPERTY_MAP mapProperty[] = {
{
TMT_POSITION
,
TMT_MINSIZE4
,
L"MINSIZE4"
},
{
TMT_POSITION
,
TMT_MINSIZE5
,
L"MINSIZE5"
},
{
TMT_POSITION
,
TMT_NORMALSIZE
,
L"NORMALSIZE"
},
{
TMT_POSITION
,
TMT_MINSIZE6
,
L"MINSIZE6"
},
{
TMT_POSITION
,
TMT_MINSIZE7
,
L"MINSIZE7"
},
{
TMT_MARGINS
,
TMT_SIZINGMARGINS
,
L"SIZINGMARGINS"
},
{
TMT_MARGINS
,
TMT_CONTENTMARGINS
,
L"CONTENTMARGINS"
},
{
TMT_MARGINS
,
TMT_CAPTIONMARGINS
,
L"CAPTIONMARGINS"
},
...
...
include/tmschema.h
View file @
877d12f8
...
...
@@ -322,6 +322,8 @@ BEGIN_TM_PROPS()
TM_PROP
(
2422
,
TMT
,
MINDPI3
,
INT
)
TM_PROP
(
2423
,
TMT
,
MINDPI4
,
INT
)
TM_PROP
(
2424
,
TMT
,
MINDPI5
,
INT
)
TM_PROP
(
2433
,
TMT
,
MINDPI6
,
INT
)
TM_PROP
(
2434
,
TMT
,
MINDPI7
,
INT
)
/* Font rendering properties */
TM_PROP
(
2601
,
TMT
,
GLYPHFONT
,
FONT
)
...
...
@@ -335,6 +337,8 @@ BEGIN_TM_PROPS()
TM_PROP
(
3006
,
TMT
,
IMAGEFILE5
,
FILENAME
)
TM_PROP
(
3007
,
TMT
,
STOCKIMAGEFILE
,
FILENAME
)
TM_PROP
(
3008
,
TMT
,
GLYPHIMAGEFILE
,
FILENAME
)
TM_PROP
(
3009
,
TMT
,
IMAGEFILE6
,
FILENAME
)
TM_PROP
(
3010
,
TMT
,
IMAGEFILE7
,
FILENAME
)
/* String rendering properties */
TM_PROP
(
3201
,
TMT
,
TEXT
,
STRING
)
...
...
@@ -349,6 +353,8 @@ BEGIN_TM_PROPS()
TM_PROP
(
3407
,
TMT
,
MINSIZE4
,
POSITION
)
TM_PROP
(
3408
,
TMT
,
MINSIZE5
,
POSITION
)
TM_PROP
(
3409
,
TMT
,
NORMALSIZE
,
POSITION
)
TM_PROP
(
3410
,
TMT
,
MINSIZE6
,
POSITION
)
TM_PROP
(
3411
,
TMT
,
MINSIZE7
,
POSITION
)
/* Margin rendering properties */
TM_PROP
(
3601
,
TMT
,
SIZINGMARGINS
,
MARGINS
)
...
...
include/vssym32.h
View file @
877d12f8
...
...
@@ -301,6 +301,8 @@ enum GLYPHFONTSIZINGTYPE {
#define TMT_OPACITY 2430
#define TMT_COLORIZATIONCOLOR 2431
#define TMT_COLORIZATIONOPACITY 2432
#define TMT_MINDPI6 2433
#define TMT_MINDPI7 2434
#define TMT_GLYPHFONT 2601
#define TMT_IMAGEFILE 3001
#define TMT_IMAGEFILE1 3002
...
...
@@ -309,6 +311,8 @@ enum GLYPHFONTSIZINGTYPE {
#define TMT_IMAGEFILE4 3005
#define TMT_IMAGEFILE5 3006
#define TMT_GLYPHIMAGEFILE 3008
#define TMT_IMAGEFILE6 3009
#define TMT_IMAGEFILE7 3010
#define TMT_TEXT 3201
#define TMT_CLASSICVALUE 3202
#define TMT_OFFSET 3401
...
...
@@ -320,6 +324,8 @@ enum GLYPHFONTSIZINGTYPE {
#define TMT_MINSIZE4 3407
#define TMT_MINSIZE5 3408
#define TMT_NORMALSIZE 3409
#define TMT_MINSIZE6 3410
#define TMT_MINSIZE7 3411
#define TMT_SIZINGMARGINS 3601
#define TMT_CONTENTMARGINS 3602
#define TMT_CAPTIONMARGINS 3603
...
...
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