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
65e9a6e0
Commit
65e9a6e0
authored
Nov 04, 2008
by
Sergey Khodych
Committed by
Alexandre Julliard
Nov 06, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: toolbar: Improve text layout in TBSTYLE_LIST toolbars.
parent
1232b084
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
11 deletions
+30
-11
toolbar.c
dlls/comctl32/tests/toolbar.c
+24
-0
toolbar.c
dlls/comctl32/toolbar.c
+6
-11
No files found.
dlls/comctl32/tests/toolbar.c
View file @
65e9a6e0
...
@@ -721,6 +721,12 @@ static tbsize_result_t tbsize_results[] =
...
@@ -721,6 +721,12 @@ static tbsize_result_t tbsize_results[] =
{
{
0
,
0
,
672
,
100
},
{
239
,
102
},
3
,
{
{
{
0
,
0
,
672
,
100
},
{
239
,
102
},
3
,
{
{
0
,
2
,
100
,
102
},
{
100
,
2
,
139
,
102
},
{
139
,
2
,
239
,
102
},
{
0
,
2
,
100
,
102
},
{
100
,
2
,
139
,
102
},
{
139
,
2
,
239
,
102
},
},
},
},
},
{
{
0
,
0
,
672
,
42
},
{
183
,
40
},
3
,
{
{
0
,
2
,
75
,
40
},
{
75
,
2
,
118
,
40
},
{
118
,
2
,
183
,
40
},
},
},
{
{
0
,
0
,
672
,
42
},
{
67
,
40
},
1
,
{
{
0
,
2
,
67
,
40
},
},
},
};
};
static
int
tbsize_numtests
=
0
;
static
int
tbsize_numtests
=
0
;
...
@@ -956,6 +962,24 @@ static void test_sizes(void)
...
@@ -956,6 +962,24 @@ static void test_sizes(void)
SendMessageA
(
hToolbar
,
TB_AUTOSIZE
,
(
WPARAM
)
0
,
(
LPARAM
)
0
);
SendMessageA
(
hToolbar
,
TB_AUTOSIZE
,
(
WPARAM
)
0
,
(
LPARAM
)
0
);
check_sizes
();
check_sizes
();
rebuild_toolbar
(
&
hToolbar
);
SetWindowLong
(
hToolbar
,
GWL_STYLE
,
TBSTYLE_LIST
|
GetWindowLong
(
hToolbar
,
GWL_STYLE
));
ok
(
SendMessageA
(
hToolbar
,
TB_SETBITMAPSIZE
,
(
WPARAM
)
0
,
(
LPARAM
)
MAKELONG
(
32
,
32
)
)
==
1
,
"TB_SETBITMAPSIZE failed
\n
"
);
ok
(
SendMessageA
(
hToolbar
,
TB_SETBUTTONSIZE
,
(
WPARAM
)
0
,
(
LPARAM
)
MAKELONG
(
100
,
100
))
==
1
,
"TB_SETBUTTONSIZE failed
\n
"
);
ok
(
SendMessageA
(
hToolbar
,
TB_ADDBUTTONS
,
(
WPARAM
)
1
,
(
LPARAM
)
&
buttons2
[
0
])
==
1
,
"TB_ADDBUTTONS failed
\n
"
);
ok
(
SendMessageA
(
hToolbar
,
TB_ADDBUTTONS
,
(
WPARAM
)
1
,
(
LPARAM
)
&
buttons3
[
2
])
==
1
,
"TB_ADDBUTTONS failed
\n
"
);
ok
(
SendMessageA
(
hToolbar
,
TB_ADDBUTTONS
,
(
WPARAM
)
1
,
(
LPARAM
)
&
buttons3
[
3
])
==
1
,
"TB_ADDBUTTONS failed
\n
"
);
SendMessageA
(
hToolbar
,
TB_AUTOSIZE
,
(
WPARAM
)
0
,
(
LPARAM
)
0
);
check_sizes_todo
(
0xff
);
rebuild_toolbar
(
&
hToolbar
);
SetWindowLong
(
hToolbar
,
GWL_STYLE
,
TBSTYLE_LIST
|
GetWindowLong
(
hToolbar
,
GWL_STYLE
));
ok
(
SendMessageA
(
hToolbar
,
TB_SETBITMAPSIZE
,
(
WPARAM
)
0
,
(
LPARAM
)
MAKELONG
(
32
,
32
)
)
==
1
,
"TB_SETBITMAPSIZE failed
\n
"
);
ok
(
SendMessageA
(
hToolbar
,
TB_SETBUTTONSIZE
,
(
WPARAM
)
0
,
(
LPARAM
)
MAKELONG
(
100
,
100
))
==
1
,
"TB_SETBUTTONSIZE failed
\n
"
);
ok
(
SendMessageA
(
hToolbar
,
TB_ADDBUTTONS
,
(
WPARAM
)
1
,
(
LPARAM
)
&
buttons3
[
3
])
==
1
,
"TB_ADDBUTTONS failed
\n
"
);
SendMessageA
(
hToolbar
,
TB_AUTOSIZE
,
(
WPARAM
)
0
,
(
LPARAM
)
0
);
check_sizes
();
DestroyWindow
(
hToolbar
);
DestroyWindow
(
hToolbar
);
}
}
...
...
dlls/comctl32/toolbar.c
View file @
65e9a6e0
...
@@ -912,8 +912,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr
...
@@ -912,8 +912,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr
rcText
.
right
-=
GetSystemMetrics
(
SM_CXEDGE
);
rcText
.
right
-=
GetSystemMetrics
(
SM_CXEDGE
);
if
(
dwStyle
&
TBSTYLE_LIST
)
if
(
dwStyle
&
TBSTYLE_LIST
)
{
{
if
(
TOOLBAR_IsValidBitmapIndex
(
infoPtr
,
btnPtr
->
iBitmap
))
rcText
.
left
+=
infoPtr
->
nBitmapWidth
+
infoPtr
->
iListGap
+
2
;
rcText
.
left
+=
infoPtr
->
nBitmapWidth
+
infoPtr
->
iListGap
+
2
;
}
}
else
else
{
{
...
@@ -1574,15 +1573,11 @@ static inline SIZE TOOLBAR_MeasureButton(const TOOLBAR_INFO *infoPtr, SIZE sizeS
...
@@ -1574,15 +1573,11 @@ static inline SIZE TOOLBAR_MeasureButton(const TOOLBAR_INFO *infoPtr, SIZE sizeS
sizeButton
.
cy
+=
infoPtr
->
szPadding
.
cy
;
sizeButton
.
cy
+=
infoPtr
->
szPadding
.
cy
;
/* calculate button width */
/* calculate button width */
if
(
bHasBitmap
)
sizeButton
.
cx
=
2
*
GetSystemMetrics
(
SM_CXEDGE
)
+
{
infoPtr
->
nBitmapWidth
+
infoPtr
->
iListGap
;
sizeButton
.
cx
=
2
*
GetSystemMetrics
(
SM_CXEDGE
)
+
if
(
sizeString
.
cx
>
0
)
infoPtr
->
nBitmapWidth
+
infoPtr
->
iListGap
;
sizeButton
.
cx
+=
sizeString
.
cx
+
infoPtr
->
szPadding
.
cx
;
if
(
sizeString
.
cx
>
0
)
sizeButton
.
cx
+=
sizeString
.
cx
+
infoPtr
->
szPadding
.
cx
;
}
else
sizeButton
.
cx
=
sizeString
.
cx
+
infoPtr
->
szPadding
.
cx
;
}
}
else
else
{
{
...
...
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