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
cfbafe32
Commit
cfbafe32
authored
Jul 30, 1999
by
Pierre Mageau
Committed by
Alexandre Julliard
Jul 30, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a problem when the style is BS_BITMAP or BS_ICON: the bitmap or
icon needed to be centered when the button is smaller than the bitmap.
parent
4691d0cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
button.c
controls/button.c
+18
-12
No files found.
controls/button.c
View file @
cfbafe32
...
...
@@ -480,6 +480,10 @@ static void BUTTON_DrawPushButton(
imageWidth
=
bm
.
bmWidth
;
imageHeight
=
bm
.
bmHeight
;
DeleteObject
(
iconInfo
.
hbmColor
);
DeleteObject
(
iconInfo
.
hbmMask
);
}
else
{
...
...
@@ -495,17 +499,15 @@ static void BUTTON_DrawPushButton(
xOffset
=
(((
rc
.
right
-
rc
.
left
)
-
2
*
xBorderOffset
)
-
imageWidth
)
/
2
;
yOffset
=
(((
rc
.
bottom
-
rc
.
top
)
-
2
*
yBorderOffset
)
-
imageHeight
)
/
2
;
/* If the image is to big for the button */
if
(
xOffset
<
0
)
{
imageWidth
=
rc
.
right
-
rc
.
left
-
2
*
xBorderOffset
-
1
;
xOffset
=
xBorderOffset
;
}
if
(
yOffset
<
0
)
/* If the image is too big for the button then create a region*/
if
(
xOffset
<
0
||
yOffset
<
0
)
{
imageHeight
=
rc
.
bottom
-
rc
.
top
-
2
*
yBorderOffset
-
1
;
yOffset
=
yBorderOffset
;
HRGN
hBitmapRgn
=
NULL
;
hBitmapRgn
=
CreateRectRgn
(
rc
.
left
+
xBorderOffset
,
rc
.
top
+
yBorderOffset
,
rc
.
right
-
xBorderOffset
,
rc
.
bottom
-
yBorderOffset
);
SelectClipRgn
(
hDC
,
hBitmapRgn
);
DeleteObject
(
hBitmapRgn
);
}
/* Let minimum 1 space from border */
...
...
@@ -517,8 +519,7 @@ static void BUTTON_DrawPushButton(
if
(
wndPtr
->
dwStyle
&
BS_ICON
)
{
DrawIcon
(
hDC
,
rc
.
left
+
xOffset
,
rc
.
top
+
yOffset
,
rc
.
left
+
xOffset
,
rc
.
top
+
yOffset
,
(
HICON
)
infoPtr
->
hImage
);
}
else
...
...
@@ -535,6 +536,11 @@ static void BUTTON_DrawPushButton(
DeleteDC
(
hdcMem
);
}
if
(
xOffset
<
0
||
yOffset
<
0
)
{
SelectClipRgn
(
hDC
,
NULL
);
}
}
if
(
TWEAK_WineLook
!=
WIN31_LOOK
...
...
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