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
fc43895f
Commit
fc43895f
authored
Nov 26, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Default column width in LVS_LIST to better value.
parent
dbbd2161
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
4 deletions
+32
-4
listview.c
dlls/comctl32/listview.c
+9
-4
listview.c
dlls/comctl32/tests/listview.c
+23
-0
No files found.
dlls/comctl32/listview.c
View file @
fc43895f
...
...
@@ -403,7 +403,7 @@ typedef struct tagLISTVIEW_INFO
#define MAX_EMPTYTEXT_SELECT_WIDTH 80
/* default column width for items in list display mode */
#define DEFAULT_COLUMN_WIDTH
128
#define DEFAULT_COLUMN_WIDTH
96
/* Size of "line" scroll for V & H scrolls */
#define LISTVIEW_SCROLL_ICON_LINE_SIZE 37
...
...
@@ -2786,15 +2786,20 @@ static INT LISTVIEW_CalculateItemWidth(const LISTVIEW_INFO *infoPtr)
}
else
/* LV_VIEW_SMALLICON, or LV_VIEW_LIST */
{
BOOL
empty
;
INT
i
;
for
(
i
=
0
;
i
<
infoPtr
->
nItemCount
;
i
++
)
nItemWidth
=
max
(
LISTVIEW_GetLabelWidth
(
infoPtr
,
i
),
nItemWidth
);
empty
=
nItemWidth
==
0
;
if
(
infoPtr
->
himlSmall
)
nItemWidth
+=
infoPtr
->
iconSize
.
cx
;
if
(
infoPtr
->
himlState
)
nItemWidth
+=
infoPtr
->
iconStateSize
.
cx
;
nItemWidth
=
max
(
DEFAULT_COLUMN_WIDTH
,
nItemWidth
+
WIDTH_PADDING
);
if
(
empty
)
nItemWidth
=
max
(
nItemWidth
,
DEFAULT_COLUMN_WIDTH
);
else
nItemWidth
+=
WIDTH_PADDING
;
}
return
nItemWidth
;
...
...
@@ -7454,7 +7459,7 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
TRACE
(
" inserting at %d, sorted=%d, count=%d, iItem=%d
\n
"
,
nItem
,
is_sorted
,
infoPtr
->
nItemCount
,
lpLVItem
->
iItem
);
nItem
=
DPA_InsertPtr
(
infoPtr
->
hdpaItems
,
nItem
,
hdpaSubItems
);
if
(
nItem
==
-
1
)
goto
fail
;
i
nfoPtr
->
nItemCount
++
;
i
f
(
infoPtr
->
nItemCount
++
==
0
)
LISTVIEW_UpdateItemSize
(
infoPtr
)
;
/* shift indices first so they don't get tangled */
LISTVIEW_ShiftIndices
(
infoPtr
,
nItem
,
1
);
...
...
dlls/comctl32/tests/listview.c
View file @
fc43895f
...
...
@@ -3124,6 +3124,20 @@ static void test_getitemrect(void)
INT
order
[
2
];
POINT
pt
;
/* rectangle isn't empty for empty text items */
hwnd
=
create_custom_listview_control
(
LVS_LIST
);
memset
(
&
item
,
0
,
sizeof
(
item
));
item
.
mask
=
0
;
item
.
iItem
=
0
;
r
=
SendMessage
(
hwnd
,
LVM_INSERTITEMA
,
0
,
(
LPARAM
)
&
item
);
expect
(
0
,
r
);
rect
.
left
=
LVIR_LABEL
;
SendMessage
(
hwnd
,
LVM_GETITEMRECT
,
0
,
(
LPARAM
)
&
rect
);
expect
(
0
,
rect
.
left
);
expect
(
0
,
rect
.
top
);
todo_wine
expect
(
96
,
rect
.
right
);
DestroyWindow
(
hwnd
);
hwnd
=
create_listview_control
(
0
);
ok
(
hwnd
!=
NULL
,
"failed to create a listview window
\n
"
);
...
...
@@ -3921,6 +3935,7 @@ static void test_getcolumnwidth(void)
DWORD
ret
;
DWORD_PTR
style
;
LVCOLUMNA
col
;
LVITEMA
itema
;
/* default column width */
hwnd
=
create_custom_listview_control
(
0
);
...
...
@@ -3938,6 +3953,14 @@ static void test_getcolumnwidth(void)
ret
=
SendMessage
(
hwnd
,
LVM_GETCOLUMNWIDTH
,
0
,
0
);
expect
(
10
,
ret
);
DestroyWindow
(
hwnd
);
/* default column width with item added */
hwnd
=
create_custom_listview_control
(
LVS_LIST
);
memset
(
&
itema
,
0
,
sizeof
(
itema
));
SendMessage
(
hwnd
,
LVM_INSERTITEMA
,
0
,
(
LPARAM
)
&
itema
);
ret
=
SendMessage
(
hwnd
,
LVM_GETCOLUMNWIDTH
,
0
,
0
);
expect
(
96
,
ret
);
DestroyWindow
(
hwnd
);
}
static
void
test_scrollnotify
(
void
)
...
...
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