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
aeefa821
Commit
aeefa821
authored
Feb 04, 2013
by
Daniel Jelinski
Committed by
Alexandre Julliard
Feb 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Always use large icon size when calculating icon spacing.
parent
cb77ab1a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
27 deletions
+18
-27
listview.c
dlls/comctl32/listview.c
+8
-27
listview.c
dlls/comctl32/tests/listview.c
+10
-0
No files found.
dlls/comctl32/listview.c
View file @
aeefa821
...
...
@@ -8586,18 +8586,18 @@ static DWORD LISTVIEW_SetHoverTime(LISTVIEW_INFO *infoPtr, DWORD dwHoverTime)
*/
static
DWORD
LISTVIEW_SetIconSpacing
(
LISTVIEW_INFO
*
infoPtr
,
INT
cx
,
INT
cy
)
{
INT
iconWidth
=
0
,
iconHeight
=
0
;
DWORD
oldspacing
=
MAKELONG
(
infoPtr
->
iconSpacing
.
cx
,
infoPtr
->
iconSpacing
.
cy
);
TRACE
(
"requested=(%d,%d)
\n
"
,
cx
,
cy
);
/* this is supported only for LVS_ICON style */
if
(
infoPtr
->
uView
!=
LV_VIEW_ICON
)
return
oldspacing
;
/* set to defaults, if instructed to */
if
(
cx
==
-
1
&&
cy
==
-
1
)
{
cx
=
GetSystemMetrics
(
SM_CXICONSPACING
)
-
GetSystemMetrics
(
SM_CXICON
)
+
infoPtr
->
iconSize
.
cx
;
cy
=
GetSystemMetrics
(
SM_CYICONSPACING
)
-
GetSystemMetrics
(
SM_CYICON
)
+
infoPtr
->
iconSize
.
cy
;
if
(
infoPtr
->
himlNormal
)
ImageList_GetIconSize
(
infoPtr
->
himlNormal
,
&
iconWidth
,
&
iconHeight
);
cx
=
GetSystemMetrics
(
SM_CXICONSPACING
)
-
GetSystemMetrics
(
SM_CXICON
)
+
iconWidth
;
cy
=
GetSystemMetrics
(
SM_CYICONSPACING
)
-
GetSystemMetrics
(
SM_CYICON
)
+
iconHeight
;
}
/* if 0 then keep width */
if
(
cx
!=
0
)
...
...
@@ -9054,7 +9054,6 @@ static BOOL LISTVIEW_SetUnicodeFormat( LISTVIEW_INFO *infoPtr, BOOL unicode)
*/
static
INT
LISTVIEW_SetView
(
LISTVIEW_INFO
*
infoPtr
,
DWORD
nView
)
{
SIZE
oldIconSize
=
infoPtr
->
iconSize
;
HIMAGELIST
himl
;
if
(
infoPtr
->
uView
==
nView
)
return
1
;
...
...
@@ -9080,14 +9079,6 @@ static INT LISTVIEW_SetView(LISTVIEW_INFO *infoPtr, DWORD nView)
switch
(
nView
)
{
case
LV_VIEW_ICON
:
if
((
infoPtr
->
iconSize
.
cx
!=
oldIconSize
.
cx
)
||
(
infoPtr
->
iconSize
.
cy
!=
oldIconSize
.
cy
))
{
TRACE
(
"icon old size=(%d,%d), new size=(%d,%d)
\n
"
,
oldIconSize
.
cx
,
oldIconSize
.
cy
,
infoPtr
->
iconSize
.
cx
,
infoPtr
->
iconSize
.
cy
);
LISTVIEW_SetIconSpacing
(
infoPtr
,
-
1
,
-
1
);
}
LISTVIEW_Arrange
(
infoPtr
,
LVA_DEFAULT
);
break
;
case
LV_VIEW_SMALLICON
:
LISTVIEW_Arrange
(
infoPtr
,
LVA_DEFAULT
);
break
;
...
...
@@ -11016,7 +11007,6 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
if
(
uNewView
!=
uOldView
)
{
SIZE
oldIconSize
=
infoPtr
->
iconSize
;
HIMAGELIST
himl
;
SendMessageW
(
infoPtr
->
hwndEdit
,
WM_KILLFOCUS
,
0
,
0
);
...
...
@@ -11027,17 +11017,8 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
himl
=
(
uNewView
==
LVS_ICON
?
infoPtr
->
himlNormal
:
infoPtr
->
himlSmall
);
set_icon_size
(
&
infoPtr
->
iconSize
,
himl
,
uNewView
!=
LVS_ICON
);
if
(
uNewView
==
LVS_ICON
)
{
if
((
infoPtr
->
iconSize
.
cx
!=
oldIconSize
.
cx
)
||
(
infoPtr
->
iconSize
.
cy
!=
oldIconSize
.
cy
))
{
TRACE
(
"icon old size=(%d,%d), new size=(%d,%d)
\n
"
,
oldIconSize
.
cx
,
oldIconSize
.
cy
,
infoPtr
->
iconSize
.
cx
,
infoPtr
->
iconSize
.
cy
);
LISTVIEW_SetIconSpacing
(
infoPtr
,
-
1
,
-
1
);
}
}
else
if
(
uNewView
==
LVS_REPORT
)
if
(
uNewView
==
LVS_REPORT
)
{
HDLAYOUT
hl
;
WINDOWPOS
wp
;
...
...
dlls/comctl32/tests/listview.c
View file @
aeefa821
...
...
@@ -4656,6 +4656,16 @@ static void test_getitemspacing(void)
expect
(
cx
,
LOWORD
(
ret
));
expect
(
cy
,
HIWORD
(
ret
));
/* spacing does not depend on selected view type */
ret
=
SendMessage
(
hwnd
,
LVM_SETIMAGELIST
,
LVSIL_NORMAL
,
(
LPARAM
)
himl40
);
expect
(
0
,
ret
);
ret
=
SendMessage
(
hwnd
,
LVM_GETITEMSPACING
,
FALSE
,
0
);
/* spacing + icon size returned */
expect
(
cx
+
40
,
LOWORD
(
ret
));
expect
(
cy
+
40
,
HIWORD
(
ret
));
SendMessage
(
hwnd
,
LVM_SETIMAGELIST
,
LVSIL_NORMAL
,
0
);
ImageList_Destroy
(
himl40
);
DestroyWindow
(
hwnd
);
/* LVS_REPORT */
...
...
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