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
a77a8903
Commit
a77a8903
authored
Aug 07, 1999
by
Thuy Nguyen
Committed by
Alexandre Julliard
Aug 07, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Take into account icons when determining tab size.
parent
1563e83a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
7 deletions
+43
-7
tab.c
dlls/comctl32/tab.c
+43
-7
No files found.
dlls/comctl32/tab.c
View file @
a77a8903
...
...
@@ -658,16 +658,33 @@ static void TAB_SetItemBounds (HWND hwnd)
if
(
!
((
lStyle
&
TCS_FIXEDWIDTH
)
||
(
lStyle
&
TCS_OWNERDRAWFIXED
)))
{
int
item_height
;
int
icon_height
=
0
;
/*
* Use the current font to determine the height of a tab.
*/
GetTextMetricsA
(
hdc
,
&
fontMetrics
);
/*
* Make sure there is enough space for the letters + growing the
* Get the icon height
*/
if
(
infoPtr
->
himl
)
ImageList_GetIconSize
(
infoPtr
->
himl
,
0
,
&
icon_height
);
/*
* Take the highest between font or icon
*/
if
(
fontMetrics
.
tmHeight
>
icon_height
)
item_height
=
fontMetrics
.
tmHeight
;
else
item_height
=
icon_height
;
/*
* Make sure there is enough space for the letters + icon + growing the
* selected item + extra space for the selected item.
*/
infoPtr
->
tabHeight
=
fontMetrics
.
tmH
eight
+
2
*
VERTICAL_ITEM_PADDING
+
infoPtr
->
tabHeight
=
item_h
eight
+
2
*
VERTICAL_ITEM_PADDING
+
SELECTED_TAB_OFFSET
;
}
...
...
@@ -704,14 +721,27 @@ static void TAB_SetItemBounds (HWND hwnd)
}
else
{
int
icon_width
=
0
;
int
num
=
2
;
/*
* Calculate how wide the tab is depending on the text it contains
*/
GetTextExtentPoint32A
(
hdc
,
infoPtr
->
items
[
curItem
].
pszText
,
lstrlenA
(
infoPtr
->
items
[
curItem
].
pszText
),
&
size
);
/*
* Add the icon width
*/
if
(
infoPtr
->
himl
)
{
ImageList_GetIconSize
(
infoPtr
->
himl
,
&
icon_width
,
0
);
num
++
;
}
infoPtr
->
items
[
curItem
].
rect
.
right
=
infoPtr
->
items
[
curItem
].
rect
.
left
+
size
.
cx
+
2
*
HORIZONTAL_ITEM_PADDING
;
size
.
cx
+
icon_width
+
num
*
HORIZONTAL_ITEM_PADDING
;
}
TRACE
(
"TextSize: %i
\n
"
,
size
.
cx
);
...
...
@@ -930,7 +960,7 @@ static void TAB_DrawItem(
ImageList_Draw
(
infoPtr
->
himl
,
iItem
,
hdc
,
r
.
left
,
r
.
top
+
1
,
ILD_NORMAL
);
ImageList_GetIconSize
(
infoPtr
->
himl
,
&
cx
,
&
cy
);
r
.
left
+=
cx
;
r
.
left
+=
(
cx
+
HORIZONTAL_ITEM_PADDING
)
;
}
/*
...
...
@@ -1344,10 +1374,10 @@ TAB_SetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
wineItem
=&
infoPtr
->
items
[
iItem
];
if
(
tabItem
->
mask
&
TCIF_IMAGE
)
if
(
tabItem
->
mask
&
TCIF_IMAGE
)
wineItem
->
iImage
=
tabItem
->
iImage
;
if
(
tabItem
->
mask
&
TCIF_PARAM
)
if
(
tabItem
->
mask
&
TCIF_PARAM
)
wineItem
->
lParam
=
tabItem
->
lParam
;
if
(
tabItem
->
mask
&
TCIF_RTLREADING
)
...
...
@@ -1363,6 +1393,12 @@ TAB_SetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
lstrcpyA
(
wineItem
->
pszText
,
tabItem
->
pszText
);
}
/*
* Update and repaint tabs.
*/
TAB_SetItemBounds
(
hwnd
);
TAB_InvalidateTabArea
(
hwnd
,
infoPtr
);
return
TRUE
;
}
...
...
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