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
88ebde86
Commit
88ebde86
authored
Sep 29, 2000
by
Francois Gouget
Committed by
Alexandre Julliard
Sep 29, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified the bitmap centering algorithm to take the button's border
into account.
parent
6bac4f2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
toolbar.c
dlls/comctl32/toolbar.c
+14
-11
No files found.
dlls/comctl32/toolbar.c
View file @
88ebde86
...
...
@@ -305,14 +305,14 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
DWORD
dwStyle
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
BOOL
hasDropDownArrow
=
TOOLBAR_HasDropDownArrows
(
infoPtr
->
dwExStyle
)
&&
(
btnPtr
->
fsStyle
&
TBSTYLE_DROPDOWN
);
RECT
rc
,
rcArrow
;
INT
xOffset
=
(
infoPtr
->
nButtonWidth
/
2
)
-
(
infoPtr
->
nBitmapWidth
/
2
);
RECT
rc
,
rcArrow
,
rcBitmap
;
if
(
btnPtr
->
fsState
&
TBSTATE_HIDDEN
)
return
;
rc
=
btnPtr
->
rect
;
CopyRect
(
&
rcArrow
,
&
rc
);
CopyRect
(
&
rcBitmap
,
&
rc
);
FillRect
(
hdc
,
&
rc
,
GetSysColorBrush
(
COLOR_BTNFACE
));
...
...
@@ -325,6 +325,10 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
rcArrow
.
left
=
rc
.
right
;
}
/* Take the border into account and center the bitmap horizontally */
rcBitmap
.
left
+=
(
infoPtr
->
nButtonWidth
-
infoPtr
->
nBitmapWidth
-
1
-
2
)
/
2
;
rcBitmap
.
top
+=
1
;
TRACE
(
"iBitmap: %d
\n
"
,
btnPtr
->
iBitmap
);
/* separator */
...
...
@@ -359,9 +363,9 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
if
(
infoPtr
->
himlDis
&&
TOOLBAR_IsValidBitmapIndex
(
infoPtr
,
btnPtr
->
iBitmap
))
ImageList_Draw
(
infoPtr
->
himlDis
,
btnPtr
->
iBitmap
,
hdc
,
rc
.
left
+
xOffset
+
1
,
rc
.
top
+
1
,
ILD_NORMAL
);
rc
Bitmap
.
left
,
rcBitmap
.
top
,
ILD_NORMAL
);
else
TOOLBAR_DrawMasked
(
infoPtr
,
btnPtr
,
hdc
,
rc
.
left
+
xOffset
+
1
,
rc
.
top
+
1
);
TOOLBAR_DrawMasked
(
infoPtr
,
btnPtr
,
hdc
,
rc
Bitmap
.
left
,
rcBitmap
.
top
);
TOOLBAR_DrawString
(
infoPtr
,
btnPtr
,
hdc
,
btnPtr
->
fsState
,
dwStyle
);
return
;
...
...
@@ -387,7 +391,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
if
(
TOOLBAR_IsValidBitmapIndex
(
infoPtr
,
btnPtr
->
iBitmap
))
ImageList_Draw
(
infoPtr
->
himlDef
,
btnPtr
->
iBitmap
,
hdc
,
rc
.
left
+
xOffset
+
2
,
rc
.
top
+
2
,
ILD_NORMAL
);
rc
Bitmap
.
left
+
1
,
rcBitmap
.
top
+
1
,
ILD_NORMAL
);
TOOLBAR_DrawString
(
infoPtr
,
btnPtr
,
hdc
,
btnPtr
->
fsState
,
dwStyle
);
return
;
...
...
@@ -407,8 +411,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
if
(
TOOLBAR_IsValidBitmapIndex
(
infoPtr
,
btnPtr
->
iBitmap
))
ImageList_Draw
(
infoPtr
->
himlDef
,
btnPtr
->
iBitmap
,
hdc
,
rc
.
left
+
xOffset
,
rc
.
top
+
2
,
ILD_NORMAL
);
rcBitmap
.
left
+
1
,
rcBitmap
.
top
+
1
,
ILD_NORMAL
);
TOOLBAR_DrawString
(
infoPtr
,
btnPtr
,
hdc
,
btnPtr
->
fsState
,
dwStyle
);
return
;
}
...
...
@@ -419,7 +422,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
BF_SOFT
|
BF_RECT
|
BF_MIDDLE
|
BF_ADJUST
);
TOOLBAR_DrawPattern
(
hdc
,
&
rc
);
TOOLBAR_DrawMasked
(
infoPtr
,
btnPtr
,
hdc
,
rc
.
left
+
xOffset
+
1
,
rc
.
top
+
1
);
TOOLBAR_DrawMasked
(
infoPtr
,
btnPtr
,
hdc
,
rc
Bitmap
.
left
,
rcBitmap
.
top
);
TOOLBAR_DrawString
(
infoPtr
,
btnPtr
,
hdc
,
btnPtr
->
fsState
,
dwStyle
);
return
;
}
...
...
@@ -446,10 +449,10 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
if
(
btnPtr
->
bHot
&&
infoPtr
->
himlHot
&&
TOOLBAR_IsValidBitmapIndex
(
infoPtr
,
btnPtr
->
iBitmap
))
ImageList_Draw
(
infoPtr
->
himlHot
,
btnPtr
->
iBitmap
,
hdc
,
rc
.
left
+
xOffset
+
2
,
rc
.
top
+
2
,
ILD_NORMAL
);
rc
Bitmap
.
left
+
1
,
rcBitmap
.
top
+
1
,
ILD_NORMAL
);
else
if
(
TOOLBAR_IsValidBitmapIndex
(
infoPtr
,
btnPtr
->
iBitmap
))
ImageList_Draw
(
infoPtr
->
himlDef
,
btnPtr
->
iBitmap
,
hdc
,
rc
.
left
+
xOffset
+
2
,
rc
.
top
+
2
,
ILD_NORMAL
);
rc
Bitmap
.
left
+
1
,
rcBitmap
.
top
+
1
,
ILD_NORMAL
);
}
else
{
...
...
@@ -465,7 +468,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
if
(
TOOLBAR_IsValidBitmapIndex
(
infoPtr
,
btnPtr
->
iBitmap
))
ImageList_Draw
(
infoPtr
->
himlDef
,
btnPtr
->
iBitmap
,
hdc
,
rc
.
left
+
xOffset
+
1
,
rc
.
top
+
1
,
ILD_NORMAL
);
rc
Bitmap
.
left
,
rcBitmap
.
top
,
ILD_NORMAL
);
}
TOOLBAR_DrawString
(
infoPtr
,
btnPtr
,
hdc
,
btnPtr
->
fsState
,
dwStyle
);
...
...
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