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
e53a7639
Commit
e53a7639
authored
Aug 29, 2005
by
Frank Richter
Committed by
Alexandre Julliard
Aug 29, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If a MINSIZEn property is not present, fall back to actual size of nth
image to determine whether it is suitable.
parent
41f21894
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
4 deletions
+34
-4
draw.c
dlls/uxtheme/draw.c
+34
-4
No files found.
dlls/uxtheme/draw.c
View file @
e53a7639
...
...
@@ -187,11 +187,41 @@ static PTHEME_PROPERTY UXTHEME_SelectImage(HTHEME hTheme, HDC hdc, int iPartId,
POINT
size
=
{
pRect
->
right
-
pRect
->
left
,
pRect
->
bottom
-
pRect
->
top
};
POINT
reqsize
;
for
(
i
=
4
;
i
>=
0
;
i
--
)
{
if
(
SUCCEEDED
(
GetThemePosition
(
hTheme
,
iPartId
,
iStateId
,
i
+
TMT_MINSIZE1
,
&
reqsize
)))
{
if
(
reqsize
.
x
>=
size
.
x
&&
reqsize
.
y
>=
size
.
y
)
{
TRACE
(
"Using image size %ldx%ld, image %d
\n
"
,
reqsize
.
x
,
reqsize
.
y
,
i
+
TMT_IMAGEFILE1
);
return
MSSTYLES_FindProperty
(
hTheme
,
iPartId
,
iStateId
,
TMT_FILENAME
,
i
+
TMT_IMAGEFILE1
);
PTHEME_PROPERTY
fileProp
=
MSSTYLES_FindProperty
(
hTheme
,
iPartId
,
iStateId
,
TMT_FILENAME
,
i
+
TMT_IMAGEFILE1
);
if
(
!
fileProp
)
continue
;
if
(
FAILED
(
GetThemePosition
(
hTheme
,
iPartId
,
iStateId
,
i
+
TMT_MINSIZE1
,
&
reqsize
)))
{
/* fall back to size of Nth image */
WCHAR
szPath
[
MAX_PATH
];
int
imagelayout
=
IL_HORIZONTAL
;
int
imagecount
=
1
;
int
imagenum
;
BITMAP
bmp
;
HBITMAP
hBmp
;
BOOL
hasAlpha
;
lstrcpynW
(
szPath
,
fileProp
->
lpValue
,
min
(
fileProp
->
dwValueLen
+
1
,
sizeof
(
szPath
)
/
sizeof
(
szPath
[
0
])));
hBmp
=
MSSTYLES_LoadBitmap
(
hTheme
,
szPath
,
&
hasAlpha
);
if
(
!
hBmp
)
continue
;
GetThemeEnumValue
(
hTheme
,
iPartId
,
iStateId
,
TMT_IMAGELAYOUT
,
&
imagelayout
);
GetThemeInt
(
hTheme
,
iPartId
,
iStateId
,
TMT_IMAGECOUNT
,
&
imagecount
);
imagenum
=
max
(
min
(
imagecount
,
iStateId
),
1
)
-
1
;
GetObjectW
(
hBmp
,
sizeof
(
bmp
),
&
bmp
);
if
(
imagelayout
==
IL_VERTICAL
)
{
reqsize
.
x
=
bmp
.
bmWidth
;
reqsize
.
y
=
bmp
.
bmHeight
/
imagecount
;
}
else
{
reqsize
.
x
=
bmp
.
bmWidth
/
imagecount
;
reqsize
.
y
=
bmp
.
bmHeight
;
}
}
if
(
reqsize
.
x
<=
size
.
x
&&
reqsize
.
y
<=
size
.
y
)
{
TRACE
(
"Using image size %ldx%ld, image %d
\n
"
,
reqsize
.
x
,
reqsize
.
y
,
i
+
TMT_IMAGEFILE1
);
return
fileProp
;
}
}
/* If an image couldnt be selected, choose the smallest one */
...
...
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